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

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

Serving Software Downloads in 956 Categories, Downloaded 50.361.468 Times

django-reversetag 0.3.1

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

django-reversetag

Report Broken Link
Printer Friendly Version


Product Homepage
Download (35 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
Libraries  -  TX Text Control Express 16.0
Free, professional Rich Text Box for Visual Studio that offers developers all the features expected in a high end word processing package in reusable component form: Supports RTF, HTML, ANSI, Unicode and many more; Tables, bullets, numbered lists,...
29.6 MB  
Modules  -  Admin Menu Tree Page View 2.1
Get a tree view of all your pages directly in the admin menu. All pages is available just one click away!installation : 1. Upload the folder "cms-tree-page-view" to "/wp-content/plugins/" 2. Activate the plugin through the "Plugins" menu in...
102.4 KB  
Network & Internet  -  django-publisher 1.0.5
Django targeted publishing through view layouts and widgets app. * Read more
10.24 KB  
Network & Internet  -  NetGlance for Mac OS 2.0
Allows you to view pictures from the web outside of the context of a web page and the constraints of a web browser - AND the pictures update themselves automatically. Any graphic - weather maps, stock charts, webcams - can be presented outside...
1.5 MB  
Networking  -  CMS Tree Page View 0.8.3
This plugin adds a CMS-like tree overview of all your pages to WordPress - like the view often found in a page-focused CMS. Within this page tree you can edit pages, view pages, add pages, search pages, and drag and drop pages to rearrange the...
358.4 KB  
Modules  -  Poormanscron 1.0
For every page view, this module checks to see if the last cron run was more than 1 hour ago (this period is configurable). If so, the cron hooks are executed. These cron hooks fire after all HTML is returned to the browser, so the user who kicks...
 
Modules  -  Simplelife 1.2
The life stream can be displayed on any page or post by inserting the simplelife(); function in the template. Installation Unpack and upload it to the /wp-content/plugins/ directory. Activate the plugin through the 'Plugins' menu in WordPress....
 
Networking  -  Advanced Tagline 1.5.3
Advanced Tagline gives the option to have multiple taglines for your blog and display them at random or sequentially with each page view.Typical uses: * Random Quotes * Song Lyrics * "Tip of the day" style helpFeatures * Sequential or random...
10 KB  
Web Browsers  -  Autohide Bookmarks 1.1
Autohide Bookmarks is a Firefox extension that hides your bookmarks toolbar so that you have more page view space. You can view (unhide) the toolbar by moving the mouse over the Firefox menu while pressing CTRL key
10.24 KB  
Networking  -  Content Slider by SlideDeck 1.4.5
The SlideDeck WordPress slider plugin allows you to easily create a content slider widget or slideshow on your WordPress blog without having to write any code. Just create a new slider with the SlideDeck control panel tool and insert the widget...
1.73 MB  
NEW DOWNLOADS IN LINUX SOFTWARE, NETWORK & INTERNET
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
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  
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  -  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  
Network & Internet  -  SQL Inject Me 0.4.5
SQL Inject Me is a Firefox extension used to test for SQL Injection vulnerabilities. The tool works by submitting your HTML forms and substituting the form value with strings that are representative of an SQL Injection attack.
133.12 KB