That's strange, since my first post shows I clearly defined __init__
with 3 args and it would't work unless I pass a dictionary.  How's
that work?

On Sep 29, 11:33 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 29, 2008 at 8: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__ ?
>
> > Apparently, the documentation is wrong:
> >http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_adding
>
> No, it's not wrong... In doc example, it provides a specific __init__
> method which accepts args...
>
>
>
>
>
> > 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
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to