On Jan 22, 3:46 am, Jonathan LaCour <[EMAIL PROTECTED]>
wrote:
> Vinay Sajip wrote:
> > I know that arbitrary keyword arguments passed to builders get
> > passed through to SQLAlchemy column objects. However, could you
> > reserve one particular keyword argument (e.g. 'attributes')
> > which can be used to add arbitrary user-defined information at
> > model-definition time, which can then be used by specialised
> > builders?
>
> If you want to store application-specific information on your
> columns, you can use the existing SQLAlchemy `info` keyword
> argument, which was created precisely for this purpose:
>
> class Person(Entity):
> name = Field(Text, info={'mykey':'myvalue'})
> age = Field(Integer, info={'anotherkey':'anotherval'})
>
> setup_all()
> print Person.table.c.name.info
>
> Best of luck --
>
> --
> Jonathan LaCourhttp://cleverdevil.org
Just the ticket. Thank you!
Vinay Sajip
http://www.red-dove.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---