On 2 déc, 06:03, juacompe <juaco...@gmail.com> wrote:
> Hi Bruno,
>
> I have tried to save the roled model and got [AttributeError: 'Person
> +Carpenter' object has no attribute 'person_ptr_id'] as in traceback
> below.
>

Uhu... Very quick anwser, would need more in-depth analyses, but I'm
pretty confident the root of the problem is here: roles uses
inheritance to build the new "Person+Carpenter" class, but then for
Django's ModelBase this kind of triggers the multi-table inheritance
behaviour (http://docs.djangoproject.com/en/1.2/topics/db/models/
#multi-table-inheritance).

Since - AFAICT - roles are about behaviour, using proxy inheritance
(http://docs.djangoproject.com/en/1.2/topics/db/models/#proxy-models)
could possibly cure the problem. Just add an inner "Meta" class in
your role model with "proxy = True" as class attribute (cf the above
link) and see if it works better.

My 2 cents.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to