Adding a field to the profile: Difference between revisions

Undo revision 18879 by 86.51.26.15 (talk)
imported>Tsousa
imported>Brittag
(Undo revision 18879 by 86.51.26.15 (talk))
 
(6 intermediate revisions by 4 users not shown)
Line 25:
== Getting the source ==
 
All the sample code in this walkthrough refers to version '''d56a354''' of the OpenHatch source. To make sure the code is in line with what you expect, follow the instructions on the [[http://openhatch.readthedocs.org/en/latest/contributor/getting_started.html getting started with the OpenHatch code]] page. But right after you do the "git clone", do these commands:
 
$ git checkout d56a354 # Switch to that revision
Line 32:
 
Here's how you can check that it worked. Run these commands in your new ''oh-mainline'' directory, and check that they have the same output as I've recorded:
 
<b>TODO: before continuing need to setup the DB for older version of code that you are trying to run</b>
The command is: <code>python manage.py migrate #####</code>
<b>How to determine what ##### should be? (bug paulproteus on IRC)</b>
 
$ git log -1 # look at the most recent commit on the current branch
Line 266 ⟶ 270:
 
Run 'git status' and you should see all of the files you have edited up to now:
<div class="example"><pre>
$git status
 
Line 296 ⟶ 300:
 
<div class="example"><pre>
$ python manage./bin/mysitepy syncdb
Syncing...
No fixtures found.
Line 335 ⟶ 339:
Now run the migration as described [http://openhatch.org/wiki/Making_schema_changes here].
<div class="example"><pre>
$ bin/mysitepython manage.py schemamigration profile --auto
+ Added field birthday on profile.Person
Created 0090_auto__add_field_person_birthday.py. You can now apply this migration with: ./manage.py migrate profile
 
$ bin/mysitepython manage.py migrate profile
Running migrations for profile:
- Migrating forwards to 0090_auto__add_field_person_birthday.
Line 425 ⟶ 429:
Now run the test and let's make sure it passes!
<div class="example"><pre>
$ bin/mysitepython manage.py test profile.EditBirthday
 
<test information will print here...>
Anonymous user