Hi together,

I'm sorry if this is a rather stupid question, but i havent found a
solution yet :/
I have a few models build with the DeclarativeBase-Class. Now each of
these models has a few columns that they have in common (created_by,
created_at, updated_by, updated_at). Rather than putting the code i
need for these columns and the columns itself in each model, i wanted
to put it into a seperate class and inherit from it (or include it).
But if i query ModelA i just get '(no name)' if i print the created_X
columns. Is there any way to extract columns each model should have
into a seperat class?


class Data:
  created_by = Column(Integer)
  created_at = Column(DateTime)


class ModelA(DeclarativeBase, Data):
  id = Column(Integer, primary_key=True)
  somethingelse = Column(Integer)


Thanks very much!
Daishy

--

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.


Reply via email to