Skip to main content

Django app managing simple navigation.

Project description

PyPI version build-status coverage

MOJO NAVIGATION

This Django app manages navigations trees with simple features. It is highly inspired by django-treenav and django-sitetree. It offers a lighter version to allow easy customisation.

The trees structure is using mptt. Each item offer various options to generate the url, restrict access given user status and permissions, classes and behaviours.

Changelist view:

https://box.everhelper.me/attachment/342272/1VqyhRX5tQTX7AFhZZpY6HdPzrPh3QmW/341506-7MaquApmPbU02vSZ/screen.png

Add view:

https://box.everhelper.me/attachment/342274/1VqyhRX5tQTX7AFhZZpY6HdPzrPh3QmW/341506-JJ7ps4S6TNfi1DI6/screen.png

Install

It is strongly recommanded to install this theme from GIT with PIP onto you project virtualenv.

From PyPi

pip install mojo-navigation

From Github

https://github.com/django-mojo/mojo-navigation#egg=mojo-navigation

setup

This application works with django mptt module in order to display the trees. It is highly recommended to add it in the INSTALLED_APPS.

INSTALLED_APPS = (
    ...
    'django_mptt'
    ...
)

If you want to use the default model and admin, also install the module itself.

INSTALLED_APPS = (
    ...
    'mojo.navigation'
    ...
)

Then install your model with

python manage.py syncdb

In case you are using South, you can alternatively do:

python manage.py migrate mojo.navigation

Managers

There are 2 main managers to help sortting and filtering the menu items.

Tree

You can get all items of a specific tree by passing its slug in the for_tree manager, for exemple:

tree_items = Item.objects.for_slug('slug_exemple')

User

As we are using permissions for items. You can filter items for a specific user to retrieve all the items he has access to by passing its object in the for_user manager, for exemple:

tree_items = Item.objects.for_user(request.user)

Contribution

Please feel free to contribute. Any help and advices are much appreciated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mojo-navigation-0.0.1.tar.gz (9.3 kB view details)

Uploaded Source

File details

Details for the file mojo-navigation-0.0.1.tar.gz.

File metadata

File hashes

Hashes for mojo-navigation-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2ed7b4013db2ca3a229f200f3e6d70118cf1089c5f8b927dcb76c7a1b8a623f1
MD5 f2030d902980dccb747fcd357f4830dd
BLAKE2b-256 f65c5f870eaad015c1cf5331948317ade8149ce399c1bc72220153feb2cb9679

See more details on using hashes here.

Supported by

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