But I had the same problem without elixir; and using the keyword format fixed it also...
On Sep 29, 11:30 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 29, 2008 at 12:25 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Ah; that works. So, when the stack trace says init wants only one > > argument, that argument is a dictionary; hence the **kwargs in > > __call__ ? > > ahh see, it was an Elixir thing. > > > Apparently, the documentation is wrong: > >http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_adding > > no not at all, remember that elixir is an independent package that > builds on top of SA. and one of the things you get by extending that > Entity class is the constructor Gaetan suggested which is the one > giving the error. > > > Thank you Gaetan and Jorge! > > > On Sep 29, 11:06 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote: > >> On Mon, Sep 29, 2008 at 6:17 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > >> wrote: > > >> >> Now this is something I haven't seen, as long as there isn't any name > >> >> collisions, which doesn't seem to be this should never happen. Could > >> >> you make sure some extra files aren't been added, say an old .pyc or a > >> >> copy made by an ide (or a backup) defining several times the same > >> >> models? did you try running it outside ipython, maybe something is > >> >> doing a strange thing there. > > >> > Even worse, I just tried creating another project using elixir and > >> > creating the same simple object and nothing else (no identity stuff): > > >> > class Experiment(Entity): > >> > name = Field(Unicode(30), primary_key=True) > >> > desc = Field(UnicodeText) > > >> > and this is the result: > > >> >>>> Experiment(u'1', u'one') > >> > Traceback (most recent call last): > >> > File "<console>", line 1, in <module> > >> > File "/usr/lib64/python2.5/site-packages/Elixir-0.6.1-py2.5.egg/ > >> > elixir/entity.py", line 718, in __call__ > >> > return type.__call__(cls, *args, **kwargs) > >> > TypeError: __init__() takes exactly 1 argument (3 given) > > >> The default __init__ method provided by Entity in Elixir accepts > >> keyword arguments for field names, not plain arguments... > >> Try: > >> Experiment(name=u'1', desc=u'one') > > >> -- > >> Gaƫtan de Mentenhttp://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

