Re: unexpected Error: OperationalError: no such column: ...

2010-02-02 Thread HWM-Rocker
Hi Thomasz Zielinski,

On Jan 20, 6:38 pm, Tomasz Zieliński
 wrote:
> On 20 Sty, 20:52, HWM-Rocker  wrote:
>
> > o...@olaf-laptop:~/workspace/truemen$ ./manage.py shell
>
> Not touching you question, you could try shell_plus from django-
> extensions,
> it load all models on startup, saving you a lot of typing.
> Moreover you could try ipython (which is used by shell/shell_plus if
> only is available).

thx I'll give it a try.

I found the problem, it was a bit tricky but well.

I had to call pycrust after I set the environment variables from /home/
olaf/workspace to be able to load my modules just like in the Django
python files. after I imported my settings :

when I imported the modules it loaded the settings and it assumed that
the dbfile would lay in the current working directory. Since I copied
the dbfile several months ago I already forgot it. And all the test
run quite well. But after I changed the db, the copied file didn't
change. So I deleted it and updated my script to get a new copy every
time i want a new test shell.

I know this way isn't very nice, but it works ;)

pycrust has some advantages over ipython. it is a graphical shell, so
you can see the docstring of functions like popups, or in a seperated
part of the window. It has nice cope and paste features, one with the
>>> and one that ignores them.

But thank you very much for your time !!!
>
> --
> Tomasz Zielinskihttp://pyconsultant.eu

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



Re: unexpected Error: OperationalError: no such column: ...

2010-01-20 Thread Tomasz Zieliński
On 20 Sty, 20:52, HWM-Rocker  wrote:

> o...@olaf-laptop:~/workspace/truemen$ ./manage.py shell

Not touching you question, you could try shell_plus from django-
extensions,
it load all models on startup, saving you a lot of typing.
Moreover you could try ipython (which is used by shell/shell_plus if
only is available).

--
Tomasz Zielinski
http://pyconsultant.eu
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




unexpected Error: OperationalError: no such column: ...

2010-01-20 Thread HWM-Rocker
Hello Everybody,

i got a strange error when i am trying to test some code out of
pycrust. I have a small script that sets the environment variable and
starts pycrust.

o...@olaf-laptop:~/workspace/truemen$ cat debug-shell.sh
#!/bin/bash
cd /home/olaf/workspace/ && export PYTHONPAHT=$PYTHONPATH:$PWD/truemen:
$PWD
export DJANGO_SETTINGS_MODULE=truemen.settings
pycrust &



PyCrust 0.9.5 - The Flakiest Python Shell
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from truemen.slogans.models import Tag, Slogan
Tag.objects.get(pk=1)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/pymodules/python2.6/django/db/models/manager.py",
line 120, in get
return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line
300, in get
num = len(clone)
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line
81, in __len__
self._result_cache = list(self.iterator())
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line
238, in iterator
for row in self.query.results_iter():
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py",
line 287, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py",
line 2369, in execute_sql
cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line
19, in execute
return self.cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/
base.py", line 193, in execute
return Database.Cursor.execute(self, query, params)
OperationalError: no such column: slogans_tag.was_modified

When I am entering the exact lines of codes in manage.py shell
everything works well. And also the admin interface through manage.py
runserver shows no Problem and shows the was_modified Flag

o...@olaf-laptop:~/workspace/truemen$ ./manage.py shell
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from truemen.slogans.models import Tag, Slogan
>>> Tag.objects.get(pk=1)



the funny thing is, that it worked last week in both shells the same
way. Everything was ok. After this Error came up I checked the
Database with SQLiteMan and this column was present. Than I reset the
the database for for my app. But nothing helped. Is it possible that I
missed something to export??? I mean I can import the objects from
models.py??

Please help me!! I don't know what to do. And pycrust is much more
comfortable to use than the standard shell. I tried to looked through
the managed.py code but it was too complex for me to understand it.

Thank you in advance
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.