Opened 4 years ago

Closed 4 years ago

Last modified 4 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 Changed 4 years ago by slave2theman@…

Your captcha spam detector is super annoying!

comment:2 Changed 4 years ago by Baptiste Mispelon

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 Changed 4 years ago by Horst Gutmann

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