Hm, I think the functionality to do this -- at least if I understand correctly what I read here: http://stackoverflow.com/questions/1113096/django-dump-data-for-a-single-model
I'd be fine dumping the data for the entire app -- but the reason I did it this way is because when I do this, the category_id field is empty for all parts in the Part table. If I look at the database contents, it should not be blank -- so not sure why that's happening. So that's why I wanted to delve deeper... So maybe my actual question should be why is the category_id many-to-many field showing up blank consistently when I do a dumpdata?? On Tuesday, July 3, 2012 5:55:32 PM UTC-4, ke1g wrote: > > In fact, I think dumpdata takes an app name, not a table or model name. > > On Tue, Jul 3, 2012 at 5:54 PM, Bill Freeman <[email protected]> wrote: > > I think that you have to dumdata one or both of the models at the ends > > of the many to many, > > and the join table will come along for free. > > > > On Tue, Jul 3, 2012 at 3:21 PM, [email protected] > > <[email protected]> wrote: > >> Hi All, > >> > >> I'm trying to dump the contents of a table which is the mapping for a > >> many-to-many field. > >> > >> The table is called Part and it has a ManytoManyField called > >> category_id. > >> > >> When I run python manage.py dumpdata store.part_category_id > > >> file.json > >> > >> I get the error Error: Unable to serialize database: Category matching > >> query does not exist. > >> > >> I have validated that all values in the table are valid. > >> > >> The table is defined as follows --> id: integer PRIMARY KEY > >> unipart_id: integer category_id: integer > >> > >> Also, when I run dumpdata on the table (python manage.py dumpdata > >> store.part > file.json), the data is dumped without an error message > >> but the category_id field is consistently empty in the output. > >> > >> Any thoughts on what I'm doing wrong? > >> > >> Thanks, > >> Natasha > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups "Django users" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > [email protected]. > >> For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cDNwL3wAvZYJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

