sandiegopython / test-driven-django-development

This repository contains materials for a San Diego Python workshop on learning Django with test inspired development
http://test-driven-django-development.readthedocs.org/
Other
102 stars 35 forks source link

Changes Under section: Creating a model #144

Closed riseriyo closed 9 years ago

riseriyo commented 10 years ago

When asking the reader the following, there are some changes due to migrations being supported in Django 1.7. See https://docs.djangoproject.com/en/dev/topics/migrations/#upgrading-from-south

Under this section:0 To create the database table for our Entry model we need to run syncdb again: python manage.py syncdb

We now get: $ python manage.py syncdb Operations to perform: Apply all migrations: admin, contenttypes, auth, sessions Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Add the following: $ python manage.py makemigrations Migrations for 'blog': 0001_initial.py:

The file 0001_initial.py will be added to the directory, blog/migrations, and will reflect the changes made to the database schema. In our case, we've added a model, Entry to this schema. The reader can learn more about migrations and migration files by reading the online Django documentation at: https://docs.djangoproject.com/en/1.7/topics/migrations/

riseriyo commented 10 years ago

Post this migration file as an example and then state:

"The reader can learn more about migrations and migration files by reading the online Django documentation at: https://docs.djangoproject.com/en/1.7/topics/migrations/ "

0001_initial_migrations_file

macro1 commented 9 years ago

Since we have a section dedicated to migrations, I just provided the commands to move forward and left that for later. You can look at the way I explained it here:

https://github.com/pythonsd/test-driven-django-development/blob/c219041ad74572519149d0f92684e9a7f4f0b335/tutorials/02-models.rst#creating-a-model

Do you think that's adequate?

willingc commented 9 years ago

@macro1 @riseriyo I added some wording for user friendliness. 515876202ca0e3e97d2f69a6d4a4de92cb1158da

If you agree with the changes, let's close this :)

macro1 commented 9 years ago

Looks good to me.

riseriyo commented 9 years ago

Wording is fine. Thnx.

On Sun, Nov 9, 2014 at 8:06 AM, Micah Denbraver notifications@github.com wrote:

Looks good to me.

— Reply to this email directly or view it on GitHub https://github.com/pythonsd/test-driven-django-development/issues/144#issuecomment-62308243 .

Ms. Rise Riyo


“Named must your fear be before banish it you can.” - Yoda