Re: Model inheritance with constraints

2016-06-01 Thread James Schneider
On Wed, Jun 1, 2016 at 12:45 PM, Arnab Banerji wrote: > Nevermind my last comment on this thread, when I refactored my existing > model into an abstract base class with overrides, and then ran > "makemigrations", Django said "no changed detected", so it is merely > treated as a code refactor and

Re: Model inheritance with constraints

2016-06-01 Thread Arnab Banerji
Nevermind my last comment on this thread, when I refactored my existing model into an abstract base class with overrides, and then ran "makemigrations", Django said "no changed detected", so it is merely treated as a code refactor and not a database related change. Thanks AB -- You received t

Re: Model inheritance with constraints

2016-06-01 Thread Arnab Banerji
Hi Akhil - my issue was how to avoid the new OneToOne relationships, which James addressed on this post. Hi James - thanks a bunch for your help, much appreciated. While I like the WYSIWYG nature of this solution, I am not sure if the creation of the abstract base class will cause the data alre

Re: Model inheritance with constraints

2016-05-29 Thread James Schneider
> > > What I have > = > > class MyFunModel(models.Model): > my_foo_field = > > What I am attempting to add > = > > class MyAnotherFunModel(MyFunModel): > my_another_foo_field = > > Such that the migration gives me *only* _myanotherfunmodel table with > fields "

Re: Model inheritance with constraints

2016-05-28 Thread Akhil Lawrence
Its already addressed. You can simply run ./manage.py makemigrations and ./manage.py migrate it will create migrations only for MyAnotherFunModel On Thursday, 26 May 2016 01:02:08 UTC+5:30, Arnab Banerji wrote: > > Hi all, > > I currently have a set of models associated with my Django app, w

Model inheritance with constraints

2016-05-25 Thread Arnab Banerji
Hi all, I currently have a set of models associated with my Django app, with the database already containing data with respect to these tables (models). What I have = class MyFunModel(models.Model): my_foo_field = What I am attempting to add = class MyAnother