Re: Overriding save() + site framework = nothing changed when clicking save in the admin

2011-05-12 Thread ksamuel
an inline field inclusion. I think a possible solution is to create a custom admin form and add the site from here. On 13 mai, 00:03, ksamuel wrote: > I overrided the save method of one of my model to it sync its sites > with its parent sites: > > def save(self, *args, **kwargs):

Overriding save() + site framework = nothing changed when clicking save in the admin

2011-05-12 Thread ksamuel
I overrided the save method of one of my model to it sync its sites with its parent sites: def save(self, *args, **kwargs): ret = models.Model.save(self, *args, **kwargs) if self.id: for site in self.parent.sites.all(): self.sites.add(site.id) This code work, except

Re: Site.object.get(pk=x).anyobject_set() is forcing the current site. Is this a bug ?

2011-05-05 Thread ksamuel
Thanks Karen. On May 5, 2:08 pm, Karen Tracey wrote: > On Thu, May 5, 2011 at 6:43 AM, ksamuel wrote: > > I encountered a behavior I can't explain in the site framework and > > wonder if I should report this as a bug. > > > class Video(models.Model): > > >

Site.object.get(pk=x).anyobject_set() is forcing the current site. Is this a bug ?

2011-05-05 Thread ksamuel
I encountered a behavior I can't explain in the site framework and wonder if I should report this as a bug. class Video(models.Model): sites = models.ManyToManyField(Site) on_site = CurrentSiteManager() objects = models.Manager() In manage.py shell, USING A SETTINGS FILE WITH SITE_ID