Django ORM get by ID - do I need to convert Id to Int? -


do need convert this_object_id int before can pass id?

obj = class.objects.get(id=this_object_id) 

why or why not?

accepts both. building sql query statement, passing int gets converted string or string gets inserted both work. see http://django.readthedocs.org/en/latest/ref/models/lookups.html#lookup-reference lhs , rhs sides of clause being constructed.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -