Hi as you can see here at http://docs.python.org/tutorial/errors.html
in 8.3 handling exceptions theres a piece of code that works as you
want.
for example try this:
try:
int("a")
except Exception as e: #The key is using "as" and the variable name
you like for retrieving the exception because i
I need to filter a field by a UserProfile function, i.e. how can I do
something like this?
class Paquet(models.Model):
...
profiles = models.ManyToManyField(UserProfile, limit_choices_to =
{'country': request.user.userprofile.country})
Thanks in advance.
--
_
2 matches
Mail list logo