Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20431 closed Uncategorized (invalid)

syc db reference - needed in tutorial doc - after poll/models.py adds unicode and was_published_recently()

Reported by: David Sadler Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I'm a complete newbie, and this might be unimportant. However, for others like me...

I had to go back and syncdb after modifying the Poll/models.py file to include unicode and more importantly the was_published_recently. Otherwise the shell complains, and it disrupts the "step-by-step".

I hope this is helpful and not a waste of your time.

I'm super impressed with django! having worked a lot with SQL over the years, and accustomed to creating tables, fields, indx etc by hand. Your synch db is almost like magic to me! Maybe this is a motivator while I'm requesting it be pointed out again =)

cheers

Change History (3)

comment:1 by slave2theman@…, 11 years ago

Your captcha spam detector is super annoying!

comment:2 by Baptiste Mispelon, 11 years ago

Resolution: invalid
Status: newclosed

Hi,

Thanks for your report.

You don't need to run syncdb when adding methods to an existing model (syncdb is necessary when you add new models).

What you need to do however is restart the shell, but that's already mentionned in the documentation: "Save these changes and start a new Python interactive shell by running python manage.py shell again."

In consequence, I'm marking this as invalid.

comment:3 by Horst Gutmann, 11 years ago

Is was_published_recently a new field of the model that should be persisted in the database? If so then yes, you have to update the database somehow, be it via resetdb/syncdb/... or a migration using something like Django South.

Note: See TracTickets for help on using tickets.
Back to Top