Re: Dumpdata and serialization issues
On 4-7-2012 1:13, natasha.ba...@utoronto.ca wrote: > 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. No it doesn't. It can take a app.model name as well and is more commonly used, since the primary use case for dumpdata is to provide seeds for semi-static data, like a categories table. > 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 3-7-2012 21:21, natasha.ba...@utoronto.ca wrote: > The table is defined as follows --> id: integer PRIMARY KEY > unipart_id: integer category_id: integer This misses a unique index on (unipart_id, category_id) but doesn't explain the issues you're seeing. Any chance we can see the actual models and one broken record as outputted by dumpdata? -- Melvyn Sopacua -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dumpdata and serialization issues
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 Freemanwrote: > > 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, natasha.ba...@utoronto.ca > > 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 django-users@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. > >> > -- 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 django-users@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.
Re: Dumpdata and serialization issues
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 Freemanwrote: > 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, natasha.ba...@utoronto.ca > 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 django-users@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. >> -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dumpdata and serialization issues
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, natasha.ba...@utoronto.cawrote: > 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 django-users@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. > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Dumpdata and serialization issues
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 django-users@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.