I got two models in myapp:
### myapp/models.py
class Animal(models.Model):
    name = models.CharField()

class Cat(Animal):
    tail_length = models.DecimalField()
###
This is Django multi-table inheritance, so both models have its tables
in database in one-to-one relation.
Is it possible to provide fixtures only inside Cat model:
### myapp/fixtures/initial_data.yaml
- model: myapp.Cat
  pk: 1
  fields:
    name: kittie
    tail_length: 33
###
and this fixtures will be propagated to both tables, or should I
create seaprate fixtures for Animal and Cat models?
It would be user friendly, and really fit one-to-one relationship.

PS.
Now when I try to load such mixed fixture, django makes insert into
myapp_cat table, before is has done insert to myapp.Animal, so
obviously foreign key constraint fails, so looks like it's not
supported.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to