1 2 3 4 5 | def get_default_sites():
return [site.id for site in Site.objects.all()]
class MyModel(models.Model):
sites = models.ManyToManyField(Site, default=get_default_sites)
|
More like this
- Configurable defaults for contrib.sites default Site during syncdb by chrischambers 5 months, 1 week ago
- ManyToManyFieldWithDefault by trbs 3 years, 8 months ago
- language switcher in admin by lawgon 2 years, 3 months ago
- Admin App/Model Custom Ordering by stephen_mcd 1 year, 11 months ago
- Bulk Insert - updated 5/9/2008 by coolie 4 years, 3 months ago
Comments