Hello,
I have a problem using Elixir 0.7.1, I don't know if it is an issue of
Elixir or SQLA.
I have this classes:
class Account(Entity):
username = Field(Unicode(128), primary_key=True)
password = Field(SHA1(), required=True)
secret_question = Field(Unicode(128), default='')
secret_answer = Field(Unicode(128), default='')
owner = ManyToOne('Ens', required=True)
groups = ManyToMany('AccountGroup', tablename='account_groups')
roles = ManyToMany('AccountRole', tablename='account_roles')
setting = OneToOne('AccountSetting')
parent = ManyToOne('Account')
children = OneToMany('Account')
using_options(inheritance='multi', tablename='account')
class AccountSetting(Entity):
account = ManyToOne('Account', required=True)
created = Field(DateTime)
modified = Field(DateTime)
enabled = Field(Boolean, required=True)
using_options(inheritance='multi', tablename='account_setting')
In my code I need to introspect the above objects, here an example:
for property in Account.mapper.iterate_properties:
if type(property) == RelationProperty:
print property.key, property.direction.name
Here the output:
owner MANYTOONE
groups MANYTOMANY
roles MANYTOMANY
children ONETOMANY
setting ONETOMANY
Why the statement "print property.key, property.direction.name" (for
"setting") prints ONETOMANY instead of ONETOONE?
This behaviour is setted by Elixir or SQLA?
Can you help me?
--
Ing. Stefano Fontanelli
PhD Student, Scuola Superiore Sant'Anna
ReTiS Lab c/o CEIICP
Via G. Moruzzi, 1
56124 Pisa (Italy)
tel: +39 050 5492010, mobile: +39 333 3653294
skype: stefanofontanelli
homepage: http://retis.sssup.it/~stefano/
--
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.