Am 24.06.2011 um 14:47 schrieb AlexVhr:

> class Document(EntityBase):
> 
>    __metaclass__ = EntityMeta
>    doc_number = Field(Unicode(5),index=True)
> 
> class Order(Document):
>    pass
> 
> class Invoice(Document):
>    doc_number = Field(Unicode(10),index=True)  #this type of
> documents needs a longer number field
> 
> The result is:
> 
> "File "C:\Python27\Lib\site-packages\elixir-0.7.1-py2.7.egg\elixir
> \entity.py", line 493, in add_column
>    (col.key, self.entity.__name__))
> Exception: Column 'doc_number' already exist in 'Invoice' ! "
> 
> I know I could move 'doc_number' from inside the Document() and into
> the Invoice() (and into Order() and so on...), but that kinda defeats
> the encapsulation idea - Document() contains some common
> functionality, that relies on 'doc_number' being present. Is there a
> way around this?

"allowcoloverride" might be what you're looking for: 
http://elixir.ematia.de/apidocs/elixir.options.html


HTH,

Andreas

-- 
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.

Reply via email to