Tuesday, February 28, 2012

ManyToManyField default

Hi,

found nothing helpful about this topic. Only problems and bugreports ;)

this (seems) to work in my project without any troubles in the admin interface:

...
# site with SITE_ID = 1 is the default site to publish
sites = models.ManyToManyField(Site, default=(1, ))
...

so when i create a new object, the change_from has already the site
with the id 1 highlighted.

is this the correct way to do it?

regards,
klemens

--
klemens mantzos
http://fetzig.at/

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