On Sat, 2006-04-29 at 03:20 -0700, RichardH wrote:
> Hello. I am new to django but have had 0.91 working on Windows XP. Just
> tried the 0.92 svn version of magic-removal (reports 0.91), but it
> comes up with an IndexError on one of the examples. I note that all of
> the code/documentation for magic-removal seems to be Linux based. Am I
> pushing too far with it on Windows or have I missed something?
> Interpreter output below:
> 
> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 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 "<stdin>", line 1, in ?
>   File
> "c:\python24\lib\site-packages\Django-0.91-py2.4.egg\django\db\models\base.py",
> line 45, in __new__
>     new_class._meta.app_label = model_module.__name__.split('.')[-2]
> IndexError: list index out of range
> >>>

It's more that it is not designed to be used from the interactive prompt
like this. The above example does not work on Linux either (although the
error message is slightly different). Django does some inspection of the
module name when creating a class and since the interactive prompt is
not in any well-defined module namespace, things go awry.

Try creating your classes inside files, as per normal, and you will find
this isn't a problem.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to