This is the method we've been using for the past few months. The
problem we're running into now is that we're going to have to start
using these models across multiple projects. We'd obviously prefer to
not have to fork them just to change the class reference. We'll keep
using the full path for now. Thanks for the help and thanks for the
great project.
-brad
On May 20, 4:44 pm, Jonathan LaCour <[EMAIL PROTECTED]>
wrote:
> kremlan wrote:
> > With this change I get KeyError: 'Preference'. I have tried many
> > variations on what the additional imports are (different modules,
> > * vs explicit import, etc) and the only pattern that has emerged
> > is I can't import more than one additional item other than elixir.
> > (I have also tried importing elixir classes/functions explicitly)
>
> > anyone have any ideas?
>
> We badly need to update our documentation, and remove the incorrect
> tutorial on the wiki to reflect this, but you need to make sure to
> specify the full importable path to the entity you are referencing
> in your relationships. In your case:
>
> erp/model/user.py
> --------------------------
> from elixir import *
>
> class User(Entity):
> using_options(tablename='users', autoload=True)
>
> preferences = OneToMany('erp.model.pref.Preference')
>
> erp/model/pref.py
> -------------------------
> from elixir import *
>
> class Preference(Entity):
> using_options(tablename='user_preferences', autoload=True)
>
> user = ManyToOne('erp.model.user.User', colname='user_id')
>
> Good luck.
>
> --
> Jonathan LaCourhttp://cleverdevil.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
-~----------~----~----~----~------~----~------~--~---