Geraldo Reports Currency class update for DecimalObjectValue
Adds init and changes passed args to *args and **kwargs .
- django
- Geraldoreports
Adds init and changes passed args to *args and **kwargs .
This snippets extends ModelAdmin in order to allow multi field sorting in admin tables. Usage example: class MyModelAdmin(MultiFieldSortableModelAdmin): list_display = ( ... 'user_full_name', ... ) def user_full_name(self, obj): return obj.user.get_full_name() user_full_name.admin_order_field = ['user__first_name', 'user__last_name']`
You can test how your django app behaves depending on what kind of response it gets from the API. It assumes were're using the python requests library.
This snippet holds your Django project from automatically changing language of the page to the best fitting one by discovering the client browser language. I personally needed to show the page to the user for the first time in the default language (English), although there were some translations. User can still change the language (via session cookies). Insert this middleware BEFORE the Django's `django.middleware.locale.LocaleMiddleware` in settings.
Mixin to support pagination when randomizing querysets. Requirements: Postgres, Django Sessions Note: This shouldn't be used on large complex datasets. It utilizes the relatively slow method of '?' randomized sorting. Use with caution. Todo: MySQL support, Support for larger datasets
I am used to load forms directly into modals using dajax but I found out I had to load the scripts using an ajax call from the browser. You can see here an example of a dynamically loaded form and the function used to load the scripts.
How I assert email is being sent correctly
This is a simple django snippet! It is the *opposite of @login_required* decorator for Django views Example **@not_login_required** ``` def login_page(request): ... ```
A variant of https://djangosnippets.org/snippets/2850/ that allows expensive calls to be deferred to an asynchronous process.
A Django Template tag used to construct urls with current querystring parameters. This is based on some code that I've written some years ago. Enjoy.
For several projects I am using generic views instead of django-admin, I needed a generic view for constance instead of using their django-admin based app.
Obfuscate javascript strings. * Convert * `{{'Pita Hummus'|js_obfuscate_string}}` * to something like * `'P4itzga Hnumg7mubs'.replace(/[4zgn7b]/g,'')` Making it hard to text-search for strings in your code.
I've reimplemented the code I found somewhere on the web within my models file. The earlier version was incapable of converting all formats to JPG while this code converts all formats and compresses all of them successfully. You need to have PILLOW installed for this to work.
I've reimplemented the code I found somewhere on the web within my models file. The earlier version was incapable of converting all formats to JPG while this code converts all formats and compresses all of them successfully.
## required * `{% load trans%}`before using this snippets * Add this [template filter](https://djangosnippets.org/snippets/2253/) to your custom templatetags and load it before using this snippets * Bootstrap framework