Skip to main content

Utility module for SoftwareFabrica django projects

Project description

.. _topics-overview:

============================
Softwarefabrica Django Utils
============================

.. admonition:: About this document

This document provides an overview of what Softwarefabrica Django Utils is.

.. contents::
:depth: 3

What is this?
=============

This is a library that provides many useful routines and abstractions for
applications developed with the `Django`_ web framework.

Your help and feedback is precious. Suggestions and contributions are very much
appreciated. See below on how you can contribute.

If you want to actively collaborate and provide code, documentation, tests or
bug fixes, please feel free to create a new Bazaar branch in Launchpad, and tell
us about it! See the collaboration_ section for more information.

And don't forget to check also our other `Django`_ applications,
`softwarefabrica.django.forms`_, `softwarefabrica.django.crud`_, and
`softwarefabrica.django.wiki`_.

.. _`Django`: http://www.djangoproject.com
.. _`softwarefabrica.django.utils`: http://pypi.python.org/pypi/softwarefabrica.django.utils
.. _`softwarefabrica.django.forms`: http://pypi.python.org/pypi/softwarefabrica.django.forms
.. _`softwarefabrica.django.crud`: http://pypi.python.org/pypi/softwarefabrica.django.crud
.. _`softwarefabrica.django.wiki`: http://pypi.python.org/pypi/softwarefabrica.django.wiki
.. _`sflib`: http://pypi.python.org/pypi/sflib

Feature overview
----------------

- an handy `UUID`_ Django database field (``UUIDField``)
- a simple search functionality to search inside the application database
- views helper functions (to automatically populate template context with usuful
information, a ``render_to_response`` using a ``RequestContext``, ...)

.. _`UUID`: http://en.wikipedia.org/wiki/UUID
.. _`Markdown`: http://daringfireball.net/projects/markdown/syntax
.. _`Django`: http://www.djangoproject.com
.. _`forms library`: http://docs.djangoproject.com/en/dev/topics/forms/

Pre-requisites and installation
===============================

See the `installation guide document`_.

.. _`installation guide document`: install.html

.. _collaboration:

How can I contribute?
=====================

As said, your help is precious. We'll warmly appreciate any help you'll want to
give. Just using this library is a reward for us, but if you want to become more
actively involved, you are welcome!

The project has a `development home page`_ at `LaunchPad`_:

https://launchpad.net/sf-django-utils

There you can file `bugs`_, suggest `enhancements`_, follow development or ask
to become an active `team`_ member.

You can checkout the development branch using `Bazaar`_:

::

bzr branch lp:sf-django-utils

We'll appreciate very much if you'll want to contribute back any changes. Just
register your branch with `LaunchPad`_ and tell us!

Source code can also be browsed `online`_.

.. _`development home page`: https://launchpad.net/sf-django-utils
.. _`LaunchPad`: http://launchpad.net
.. _`Bazaar`: http://bazaar-vcs.org/
.. _`online`: http://bazaar.launchpad.net/~softwarefabrica/sf-django-utils/trunk/changes
.. _`Softwarefabrica`: https://edge.launchpad.net/softwarefabrica
.. _`team`: https://launchpad.net/~softwarefabrica
.. _`bugs`: https://bugs.launchpad.net/sf-django-utils
.. _`enhancements`: https://bugs.launchpad.net/sf-django-utils


Contacts
========

It's possible to contact the author by e-mail at the following addresses:

m.pantaleoni at softwarefabrica.org

panta at elasticworld.org

marco.pantaleoni at gmail.com


LICENSE
=======

This software is covered by the GNU General Public License version 2.
If you want to use this software in a closed source application, you
need to buy a commercial license from the author.

This open source version is:

Copyright (C) 2007-2008 Marco Pantaleoni. All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


CHANGES
-------

2009-10-19 Marco Pantaleoni <panta@elasticworld.org>

* removed legacy stuff dependencies from paginator template-tag template.

2009-10-12 Marco Pantaleoni <panta@elasticworld.org>

* Added softwarefabrica.django.basicauth to support HTTP Basic Auth in
Django projects (from snippet 243: http://www.djangosnippets.org/snippets/243/)

2009-10-07 Marco Pantaleoni <panta@elasticworld.org>

* paginator template tag: now preserves the query string, if present.
So the paginator now works in list views with search forms.

2009-09-24 Marco Pantaleoni <panta@elasticworld.org>

* paginator template tag: modernized, now uses only the django
Paginator object.

2009-05-27 Marco Pantaleoni <panta@elasticworld.org>

* SyntheticUploadedFile.py: added (support for programmatically added files
in FileField and ImageField fields).

2009-05-16 Marco Pantaleoni <panta@elasticworld.org>

* djangothreads.py: added (support for django thread joining).

2009-05-12 Marco Pantaleoni <panta@elasticworld.org>

* added expr template tag and filter library (with comparison filters and
the ``expr`` template tag).

2009-04-20 Marco Pantaleoni <panta@elasticworld.org>

* middleware.logger: added get_logger() function.

2009-04-20 Marco Pantaleoni <panta@elasticworld.org>

* added useful middleware classes (under softwarefabrica.django.utils.middleware)
Right now the following are available: logger.LoggingMiddleware,
sqldebug.SqlDebugMiddleware, profile.ProfileMiddleware, stats.StatsMiddleware.

2009-04-15 Marco Pantaleoni <panta@elasticworld.org>

* fixed a bug in new render_to_response.

2009-04-14 Marco Pantaleoni <panta@elasticworld.org>

* added compiled template caching support.

2009-02-20 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/templatetags/macros.py: added (django
snippet nr. 363, see http://www.djangosnippets.org/snippets/363/)

2009-02-19 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/IPv4MaskedAddressField.py: handled the u'' case
in validation.

2009-01-29 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/templatetags/forward_query_param.py: added.
Provides the ``forward_query_param`` template tag.

2009-01-21 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/templatetags/in_list.py: added.

2009-01-15 Marco Pantaleoni <panta@elasticworld.org>

* managers.py: added. Provides the ``QuerySetManager`` described in
http://simonwillison.net/2008/May/1/orm/

2009-01-10 Marco Pantaleoni <panta@elasticworld.org>

* paginator.py paginator.html: now correctly handles pagination in
popup windows (``is_popup`` and ``_popup`` variables, from s.d.crud
generic views).

2008-12-22 Marco Pantaleoni <panta@elasticworld.org>

* IPv4MaskedAddressField can now be used with django admin too.

* added a test module.

* IPv4MaskedAddressField.py: added. This module provides model and form
fields for IPv4 addresses with an optional network mask.

2008-12-19 Marco Pantaleoni <panta@elasticworld.org>

* added doc bundle generation.

* docs/install.txt: improved installation instructions.

2008-12-18 Marco Pantaleoni <panta@elasticworld.org>

* Makefile: updated to build for all supported python versions
(2.4, 2.5, 2.6)
Fixed.

* added extensive documentation.

2008-12-17 Marco Pantaleoni <panta@elasticworld.org>

* setup.py: Added specific ('uuid') dependency for Python 2.4

2008-12-16 Marco Pantaleoni <panta@elasticworld.org>

* Removed obsolete material.

2008-12-01 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/templatetags/paginator.py: template
is now 'utils/paginator.html'

* softwarefabrica/django/utils/templates/utils/paginator.html:
added.

2008-11-25 Marco Pantaleoni <panta@elasticworld.org>

* softwarefabrica/django/utils/templatetags/sitevars.py
(SitevarsNode.render): made Django `Site` framework optional.

* softwarefabrica/django/utils/viewshelpers.py (context_vars):
made Django `Site` framework optional.

* setup.py: set zip_safe to False (since we include templates and tests).

2008-11-24 Marco Pantaleoni <panta@elasticworld.org>

* Removed unused empty tests. Updated datetimewidget.py and
relatedwidget.py

* Changed references to 'newforms' into 'forms'.

* README.txt: Updated.

* Integrated setuptools and packages as
'softwarefabrica.django.utils'

2008-11-02 Marco Pantaleoni <panta@elasticworld.org>

* templatetags/sitevars.py: added - {% sitevars %} template
tag that populates the context with project variables.

2008-10-29 Marco Pantaleoni <panta@elasticworld.org>

* crud.py: added - Object-Oriented generic views and respective
functional support adapters. Also present classes that add
'fieldorder' support to ModelForms and templated forms.

2008-10-25 Marco Pantaleoni <panta@elasticworld.org>

* usearch.py: added - super-simple search support.

2008-10-19 Marco Pantaleoni <panta@elasticworld.org>

* UUIDField.py: added - UUID field.

2008-10-27 Marco Pantaleoni <panta@elasticworld.org>

* templatetags/paginator.py: modernized and added
'template_object_name' parameter (defaults to 'object').

2008-09-04 Marco Pantaleoni <panta@elasticworld.org>

* viewshelpers.py: modernized, removed functional generic views.

2008-09-02 Marco Pantaleoni <panta@elasticworld.org>

* forms.py mlforms.py: modernized (adapted to support also django-1.0)

2008-05-30 Marco Pantaleoni <panta@elasticworld.org>

* added DateRangeWidget and DateRangeField.

2008-05-29 Marco Pantaleoni <panta@elasticworld.org>

* added white space in id field (edit form), to separate it when no
value is present.

2008-05-27 Marco Pantaleoni <panta@elasticworld.org>

* added (non-editable) 'id' support to table forms.

2008-05-26 Marco Pantaleoni <panta@elasticworld.org>

* changed date format to 'dd/mm/yyyy'

* removed '--' in empty FK also from detail view

2008-05-22 Marco Pantaleoni <panta@elasticworld.org>

* removed "--" from empty related widgets.

2008-05-21 Marco Pantaleoni <panta@elasticworld.org>

* added missing classes 'value' and 'label'.

* fixed (commented) formfield_search_cb().

* relatedwidget.py: improved. Added support for creation.

* relatedwidget.py foreign.html: added support for textual representation
of selected records.

* tableforms.py: now uses the functions copied to erp.forms

2008-05-20 Marco Pantaleoni <panta@elasticworld.org>

* datetimewidget.py: added mark_safe() calls.

2008-05-15 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: fixed bug ('coldwidth' -> 'colwidth', for FormRow).

2008-05-14 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py (FormField_operator_get_HTML_entity.Perform):
removed TD in error list.

* tableforms.py (FormField_operator_get_HTML_entity.Perform): adds
'label' and 'value' to fields.

* datetimewidget.py: switched from <nobr> to CSS.

* tableforms.py
(FormField_operator_get_view_HTML_entity.Perform): translated db
choice in text form in detail view.

* tableforms.py (FormField_operator_get_view_HTML_entity.Perform):
return icon in detail view for boolean fields.

* tableforms.py: defaulted to italian date format.

* datetimewidget.py: defaulted to italian date format.

* datetimewidget.py: added 'date' css attribute to widget.

2008-05-13 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: adapted for split in DateTimeWidget and
DateWidget.

* forms.py: adapted for split in DateTimeWidget and DateWidget.

* datetimewidget.py: split in DateTimeWidget and DateWidget.

* templates/utils/widget/foreign.html: removed 'folder' icon
(detail view).

* tableforms.py (formfield_cb) relatedwidget.py: fixed required
field bug for "ForeignKey"s.

* viewshelpers.py: Added translation to messages.

2008-05-06 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py (build_query_from_form): fixed bug: now handles
also missing fields in form_data and searches with related fields
(RelatedField).

2008-04-28 Marco Pantaleoni <panta@elasticworld.org>

* relatedwidget.py (RelatedItemWidget.value_from_datadict): fixed
validation bug.

* tableforms.py: return link to detail view for foreign keys in detail
view "form".

2008-04-27 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: boolean fields are rendered with a 3-way select in
search forms.

* tableforms.py (FormField_operator_get_HTML_entity.Perform): fixed
ForeignKey label extraction.

2008-04-26 Marco Pantaleoni <panta@elasticworld.org>

* added 'model' and 'meta' to delete_object() and edit_object() template
context.

2008-04-26 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: renamed getElementName() into getElementTypeName(), and
getElementsByName() into getElementsByTypeName().
Added getElementName() returning the passed 'name' parameter value, if
present.
Added getElementsByName() and getElementByName().
Added 'name' paremeter query in getElements().

* templates/utils/widget/foreign.html: added <span></span> and
<nobr></nobr>.

2008-04-25 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: added some DOM navigation functions.
Added fields (FormField, django field, db field) extraction functions.
Now django forms are created with only the fields present in tableforms
Form (passing 'fields').

2008-04-22 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: now emits toggleFormGroup().

2008-04-22 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py (Form.make_formclass): moved formclass creation out of
the constructor, so to allow late injection of a different form metaclass.

* tableforms.py: added build_query_from_form() to Form class.
Now it's also possible to pass the (newforms) form metaclass to the Form
constructor. A SearchModelFormTable metaclass has been added to be used
when making search forms (it keeps all fields as optional).

* viewshelpers.py: updated object_list() generic view to match
recent django.

2008-04-21 Marco Pantaleoni <panta@elasticworld.org>

* viewshelpers.py: fixed opts.verbose_name proxy string issue
(forcing unicode).
Made more uniform template search.
Added object_detail() generic view.
Improved comments.

* tableforms.py: added get_view_HTML_entity operation for detail views.

* relatedwidget.py: removed unused select_btn and new_btn strings.

2008-04-19 Marco Pantaleoni <panta@elasticworld.org>

* templates/: added.

* tableforms.py: integrated support for foreign key fields
(relatedwidget).

* relatedwidget.py: added.

* viewshelpers.py: added static_media_images_prefix() and
static_media_js_prefix().

2008-04-06 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: added multiple generation operation backends
(get_HTML_entity, get_pages_HTML_entity, get_page_ids).
Small improvements. Added support to form group javascript.

2008-04-05 Marco Pantaleoni <panta@elasticworld.org>

* templatetags/paginator.py templatetags/urlsave.py: added.

* tableforms.py: implemented visitor pattern based generation of
HTML content.

* viewshelpers.py: added object_list() (based on django generic
view).

2008-04-02 Marco Pantaleoni <panta@elasticworld.org>

* tableforms.py: Added.

2008-02-17 Marco Pantaleoni <panta@elasticworld.org>

* newforms_crud.py (create_object, update_object): added the
possibility of passing initial values to forms in form_for_model()
and form_for_instance().

* viewshelpers.py: settings.STATIC_MEDIA_PREFIX is not strictly
required anymore. The static_media_prefix() function tries to
determine the correct value, with a sensible fallback.

2007-11-22 Marco Pantaleoni <panta@elasticworld.org>

* Created (with bits from portal, a lot of bits...)

Project details


Release history Release notifications | RSS feed

File details

Details for the file softwarefabrica.django.utils-1.0dev-BZR-r96-panta-elasticworld.org-20091019141028-k6lcxynczaw5eaa0.tar.gz.

File metadata

File hashes

Hashes for softwarefabrica.django.utils-1.0dev-BZR-r96-panta-elasticworld.org-20091019141028-k6lcxynczaw5eaa0.tar.gz
Algorithm Hash digest
SHA256 897050121534af832033f2eddf1af63daec31f40ae44eae69124554627ea80b9
MD5 65532c38409237ad68afab6c9c4f11a8
BLAKE2b-256 b2ccb4d510ad03776b41167bd170d99b91a58e2bb49cfca9c7a7d97eca243270

See more details on using hashes here.

File details

Details for the file softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.6.egg.

File metadata

File hashes

Hashes for softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.6.egg
Algorithm Hash digest
SHA256 63f156f80becf33cac916b3b3dcf8b98737b11caa590b5b1134869f04a11b0c1
MD5 79762ff0e41b2c87eeb43000d9f5c3f4
BLAKE2b-256 7425da4b82bfe52726d0fcff59eff528d4f9b62c377eb66fb23cd02d7a9c22ed

See more details on using hashes here.

File details

Details for the file softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.5.egg.

File metadata

File hashes

Hashes for softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.5.egg
Algorithm Hash digest
SHA256 9597a5f5cf3d20ae6c904d2e22b1bad98c56c1183553be925dfbe73a3fb5138b
MD5 48e7190fd565d008ae67931a7d962ae0
BLAKE2b-256 8a399e20f8a896d6c240108de900c9e7ae04f0bf340c0d53ea5e823ce2808f4c

See more details on using hashes here.

File details

Details for the file softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.4.egg.

File metadata

File hashes

Hashes for softwarefabrica.django.utils-1.0dev_BZR_r96_panta_elasticworld.org_20091019141028_k6lcxynczaw5eaa0-py2.4.egg
Algorithm Hash digest
SHA256 c2c394cf4bfd06bf5d82e47ae0efaaf9baff3c4b9117ab90bfc9f1be9c1392ef
MD5 10a2dafeb3a0ebc0d674955aa56192ff
BLAKE2b-256 1a05ee9c9b690813518e25bde5eb23d6f58545a84235eb517493048d85210700

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page