Saturday, April 27, 2013

Re: check genre and insert

2013/4/27 Hélio Miranda <helio13m@gmail.com>
Made the proposed change, but what happens is that when will insert the movie with a genre that already exists to get the id of that genre, gives the following error: ObjectId ('517b15658774a7177cb1280d ') as the id that comes from this comes mongodb form.

When the genre does not exist and must enter the new genus, is not to enter.

Does anyone know what I'm doing wrong?
 (snip)

I don't know what your issue really is, but here's a quick debugging tip: add the following lines somewhere in your view:

import code
code.interact(local=locals())

A Python interpreter will open in the same terminal where you're running the development server and you'll be able to do anything you want, inspect variables, query the database, you name it. Quit the interpreter (CTRL+D, don't use exit()) and the view will finish processing normally. It should help you finding where your assumptions are failing

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

No comments:

Post a Comment