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 LaCour
http://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
-~----------~----~----~----~------~----~------~--~---