Re: Conflict trying to save models when roles metaclass is applied.

2010-12-12 Thread juacompe
I did not have time to go over the implementation of ModelBase class yet but I tried extend my test cases and want to update the progress. I apply the Carpenter role (in the earlier post) in setUp of all test classes in 2 small projects and add the test below in each of them. ---

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-04 Thread juacompe
Good idea! I'll try that and update the post. I'll be out of town for a week, don't think i can code during that. so my next post would be around the next weekend. Have a good day! Chokchai P. On Dec 4, 12:19 am, bruno desthuilliers wrote: > On 3 déc, 08:00, juacompe wrote: > > > Hi Bruno, > >

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-03 Thread bruno desthuilliers
On 3 déc, 08:00, juacompe wrote: > Hi Bruno, > > Thank you very much!! Adding an inner Meta class works like charm. Cool 8) Now beware, there _might_ be a couple other dark corners... I strongly suggest you take a look at ModelBase implementation and possibly extend your test cases, at least t

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-02 Thread juacompe
Hi Bruno, Thank you very much!! Adding an inner Meta class works like charm. Below is the working code with proving testcases -- models.py -- from django.db.models import Model, CharField from django.db.models.base import ModelBase from roles import

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-02 Thread bruno desthuilliers
On 2 déc, 06:03, juacompe 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 o

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-02 Thread juacompe
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. In [1]: from carpenter.models import Person, Carpenter In [2]: jack = Person(name='Jack') In [3]: Carpenter(jack) Out[3]: In [4]: jack.chop(

Re: Conflict trying to save models when roles metaclass is applied.

2010-11-23 Thread bruno desthuilliers
On 23 nov, 13:08, Ben Scherrey wrote: >     We are attempting to apply the concepts of Domain-Context > Interaction (DCI) to our python/django development. Unfortunately, the > metaclass mechanism which the main python library supporting this uses > conflicts with that of Django's metaclass for db

Conflict trying to save models when roles metaclass is applied.

2010-11-23 Thread Ben Scherrey
We are attempting to apply the concepts of Domain-Context Interaction (DCI) to our python/django development. Unfortunately, the metaclass mechanism which the main python library supporting this uses conflicts with that of Django's metaclass for db.models. What happens is that a metaclass and n