On Dec 9, 2008, at 4:09 PM, Angri wrote:
> > I can not agree that extending is "safe" as I've encountered another > problem with custom class name: > http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/sql/util.py#L145 rev 5454 removes AnnotatedColumn's reliance upon names within the expression package. To subclass Column, this is the current recipe: from sqlalchemy.sql.util import Annotated, annotated_classes class MyColumn(Column): __visit_name__ = "column" class AnnotatedMyColumn(Annotated, MyColumn): __visit_name__ = "column" annotated_classes[MyColumn] = AnnotatedMyColumn There are of course metaclass methods of making this automatic. But here we have pure "traditional OOP" style - make all the classes explicitly, register them, etc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
