I have a class, A, that has a ManyToMany reference to another class, B
like so:

    class B(models.Model):
        name = models.CharField()

        def __unicode__(self)
            return self.name

    class A(models.Model):
        name = models.CharField()
        bees = models.ManyToManyField(B)

        def __unicode__(self)
            return self.name


And an ModelAdmin setup like:
    class AAdmin(admin.ModelAdmin):
        filter_horizontal = ('bees')

Everything works perfectly fine when I run this on my local test
server.  However, when I move the code "as-is" to my server and I try
to add a new 'A', I get the following error:
    TypeError: unbound method __unicode__() must be called with B
instance as first argument (got nothing instead)

My test box is a MacBook Pro, and I run it using the 'manage.py
runserver'.  The server is Ubuntu Linux running Apache and
mod_python.  I am not sure if this is something stupid I am doing in
the code, or if its a difference in some version or how its being ran.

Mike Bauer
http://32past8.com

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to