Opened 2 years ago

Closed 2 years ago

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Your captcha spam detector is super annoying!

comment:2 Changed 2 years ago by bmispelon

  • Resolution set to invalid
  • Status changed from new to closed

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 2 years ago by zerok

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