Daehee wrote:
> i'm trying it figure out why django is not recognizing a new models.py
> file for my app. even when i completely butcher the code in models.py
> or change the filename and run "manage.py sqlreset" or "manage.py
> syndb," it still generates the old model. any thoughts??

manage.py sqlreset like all the sql* commands only outputs SQL text.  It 
doesn't actually "run"  anything.  You need to use 'reset' or run the 
outputted sql by hand.

manage.py syncdb will not update tables to reflect changes to existing 
models (aka schema migration) it will only create tables/indexes/etc for 
"new" models.

Changing the filename from models.py will definitely make Django not work.

[This may no longer be true] There must be a __init__.py file in same 
directory as models.py


**If** you **don't** care about data in tables (i.e. it is ok if it is 
all deleted) and you change models in the foo app you need to run the 
following.

manage.py reset foo
manage.py syncdb


If you do care about data then back it up first.  Then you must create 
and run alter statements by hand or use a Django schema migration tool. 
  google it.


-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to