Re: AttributeError for unique field during ModelForm validation

2012-11-11 Thread Rohit Banga
Thanks Andrejus. Looks like you understand my usecase. I have to use multiple tables with the same schema which is why I am using inheritance. I am using abstract base models as each model should get its own table. If I use multi-table inheritance data from all these tables ends up in one table whi

Re: AttributeError for unique field during ModelForm validation

2012-11-11 Thread Andrejus
Unfortunately I haven't got experience with abstarct models, one thing I clearly carried out form docs - abstract model has only one clear purpose - to avoid duplicating the same fields and methods when writing code for models. Abstract model is never transformed to database table, so may not

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I want to ensure that a username is unique hence the unique constraint. Is having a ModelForm with an abstract model is supported? If not I will consider dynamically creating an instance of derived model form. But it looks a lot cleaner with the abstract class. On Saturday, November 10, 2012 5

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Andrejus
Hi! I would try to set unique property within "real" model, not within abstract base class. Besides django creates unique pk on each model by default, so to my mind creating additional unique field is redundant. Not quite sure, but there seems to be some restrictions on use of unique property.

AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I noticed a strange behavior with Django and filed a bug https://code.djangoproject.com/ticket/19271#ticket It is suggested that I first check on the support group if the bug is valid or not. Fair Enough. I have created a standalone project to demonstrate the problem. In order to run it you may