Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-03 Thread Michal Petrucha
Hi Bruce, On Mon, May 02, 2016 at 02:31:37PM -0700, Bruce Whealton wrote: > Michal, >I had to read your response a few times but I finally got it. I was > reading > that all migrations are created in development only and then applied during > production. > So, during development you u

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Bruce Whealton
Michal, I had to read your response a few times but I finally got it. I was reading that all migrations are created in development only and then applied during production. So, during development you use makemigrations and then when deployed you migrate. Thus, if you add a new feature

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Michal Petrucha
On Mon, May 02, 2016 at 08:37:43AM -0700, Bruce Whealton wrote: > I'm not sure if it is ok to use python manage.py makemigrations on the > production server or if one should just do that locally and then import it. Hi Bruce, Migrations are a part of your application's code base, and they should

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-05-02 Thread Bruce Whealton
As an update to this... I decided to simplify things a bit. For my contacts application, I decided to start with just one table. I got that working in a Ubuntu Vbox environment, inside a virtualenv. I'm not sure if it is ok to use python manage.py makemigrations on the production server o

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-26 Thread Mike Dewhirst
On 26/04/2016 9:41 PM, Bruce Whealton wrote: Mike, Â Â Â Â Â So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. Â It seemed to work ok, in terms of migrating fine. Â However, the database now lacks a Cont

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-26 Thread Bruce Whealton
Having followed all the suggestions, I am now stuck. I have simplified the database by removing one model. I get to the point of python manage.py makemigrations and it returns with what looks right. However, the migrate command just throws out a bunch of errors. For some reason, it is looki

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-26 Thread Bruce Whealton
Mike, So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. It seemed to work ok, in terms of migrating fine. However, the database now lacks a ContactsOrOrganization table. Oops, my mistake, it does hav

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-26 Thread Bruce Whealton
OK, for starters, I understand the need for Null=True and blank=True. So, jumping down...Not sure a better way to do this but I will leave my comments for reference including my models and then respond to the questions So sorry for my delay, I wasn't well this past weekend. >> >> My proble

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-23 Thread Mike Dewhirst
On 23/04/2016 11:22 PM, Bruce Whealton wrote: Hello all,      So, I setup django in a virtualenv on my Ubuntu environment.  I was reading the docs and thought I had things right for creating the 3 models I wanted with this application. I am using Postgresql.  I have the Postgresql dr

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-23 Thread Camilo Torres
On Saturday, April 23, 2016 at 10:00:45 AM UTC-4:30, Bruce Whealton wrote: > > Hello all, > So, I setup django in a virtualenv on my Ubuntu environment. I > was reading the docs and thought I had things right > for creating the 3 models I wanted with this application. I am using > Pos

Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-23 Thread Bruce Whealton
Hello all, So, I setup django in a virtualenv on my Ubuntu environment. I was reading the docs and thought I had things right for creating the 3 models I wanted with this application. I am using Postgresql. I have the Postgresql driver for Python/Django installed in the virtualenv.