ditto -- just bumped into this today.
When I edit my "parent" class, can fill in 3 "children" ... but <save>
only saves the parent. The database does not contain the 3 children I
added when creating the parent.

Children have a simple ForeignKey pointing back to parent with an
'inline_edit' setting ... exactly like AALOY's posting .

 -- joe

aaloy wrote:
> Hello,
>
> I have an strange issue when trying to edit inline my model on the
> Django admin. Some of the models works properly and others not.
> It doesn't give any error but the data is not saved.
>
> For example:
>
> class Provincia(models.Model):
>       nombre = models.CharField(maxlength=50, unique = True)
>       created_at = models.DateTimeField(auto_now_add=True, editable=False)
>       updated_at = models.DateTimeField(auto_now=True, editable= False)
>
>       def __str__(self):
>               return self.nombre
>
>       class Admin:
>               search_fields = ['nombre']
>               ordering = ['nombre']
>
> class Localidad(models.Model):
>       nombre = models.CharField(maxlength=40, unique = True, core=True)
>       url = models.URLField(blank=True, null= True)
>       provincia = models.ForeignKey(Provincia, edit_inline=models.TABULAR,
> num_in_admin=3)
>       created_at = models.DateTimeField(auto_now_add=True, core=True, 
> editable=False)
>       updated_at = models.DateTimeField(auto_now=True, core=True, 
> editable=False)
>       def __str__(self):
>               return self.nombre
>
>       class Admin:
>               search_fields=['nombre']
>               ordering = ['nombre']
>               list_display=['nombre','provincia']
>               list_filter=('provincia',)
>
>       class Meta:
>               verbose_name_plural = 'Localidades'
>
>
> I can add/edit a Provincia and appears the table with nombre and url
> (but url is not marked as core). It lets me add Localidad and save the
> whole thing, but once I return to Provincia no Localidad has been
> saved.
>
> I'm in the svn and I'm using sqlite3 for development.
>
> Any ideas?
>
> --
> Antoni Aloy López
> Binissalem - Mallorca
> http://www.trespams.com
> Soci de Bulma - http://www.bulma.cat


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to