Electronics & Programming


Open Source electronics development and programming

  • You are not logged in.

#1 June 13, 2010 03:49:11

Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

menu from database based on url

I am very much new to django and I assume this question has been
answered. I referance to a tutorial or example of what I am trying to
do would be great. i.e. don't feel you need to give me a long answer
unless you want to.

I am trying to make some improvements to pydocwebhttp://code.google.com/p/pydocweb/It is used for scipy/numpy documentation editing.http://docs.scipy.org/numpy/Front%20Page/Currently the menu links are coded into the templates. I would like to
accomplish 3 things.
1. Store the list of menu links in a database table
2. make it simpler to add menu links
3. Have the menu items dynamic based on url

For example the current base template looks like (see below)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
<meta name="robots" content="noindex, nofollow" />
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="{{MEDIA_URL}}/css/common.css"
<link rel="stylesheet" href="{{MEDIA_URL}}/css/screen.css"
type="text/css" media="screen"/>
<link rel="stylesheet" href="{{MEDIA_URL}}/css/print.css"
type="text/css" media="print"/>
<script type="text/javascript" src="{{MEDIA_URL}}/js/jquery.js"></
{% block extra_headers %}{% endblock %}
<div id="header">
{% for site in OTHER_SITES reversed %}
<div class="headertab">
<span><a href="http://{{site.domain}}/";
style="whitespace:nowrap;">&raquo; {{site.name}}</a></span>
{% endfor %}
<h1><a href="{% url pydocweb.docweb.views_wiki.frontpage
<div id="navbar">
<li class="button"><a href="{% url
pydocweb.docweb.views_wiki.frontpage %}">Wiki</a></li>
<li class="button"><a href="{% url
pydocweb.docweb.views_docstring.index %}">Docstrings</a></li>
<li class="button"><a href="{% url
pydocweb.docweb.views_stats.changes %}">Changes</a></li>
<li class="button"><a href="{% url
pydocweb.docweb.views_search.search %}">Search</a></li>
<li class="button"><a href="{% url pydocweb.docweb.views_stats.stats
{% if perms.docweb.change_docstring %}
<li class="button"><a href="{% url
pydocweb.docweb.views_control.merge %}">Merge</a></li>
{% endif %}
<li class="button"><a href="{% url
pydocweb.docweb.views_control.patch %}">Patch</a></li>
{% if user.is_superuser %}
<li class="button"><a href="{% url
pydocweb.docweb.views_control.control %}">Control</a></li>
{% endif %}
{% if user.is_authenticated %}
<li><b>{{user.first_name|escape}} {{user.last_name|escape}}</b>:</li>
<li class="button"><a href="{% url
pydocweb.docweb.views_user.password_change %}">Profile</a></li>
<li class="button"><a href="{% url django.contrib.auth.views.logout
%}">Log out</a></li>
{% else %}
<li class="button"><a href="{% url pydocweb.docweb.views_user.login
%}">Log in</a></li>
{% endif %}
<div id="container">
<div id="title"><h1>{% block pagetitle %}{% endblock %}</h1></
{% block actions %}{% endblock %}
<div id="content">{% block content %}{% endblock %}</div>
{% block below_container %}{% endblock %}

You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.


Board footer

Moderator control

Enjoy the 17th of March

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support