Re: django db models error
Thanks a lot. I guess, I was not reading it well. On Jul 24, 4:55 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 7/24/07, akk <[EMAIL PROTECTED]> wrote: > > > Traceback (most recent call last): > > File "", line 1, in > > File "/usr/lib/python2.5/site-packages/django/db/models/base.py", > > line 40, in __new__ > > model_module = sys.modules[new_class.__module__] > > KeyError: '__console__' > > You'll need to actually put the model definition into a file and import it. > > If you know your way around the Django ORM's metasystem you can create > model classes "on the fly" in the development version of Django > (**not** in the 0.96 release -- you'll need a recent Subversion > checkout), but there may not be a whole lot of use cases for that. > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: django db models error
On 7/24/07, akk <[EMAIL PROTECTED]> wrote: > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/django/db/models/base.py", > line 40, in __new__ > model_module = sys.modules[new_class.__module__] > KeyError: '__console__' You'll need to actually put the model definition into a file and import it. If you know your way around the Django ORM's metasystem you can create model classes "on the fly" in the development version of Django (**not** in the 0.96 release -- you'll need a recent Subversion checkout), but there may not be a whole lot of use cases for that. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
django db models error
Hi, I started walking myself through exercises in django book. At chapter V - Interacting with a database: Models. I keep getting error when I try to create class. Otherwise my db connectivity seems fine. I can run from >>> django.db import connection >>> cursor = connection.cursor() (fine) Here is the error I am getting: $ python manage.py shell >>> from django.db import models >>> class Person(models.Model): ... first_name = models.CharField(maxlength=30) ... last_name = models.CharField(maxlength=30) ... Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line 40, in __new__ model_module = sys.modules[new_class.__module__] KeyError: '__console__' Thanks a lot, akk --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---