I am doing an aplication web.
My problem is the next:
When I put (admin.py)
class FarmAdmin(admin.ModelAdmin):
filter_horizontal = ('server',)
===models.py====
class Farm(models.Model):
farm_id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=50)
server = models.ManyToManyField(Server)
It's work good, but if i save it, I have differents problems with DB
fields. However, if I put server = models.ManyToManyField(Server,
through="FarmServer")
It's dont work!! But I haven't problem. I cant see the widget. I only
see farm_id and name fields.
class FarmServer(models.Model):
farm = models.ForeignKey(Farm, primary_key=True)
server = models.ForeignKey(Server,primary_key=True)
class Meta:
db_table = u'farms_servers'
what can I do???
Thanks and sorry for my english.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment