Is there a way to get around python appending an "L" to Ints short of casting every time they come out of the database? (Note: I'm using Mysql)
OR, is there a way to ignore the L in django templates? (I keep getting invalid formatting errors because of this, but I'd rather not do list comprehension/casting EVERY time)
e.g. I have a dict with the object's pk as the key and I get the following in firebug:
invalid property id alert({183L: <Vote: colleen: 1 on Which best describes your wardrobe on any g...
Model: Question object, other attributes don't matter because the attribute in question is the pk
View: I didn't write the code and I can't follow it too well, so I can't post the section where the variable is being created, but it is a dict with Question pks as keys and Vote objects as values (code in question is from http://code.google.com/p/django-voting/wiki/RedditStyleVoting)
Template: {% votes_by_user user on questions as vote_dict %} to produce the dict in question alert({{vote_dict}}); is triggering the error
While in this particular case I'm just trying to alert the dict I got back, this has been a recurring problem for me when passing dicts or arrays into js functions where the function call fails because of the L. (Just to give you motivation behind the question)