Re: Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
I have just come up myself with an easy way to implement it: Inheriting from a model class that includes these fields. However I don't like it at all aesthetically. Do I really have to do it like this? On May 19, 3:26 pm, Marc wrote: > Hi all, > I would like to make my code more compact and DRY

Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
Hi all, I would like to make my code more compact and DRY, and for that purpose I need to create a new field that includes two or more existing models fields (eg. a CharField, a DateField). Is there anything easier than inheriting from both classes and following http://docs.djangoproject.com/en/1.