Hello
I'm using such classes:
class Domain(Entity):
using_options(tablename='domains')
name = Field(Unicode(1024), nullable = False, unique = True, index
= True)
options = OneToMany('DomainOptions')
class DomainOptions(Entity):
using_options(tablename="domain_options")
domain = ManyToOne('Domain', colname='domain_id', required = True,
use_alter=True,
ondelete = 'CASCADE', onupdate =
'CASCADE')
option = Field(Unicode(256), nullable = False)
When I'm trying to delete any of domains, I'm receiving such error:
IntegrityError: (IntegrityError) null value in column "domain_id"
violates not-null constraint
'UPDATE domain_options SET domain_id=%(domain_id)s WHERE
domain_options.id = %(domain_options_id)s' {'domain_options_id': 8,
'domain_id': None}
So, instead of "cascade" behavior, I'm receiving "set null".
I've tried another syntax:
cascade="all,delete-orphan"
With same result.
Please, help me to clarify what am I doing wrong. Thanks in advance.
Regards,
cleg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---