Re: A lot of Problems with Migrating (conceptual)

2017-08-31 Thread Alexander Joseph
Thanks Melvyn, good to know. I'll keep that in mind On Thursday, August 31, 2017 at 9:19:57 AM UTC-6, Melvyn Sopacua wrote: > > There are two main principles to remember about Django migrations in early > development stage: > > 1) Make migrations often and coherent. >Typically, if you

Re: A lot of Problems with Migrating (conceptual)

2017-08-31 Thread Melvyn Sopacua
There are two main principles to remember about Django migrations in early development stage: 1) Make migrations often and coherent. Typically, if you change something about a model, make a migration. When you want to cover multiple models in one migration, there should be a good reason

Re: A lot of Problems with Migrating (conceptual)

2017-08-29 Thread Alexander Joseph
Thanks James, I'm actually starting over from scratch instead of actually refactoring so the accounts app is the only real app I have so far. I actually did delete the database and just apply migrations to the newly created database and it worked ok. I'd like to get better at fixing these

Re: A lot of Problems with Migrating (conceptual)

2017-08-29 Thread James Schneider
On Tue, Aug 29, 2017 at 7:13 AM, Alexander Joseph < alexander.v.jos...@gmail.com> wrote: > I'm not specifying the app level, I'm just running "python manage.py > makemigrations --settings=config.settings.local" and "python manage.py > migrate --settings=config.settings.local" > I'm not

Re: A lot of Problems with Migrating (conceptual)

2017-08-29 Thread Alexander Joseph
I'm not specifying the app level, I'm just running "python manage.py makemigrations --settings=config.settings.local" and "python manage.py migrate --settings=config.settings.local" I'm not modifying the migrations files and I dont have an app with the label of admin, thats just the built-in

Re: A lot of Problems with Migrating (conceptual)

2017-08-29 Thread James Schneider
File "C:\Users\Alexander\Envs\business_management\lib\site-packag es\django\core\management\commands\migrate.py", line 86, in handle executor.loader.check_consistent_history(connection) File "C:\Users\Alexander\Envs\business_management\lib\site-packag es\django\db\migrations\loader.py",

Re: A lot of Problems with Migrating (conceptual)

2017-08-27 Thread Alexander Joseph
OK, so I started over using postrgresql and so far I have one app named 'accounts' - to hold user models, registration, etc. I tried to migrate and got the following error which looks a lot like some of the errors I was getting before.. (business_management)

Re: A lot of Problems with Migrating (conceptual)

2017-08-25 Thread Alexander Joseph
Awesome, thanks James, thats exactly what I'm looking for. I'll try layout 1 first as you suggest On Wednesday, August 23, 2017 at 7:49:05 PM UTC-6, James Schneider wrote: > > > > On Wed, Aug 23, 2017 at 4:40 PM, Alexander Joseph > wrote: > >> One more question - is

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread James Schneider
On Wed, Aug 23, 2017 at 4:40 PM, Alexander Joseph < alexander.v.jos...@gmail.com> wrote: > One more question - is there a way to put apps in folders/sub-folders > instead of creating sub-apps/modules? I just want to keep things easier to > navigate on the development side. I will eventually have

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread Alexander Joseph
One more question - is there a way to put apps in folders/sub-folders instead of creating sub-apps/modules? I just want to keep things easier to navigate on the development side. I will eventually have about 20 sub-apps in the 'Engineering' app alone. Even if I could just group all the

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread Alexander Joseph
Thanks James, and thanks for your post on my other thread about structure. I agree I need to get more into conceptual introductory material. I think I will restructure my project and merge a lot of the apps/subapps I have now as you suggested. From what Tom said it sounds like that could be a lot

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread 'Tom Evans' via Django users
On Tue, Aug 22, 2017 at 8:37 PM, Alexander Joseph wrote: > Thanks for all the advice. > > One more question - could project structure be causing issues with > migrations? I'm working on a large project and many apps in my project have > several layers of "sub-apps".

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread Antonis Christofides
Hi, > I read in "2 Scoops of Django" that, in general, if you have more than 5 > models per model file then you should think about splitting the model up into > different apps, rather than having long models files. I don't claim to be more experienced than the authors—on the contrary—and I have

Re: A lot of Problems with Migrating (conceptual)

2017-08-22 Thread James Schneider
On Tue, Aug 22, 2017 at 12:37 PM, Alexander Joseph < alexander.v.jos...@gmail.com> wrote: > Thanks for all the advice. > > One more question - could project structure be causing issues with > migrations? I'm working on a large project and many apps in my project have > several layers of

Re: A lot of Problems with Migrating (conceptual)

2017-08-22 Thread Alexander Joseph
Thanks for all the advice. One more question - could project structure be causing issues with migrations? I'm working on a large project and many apps in my project have several layers of "sub-apps". My structure looks something like this... my_project/ config/ docs/ accounting/

Re: A lot of Problems with Migrating (conceptual)

2017-08-19 Thread James Schneider
# later in forms.py category = forms.TypedChoiceField(required=False, choices=get_categories) This has a similar effect to the ModelChoiceField, with the query only running when the form is instantiated, but gives you the flexibility to use whatever logic you'd like to come up with the choices

Re: A lot of Problems with Migrating (conceptual)

2017-08-19 Thread James Schneider
On Aug 18, 2017 3:14 PM, "Jim Illback" wrote: Here’s a “problem” with migrations that I’ve had. It only occurs on a first time installation (like a first-time upload to Heroku, for example). In forms.py, I have a field dependent upon a column in another table (Category):

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
Excellent - thanks much. On Aug 18, 2017, at 4:02 PM, knbk > wrote: There are various reasons why you should never execute queries at startup. One you've seen: it makes it impossible to migrate a new database. Other reasons include that the

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread knbk
There are various reasons why you should never execute queries at startup. One you've seen: it makes it impossible to migrate a new database. Other reasons include that the choices are cached and are only renewed when the server restarts, and that when running tests, the query is executed

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
Here’s a “problem” with migrations that I’ve had. It only occurs on a first time installation (like a first-time upload to Heroku, for example). In forms.py, I have a field dependent upon a column in another table (Category): category = forms.TypedChoiceField(required=False,

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread James Bennett
On Thu, Aug 17, 2017 at 1:03 PM, Antonis Christofides < anto...@djangodeployment.com> wrote: > Second, just to make things clear, the word "migration" has two meanings. > The original meaning of migration is to switch to another software system > (e.g. migrate from MySQL to PostgreSQL, or migrate

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread James Schneider
On Aug 17, 2017 10:10 AM, "Alexander Joseph" wrote: I'm pretty new to django and I've been having problems with makemigrations/migrate and I wonder if Im doing things right. I'm using MySQL backend and after reading in the documentation a little it sounds like

Re: A lot of Problems with Migrating (conceptual)

2017-08-17 Thread Alexander Joseph
Thanks Antonis, and great post on production databases. I'll definately be switching to postgresql. I come from php/xamp and I liked the MySQL GUI with phpMyAdmin so I've gravitated towards MySQL since. On Thursday, August 17, 2017 at 2:05:44 PM UTC-6, Antonis Christofides wrote: > > Hello,

Re: A lot of Problems with Migrating (conceptual)

2017-08-17 Thread Antonis Christofides
Hello, My opinion is that you should definitely switch to PostgreSQL, although I'm not aware whether this would make migrating easier. I've written a relatively long post about which database to choose in

A lot of Problems with Migrating (conceptual)

2017-08-17 Thread Alexander Joseph
I'm pretty new to django and I've been having problems with makemigrations/migrate and I wonder if Im doing things right. I'm using MySQL backend and after reading in the documentation a little it sounds like Postgresql might make migrating more painless. Usually my problems stem from changing