Re: re-using field definitions

2009-09-24 Thread Chris Withers
Ethan Jucovy wrote: > What happens if you wrap the definition in a function? > {{{ > def signins(): return models.IntegerField(...) > > class User(models.Model): > name = models.IntegerField(...) > signins = signins() > }}} Yeah, this is sort of what I ended up with: from django.db import

Re: re-using field definitions

2009-09-24 Thread Ethan Jucovy
On Thu, Sep 24, 2009 at 9:37 AM, Chris Withers wrote: > > Hi All, > > I tried this: > > from django.db import models > > signins = models.IntegerField( >     default=0, >     db_index=True, >     verbose_name='Total Signins' >     ) > > class User(models.Model): >