#73 SQLObject instantiating superclasses in .6.1

closed-wont-fix
nobody
None
5
2005-06-17
2005-03-30
Jonathan Ellis
No

I created an "abstract" base class to workaround the
__connection__.style bug that Oleg mentioned:

class SWObject(SQLObject):
_connection = conn
_style = SWStyle()
_idType = str
_fromDatabase = True

class Faq(SWObject):
_table = 'faqs'
companies = MultipleJoin('Company', joinColumn='faqid')
qnas = MultipleJoin('QNA', joinColumn='faqid')
...

and I got

psycopg.ProgrammingError: ERROR: relation "swobject"
does not exist

SELECT pg_catalog.pg_get_constraintdef(oid) as
condef
FROM pg_catalog.pg_constraint r
WHERE r.conrelid = 'SWObject'::regclass AND rD

when I moved _fromDatabase into each subclass I stopped
getting this error.

Discussion

  • Jonathan Ellis
    Jonathan Ellis
    2005-03-30

    Logged In: YES
    user_id=657828

    sorry, looks like this is fixed in trunk already

     
  • Jonathan Ellis
    Jonathan Ellis
    2005-03-30

    Logged In: YES
    user_id=657828

    I lied. It's broken in trunk too. (Didn't kill my python
    buffer to force re-import, oops.)

     
  • Oleg Broytman
    Oleg Broytman
    2005-04-05

    Logged In: YES
    user_id=4799

    Why do you think it is broken? You've asked to draw SWObject
    from your database and got an error. Of course - there is no
    swobject in the database.

     
  • Oleg Broytman
    Oleg Broytman
    2005-06-17

    • status: open --> closed-wont-fix