Reputation: 5982
I'm using Django 1.8. My django App has following models (simplyfied):
class Parent (models.Model):
name = models.TextField()
class MapDetail (models.Model):
mapType = models.TextField()
mapParent = models.ForeignKey(Parent, null=False)
This is my view, creating new entries:
p = Parent()
p.name = name
p.save()
for detail in details:
d = MapDetail()
d.name = detail
d.mapParent = p
d.save
The parents becomes persisted in the database as expected. But the detail entries don't appear. I don't receive an error or some kind of information, whats wrong. Any hint, where to look or how to save the "child" entries of the parent entry? Thank you very much
Upvotes: 1
Views: 53