Ksenia Marasanova wrote:
Hi,

Given that table is created manually, I wonder, would I get into
troubles by using several classes with the same table, if records are
not overlapping each other? E.g.:

class News(SQLObject):
    class sqlmeta:
        table = 'item'
    itemType = StringCol(default='news')
    title = StringCol()
    contents = StringCol()
    tags = RelatedJoin('Tag')

class Calendar(SQLObject):
    class sqlmeta:
        table = 'item'
    itemType = StringCol(default='calendar')
    title = StringCol()
    contents = StringCol()
    someSpecificCalendarInfo = StringCol()
    tags = RelatedJoin('Tag')

Of course, to get all news I'd need to filter records my self by "itemType".
But would this kind of use break something in the way SQLObject works?

Is this read-only? If so, then it should be fine. If you are writing to the tables, then it probably won't work in the slightest for more reasons than the multiple classes (like not specifying columns and whatnot).


--
Ian Bicking  |  [EMAIL PROTECTED]  |  http://blog.ianbicking.org


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to