Code

Opened 11 months ago

Closed 11 months ago

Last modified 11 months 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

Attachments (0)

Change History (3)

comment:1 Changed 11 months ago by slave2theman@…

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

Your captcha spam detector is super annoying!

comment:2 Changed 11 months 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 11 months 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.