Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.863.377 Times

django-reversetag 0.3.1

Company: Ulrich Petri
Date Added: August 30, 2013  |  Visits: 229

django-reversetag

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 downloads)



django-reversetag is an enhanced replacement for Django's builtin URL template tag.<br /><br />Installation<br /><br />To use reversetag in your Django project it needs to be accessible by your Python installation.<br /><br />The easy way:<br /><br /> #~ pip install django-reversetag (or use easy_install if you must)<br /><br />The manual way:<br /><br />Simply place the reversetag directory somewhere that is on your $PYTHONPATH.<br /><br />Django Setup<br /><br />Then all that is left to do is adding reversetag to INSTALLED_APPS in your projets settings.py. Example:<br /><br />INSTALLED_APPS = (<br /> 'django.contrib.auth',<br /> 'django.contrib.contenttypes',<br /> 'django.contrib.sessions',<br /> 'django.contrib.sites',<br /> 'django.contrib.admin',<br /> 'reversetag', # < -- add this<br /> 'your.other.app',<br />)<br /><br />Usage<br /><br />Basic usage is pretty similar to the default url tag. Examples:<br /><br />{% reverse "app.views.view" %}<br /><br />{% reverse "sample_view" %}<br /><br />This will try to reverse<br /><br /> 1. a view "view" in the app.views module<br /> 2. a named view "sample_view".<br /><br />Note that you _must_ quote the view name (regardles if you're using named views or not) since reversetag is "variable aware" and will treat any unquoted view name arguments as template variables and try to reverse them. Example:<br /><br />{% reverse next_page_view %}<br /><br />In this example reversetag will look up the template variable next_page_view and reverse the url to whatever is in stored in that variable.<br /><br />Arguments<br /><br />Of course it is also possible to provide arguments for views that require them. Example:<br /><br />{% reverse "sample_view" "arg1","arg2" %}<br /><br />{% reverse "sample_view" arg1_var,arg2_var %}<br /><br />{% reverse "sample_view" key1="arg1",key2="arg2" %}<br /><br />{% reverse "sample_view" key1=arg1_var,key2=arg2_var %}<br /><br />As with the view name literal arguments have to be quoted, otherwise they will be treated as variables.<br /><br />Note: Since Django's``reverse`` method does not permit mixing args and kwargs reversetag does not allow this as well.<br /><br />Saving the result<br /><br />If you want to use the reversed url in multiple places you can save the result in a context variable. Example:<br /><br />{% reverse "sample_view" "arg1" as my_url %}<br /><br />Advanced usage<br /><br />There is also a more advanced mode of operation called partial reversing. What this does is allow you to reverse views that require arguments in multiple steps.<br /><br />This is useful in situations where you want to use a generic template (e.g. list pagination) that needs to construct urls to a page with an additional parameter(s) without beeing hardcoded to a specific view (e.g. a page number). The "normal" way of doing this is using GET parameters, but GET parameters adversely affect caching [1], are bad for search engines and just looks ugly.<br /><br />[1] If you're using Django's Cache Middleware it completely skips caching for pages with GET parameters!<br /><br />Example:<br /><br />- urls.py -<br />...<br />url(r'^something/(?P< page >[0-9]+)', 'app.views.view', name="paginatable_view"),<br />...<br />- /urls.py -<br /><br />- template.html -<br />{% reverse partial "paginatable_view" as this_page %}<br />{% include pagination.html %}<br />- /template.html -<br /><br />- pagination.html -<br />< a href="{% reverse this_page page=2 %}" >next page< /a ><br />- /pagination.html -<br /><br />In this example the template template.html constructs a partial reversed url to itself and saves the result in a context varialbe this_page which in turn is used by a generic pagination.html to display a link to the next page without having to know anything about the view except that it takes a page argument.<br /><br />Here are some key features of "django-reversetag":<br /><br />?*A* Consistent syntax ("string literals" and variables)<br />?*A* Ability to reverse view names stored in context variables<br />?*A* Partial reversing<br /><br /><br />#md5=781fa1635adb416820883e717b8de68f

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Arguments Caching Context Django Django Reversetag Page Page View Paginationhtml Parameters Partial Quotsample Viewquot Require Reverse Reversetag Template Templatehtml Urlspy Views You039re
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


DJANGO-REVERSETAG RELATED
Networking  -  Front Page Category 1.0
Front page category is a plugin that let you choose posts in one or more categories to appear on the front page. If there are some category that you don't want to appear on front page, especially uncategorized one, just simple go to Settings...
10 KB  
Networking  -  WCM Page Feeder 1.3
WCM Page Feeder lets you easily create and customise an RSS feed for your pages. Customize your feed using the settings page or via URL parameters. This plugin is great for those who use Wordpress as a CMS solution and want to pull content into...
10 KB  
Icon Tools  -  BEULA 1.10
A free easy-to-use viewer for quickly reading or scanning through End User License Agreements before installing new software on your computer. Easy save-to-desktop or regular save functions. Enlarge text; re-format text to page-wide view....
640.9 KB  
Modules  -  Print orders Catalog 1.1.2
Add a button on the account_history_info page to view and print a clean Order.
 
Modules  -  The Attached Image 2.4.9
Several aspects can be configured from the options page or by passing parameters directly to the function. InstallationUnpack and upload it to the /wp-content/plugins/ directory.Activate the plugin through the 'Plugins' menu in WordPress....
 
Entertainment  -  Guess My Drawing!!! 1.0
Like us on Facebook page to view best drawings of the day! http://www.facebook.com/GuessMyDrawing Best Drawing Application available on the App Store! Guess my Drawing! Play with Friends on iPhone and iPod...
2.2 MB  
Sports  -  XC ScoreKeeper 8.0.2.1
Scoring a Cross Country race on the fly is almost impossible. This app makes it SIMPLE!!! Just tap a team as each runner passes and the scores will be automatically calculated. Swipe over to the scoring page to view the scores at any time....
2 MB  
Network & Internet  -  django-email-extras 0.1.8
django-email-extras is a Django reusable app providing the ability to send PGP encrypted and multipart emails using the Django templating system. These features can be used together or separately. When configured to send PGP encrypted email, the...
10.24 KB  
File Utilities  -  django-view-cache-utils 0.1
django-view-cache-utils is a Django plugin that provides a method to do advanced view caching. It's basically a patch from http://code.djangoproject.com/ticket/11269 converted to stand-alone python package. The license is MIT.
10.24 KB  
Network & Internet  -  django-cherry for Linux 0.1.2
django-cherry is a Django app which makes it easy to run your Django project under the [CherryPy WSGI server][cp-wsgi]. The main command is defined using [django-boss][djboss], a simple but powerful framework for creating and running Django...
10.24 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, NETWORK & INTERNET
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Network & Internet  -  Free WiFi Hotspot 3.3.1
Free WiFi Hotspot is a super easy solution to turn your laptop or notebook into a portable Wi-Fi hotspot, wirelessly sharing your internet connections like DSL, Cable, Bluetooth, Mobile Broadband Card, Dial-Up, etc. through the built-in wireless...
1.04 MB  
Network & Internet  -  Easy Uploads 1.8
Easy uploads is a file storage media streaming application designed by Filestreamers that allows you to upload, store, and stream your files from their virtually unlimited file storage server. Easy Uploads can backup,share, and stream your files...
615.97 KB  
Network & Internet  -  IPv6 CARE 3.2b
IPv6 CARE, "IPv6 Compliant Automatic Runtime Environment", is a Linux tool able to patch ipv6-agnostic programs on-the-fly ('patch' mode). It can also generate a diagnosis about the IPv6 compliance of an application ('check' mode).
409.6 KB  
Network & Internet  -  PacketFence ZEN 3.1.0
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) system. Boosting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, 802.1X...
1024 MB  
Network & Internet  -  django-dbstorage 1.3
A Django file storage backend for files in the database.
10.24 KB