django-snippetscream 0.0.7

Django app packaging the best snippets found on http://djangosnippets.org

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!

What's new in django-snippetscream 0.0.7:

  • Removed monkeypatching on and added test for 1378.
  • Included 2536 - Configurable defaults for contrib.sites default Site during syncdb
Read full changelog
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Shaun Sephton
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
django-snippetscream is a Django app packaging the best snippets found on http://djangosnippets.org

Included Snippets

963. RequestFactory

Easily create mock request objects for use in testing.

Original Snippet - http://djangosnippets.org/snippets/963/

Example:

from snippetscream import RequestFactory
request = RequestFactory().get('/')


1378. Resolve URLs to View Name

Supplies a resolve_to_name function that takes in a path and resolves it to a view name or view function name (given that the path is actually defined in your urlconf).

Original Snippet - http://djangosnippets.org/snippets/1378/

Example:

=== urlconf ====
urlpatterns = patterns(''
 (r'/some/url', 'app.views.view'),
 (r'/some/other/url', 'app.views.other.view', {}, 'this_is_a_named_view'),
)

=== example usage in interpreter ===
>>> from snippetscream import resolve_to_name
>>> print resolve_to_name('/some/url')
'app.views.view'
>>> print resolve_to_name('/some/other/url')
'this_is_a_named_view'

Last updated on September 19th, 2011

requirements

#packaging snippets #Django plugin #snippets #packaging #Django #plugin

Add your review!

SUBMIT