Product Details

redsolutioncms.django-utilities 0.1.4

 

Advertisement


A set of Django useful utilities. * ImageField with preview in admin interface * Override allows to create users with dot in username * Localized date filter * ConsoleException middlewareInstallation: 1.
redsolutioncms.django-utilities is a completely free software. You can free download and use it as long as you like.


 

Django's set of utilities. Includes admin ImageField with preview, override for username, Localized date filter, ConsoleException middleware and broken link highlight template.

A set of Django useful utilities. * ImageField with preview in admin interface * Override allows to create users with dot in username * Localized date filter * ConsoleException middlewareInstallation: 1. Put utilities in to your INSTALLED_APPS in your settings.py within your django project.Usage:ImagePreviewField:Used to show image preview near ImageField.To use it in your models.pyfrom utilities.fields import ImagePreviewFielddclass MyModel(models.Model): image = ImagePreviewField(upload_to='upload/')You can specify maximum width and height for the thumbclass MyModel(models.Model): image = ImagePreviewField(upload_to='upload/', thumb_size=(80, 80))If you have separated field with thumb for this image you can specify its name and told to use its real size:class MyModel(models.Model): thumb = models.ImageField(upload_to='thumb/') image = ImagePreviewField(upload_to='upload/', thumb_field='thumb', thumb_size=None)Dot is username:By default this application will allow you to create users in admin with dot in there names. To disallow set ALLOW_DOT_IS_USERNAME to False in your settings.py.Local date template filter:The date_local filter supposed to be used with Django 1.1 (1.2+ already has such feature ). Load filter with {% load utilities_tags %} and use it like date Django date filterFor example:{{ entry.creation_date|date_local:"d F Y" }}Returns 01 ? ?‡? ?…? ?†? A°???‚???? 2010 for ru localeConsoleException middleware:Often you get annoyed when Django show Tracebacks likeFile "/home/mysite/django-mysite3/django/template/__init__.py", line800, in render_nodereturn node.render(context)ConsoleException middleware prints original tracebacks in STDOUT. It is very helpful for debugging sometimes. Use it ONLY in development mode!Reset password form:To enable password reset form, set in your settings.py:ENABLE_PASSWORD_RESET = TrueAnd include utilities urls into your urlconf:urlpatterns += patterns('', (r'^', include('utilities.urls')),)You will get link to password reset in users administration section under email field. When you reset password to some user, all his or her active sessions will be deleted, password will be set to unusable. The only way to login is follow link, provided in email. If user has no email, you will not able reset password for this user.SplitDateField:You can specify minimal and maximum date with attributes from_date (default datetime.date(1930,01,01)) and till_date (default datetime.date.today) , they must have date type or be callable object. Also you may reverse order of years with help of boolean attribute reverse (default False).If from_date=datetime.date(2007,01,01), till_date=datetime.date(2010,01,01) and reverse=False, then we obtain the sequence of years: 2007, 2008, 2009, 2010To use it in your models.pyfrom utilities.fields import SplitDateField class MyModel(models.Model): date = SplitDateField(from_date=datetime.date(2008,10,01), till_date=datetime.date.today, reverse=True)To use it in your forms.pyfrom utilities.fields import SplitDateFormField class MyForm(forms.Form) date = SplitDateFormField(from_date=datetime.date(2008,10,01), till_date=datetime.date.today, reverse=True)

(512k) < 1 sec
(1Mb) < 1 sec
(2Mb) < 1 sec
(5Mb) < 1 sec
(10Mb) < 1 sec

User Reviews: REDSOLUTIONCMS.DJANGO-UTILITIES 0.1.4
 * 
 * 
     
 * 
related terms
Related Software
Similar Download Catalog
 
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z