--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/4G24v1A5LaUJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Did you run a syncdb, then added mainloc after? Also, using south makes things much easier.
Hi all,
I am new to django and just learning, but for the current error I have absolutely no idea about the cause. I have created a model named Job in model.py which contains several elements. One of the is defined as follows:
mainloc = models.CharField(max_length=1, choices = MAINLOC)
and MAINLOC is a list of 2-tuples, with the first element a 1-character expression (like 'B', 'M'...). I have updated the database (the name mainloc is explicitly mentioned in the screen output), I have sync'd the database and restarted the server. But still, when I want to display the (empty) list on my browser, I get the message
no such column: jobs_job.mainloc
Any idea or advice I could try to do?
Thanks
Alex
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/4G24v1A5LaUJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/mapjVj47xokJ.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
Right. The question is whether you added the field "after" running syncdb for the first time.
Here is a repetition of what exactly I have done:
1. Add this field in my models.py
2. Run " python manage.py sql jobs" (jobs is the name of the directory); in this step the field in question is explicitly written to stdout
3. Run "python manage.py syncdb"
4. Run "python manage.py runserver"
5. Go to the admin webpage to look at "jobs", and get this error.
Maybe I missed something? Or had the wrong order? Even if I repeat those steps I get the same result.
Hi,
before even thinking to use 'South', I want to get it to work quick and quick. I don't care about existing databases, I have no information in the database anyway. Is there a way to just recreate a new, empty database from scratch? Really, remove the old database and create a new database so that it corresponds the one I have defined in models.py.
On the other side, I am not able to look at the database myself, because when trying to open it I get the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Is there a way to access the database, and to possibly alter it, via "python manage.py shell"?