bruno desthuilliers wrote:
> On 7 déc, 11:45, Thomas Guettler <h...@tbz-pariv.de> wrote:
>> Hi,
>>
>> I have this code:
>>
>> from django.contrib.auth.models import Group
>>
>> class MyModel(models.Model):
>>     default_group=Group.objects.get(name='MyGroup')
>>
>> This worked, since I added the Model after the group MyGroup
>> was created. But it breaks syncdb.
> 
> Indeed.
> 
>> I need this on the class, using a property does not work, since
>> AFAIK properties only work for instances.
> 
> The property builtin type only "works" for instances, yes, but well,
> the property type is just one possible application of the descriptor
> protocol - 

thank you for this hint. The descriptor __get__() is what I use now.

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--

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