ImageField with specified maximum image size
You can specyfy max width and height which image can have, and it never exceed that size.
- image
- thumbnail
- imagefield
- limit
- size
- max
You can specyfy max width and height which image can have, and it never exceed that size.
This is a really simple snippet , but is not documented well ... Whit this , you can limit the output of one field in 25 characters before you test that is equal or over 30 characters! Note that the snippet cut the text and add three points at the end (...) Enjoy!
Example: @limit("global", 3, 10, per_ip=True) def view(request, ...): The example limits the view to one request every 3 seconds per ip address. The limit is shared by every view that uses the string "global" (first parameter), which is an arbitrary string. Request succeed until the accumulated requested time in seconds (second parameter) exceeds the limit (third parameter).
3 snippets posted so far.