My question is very similar to How do I populate the Django table django_site in a yaml fixture? , but I need some help on this.
I create a group in auth_group table in my YAML fixture:
- model: auth.Group
pk: 1
fields:
name: admin
In my MySql I have a Django table named: MyApp_user_groups
, where MyApp is the name of the Django app; this table is automatically created by Django. This table should connect MyApp.User
model (created by me) to the Groups model of Django.
Using a YAML fixture, I want to add a tuple in that table (for the purpose of add a user to a group automatically when I run syncdb
), but I receive the following error:
DeserializationError: Invalid model identifier: MyApp.User_Groups
So the code is
- model: MyApp.User_Groups
pk: 1
fields:
user_id: 2
group_id: 1
I'm a newbie with Django. Any ideas?