I have a very, very simple model that when I register with the admin
completely kills my app/project. I can't for the life of me figure out
what's going on. If I don't register the admin class, everything works
fine, if I do, the nothing that's loaded after the registration can be
imported, including classes/function from other modules.

Here's the model and admin:

class Carrier(models.Model):
    name = models.CharField(max_length=128)
    url = models.URLField(null=True, verify_exists=False)

    def __unicode__(self):
        return self.name

class CarrierAdmin(admin.ModelAdmin):
    pass
admin.site.register(Carrier, CarrierAdmin)

This model is used in another app. Trying to import models that appear
after register() causes an ImportError. So I moved the register() call
to the end of the file, then models imported after that raised an
ImportError.

I'm a bit lost here, is admin.site.register() modifying __import__()? Any ideas?

Thanks,
  Justin

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