Is this checked in?
I've tried using both trunk and the autodelay branch from svn without
any success :/

from elixir import *
from sqlalchemy import UniqueConstraint

class Author(Entity):
    has_field("name", Unicode)

class Book(Entity):
    has_field("title", Unicode, nullable=False)
    belongs_to("author", of_kind="Author")

    using_table_options(UniqueConstraint("title", "author_id"))


Traceback (most recent call last):
  File "temp.py", line 17, in <module>
    setup_all()
  File "build/bdist.linux-i686/egg/elixir/__init__.py", line 125, in
setup_all
  File "build/bdist.linux-i686/egg/elixir/entity.py", line 257, in
setup_table
  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg/
sqlalchemy/schema.py", line 181, in __call__
    table._init_items(*args)
  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg/
sqlalchemy/schema.py", line 36, in _init_items
    item._set_parent(self)
  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg/
sqlalchemy/schema.py", line 1007, in _set_parent
    self.append_column(table.c[c])
  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg/
sqlalchemy/util.py", line 212, in __getitem__
    return self._data[key]
KeyError: 'author_id'


Thanks,

Matt


On Jul 30, 11:59 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> On 7/26/07, Vsevolod Balashov <[EMAIL PROTECTED]> wrote:
>
>
>
> > I`m implement "elixir-like" constraint`s definition. Look it at
> >http://pylonshq.com/pasties/381
>
> Thanks for contributing, though this is not needed anymore with the
> latest versions of the autodelay branch:
>
> you can simply do:
>
> class Book(Entity):
>     has_field('title', String(80), nullable=False)
>    belongs_to('autor', of_kind='Autor')
>
>     using_table_options(UniqueConstraint('title', 'autor_id'))
>
> --
> Gaƫtan de Mentenhttp://openhex.org


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