All Projects β†’ django-cms β†’ Django Classy Tags

django-cms / Django Classy Tags

Licence: other
Class based template tags for django

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Django Classy Tags

Django Oidc Provider
OpenID Connect and OAuth2 provider implementation for Djangonauts.
Stars: ✭ 320 (-5.6%)
Mutual labels:  django
Awesome Cheatsheets
πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Stars: ✭ 26,007 (+7571.68%)
Mutual labels:  django
Django Sitetree
Reusable application for Django introducing site tree, menu and breadcrumbs navigation elements.
Stars: ✭ 330 (-2.65%)
Mutual labels:  django
Django React Templatetags
A quick way to add React components to your Django templates.
Stars: ✭ 324 (-4.42%)
Mutual labels:  django
Django X509
Reusable django app implementing x509 PKI certificates management
Stars: ✭ 326 (-3.83%)
Mutual labels:  django
Model bakery
Object factory for Django
Stars: ✭ 328 (-3.24%)
Mutual labels:  django
Django Wordpress
WordPress models and views for Django.
Stars: ✭ 318 (-6.19%)
Mutual labels:  django
Nsot
Network Source of Truth is an open source IPAM and network inventory database
Stars: ✭ 337 (-0.59%)
Mutual labels:  django
Django Disqus
Integrates DISQUS into Django
Stars: ✭ 326 (-3.83%)
Mutual labels:  django
Speakerfight
The Easier way to choose the best talks.
Stars: ✭ 330 (-2.65%)
Mutual labels:  django
Winerama Recommender Tutorial
A wine recommender system tutorial using Python technologies such as Django, Pandas, or Scikit-learn, and others such as Bootstrap.
Stars: ✭ 324 (-4.42%)
Mutual labels:  django
Joplin Web
🐍 πŸ“š Web application companion for Joplin
Stars: ✭ 324 (-4.42%)
Mutual labels:  django
Dsmr Reader
DSMR-protocol reader, telegram data storage and energy consumption visualizer. Can be used for reading the smart meter DSMR (Dutch Smart Meter Requirements) P1 port yourself at your home. You will need a cable and hardware that can run Linux software. Free for non-commercial use. A Docker implementation can be found here: https://github.com/xirixiz/dsmr-reader-docker
Stars: ✭ 327 (-3.54%)
Mutual labels:  django
Vas3k.club
No bullshit IT community with private membership
Stars: ✭ 321 (-5.31%)
Mutual labels:  django
Django Apscheduler
APScheduler for Django
Stars: ✭ 334 (-1.47%)
Mutual labels:  django
Architect
A set of tools which enhances ORMs written in Python with more features
Stars: ✭ 320 (-5.6%)
Mutual labels:  django
Django Concurrency
Optimistic lock implementation for Django. Prevents users from doing concurrent editing.
Stars: ✭ 327 (-3.54%)
Mutual labels:  django
Django Dash
Customisable, modular dashboard application framework for Django.
Stars: ✭ 337 (-0.59%)
Mutual labels:  django
Docker Django Nginx Uwsgi Postgres Tutorial
Docker + Django + Nginx + uWSGI + Postgres εŸΊζœ¬ζ•™ε­Έ - εΎžη„‘εˆ°ζœ‰ ( Docker + Django + Nginx + uWSGI + Postgres Tutorial )
Stars: ✭ 334 (-1.47%)
Mutual labels:  django
Watcher
Watcher - Open Source Cybersecurity Threat Hunting Platform. Developed with Django & React JS.
Stars: ✭ 324 (-4.42%)
Mutual labels:  django

================== Django Classy Tags

|pypi| |build| |coverage|

The goal of this project is to create a new way of writing Django template tags which is fully compatible with the current Django templating infrastructure. This new way should be easy, clean and require as little boilerplate code as possible while still staying as powerful as possible. Some features:

  • Class based template tags.
  • Template tag argument parser.
  • Declarative way to define arguments.
  • Supports (theoretically infinite) parse-until blocks.
  • Extensible!

Contributing

This is a an open-source project. We'll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines <http://docs.django-cms.org/en/latest/contributing/index.html>_.

We're grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors <https://github.com/divio/django-classy-tags/graphs/contributors>_ section.

Documentation

See REQUIREMENTS in the setup.py <https://github.com/divio/django-classy-tags/blob/master/setup.py>_ file for additional dependencies:

|python| |django|

Please refer to the documentation in the docs/ directory for more information or visit our online documentation <https://django-classy-tags.readthedocs.io>_.

Example

This is how a tag looks like using django-classy-tags:

.. code-block:: python

from classytags.core import Options
from classytags.helpers import AsTag
from classytags.arguments import Argument
from django import template

register = template.Library()

class Hello(AsTag):
    options = Options(
        Argument('name', required=False, default='world'),
        'as',
        Argument('varname', required=False, resolve=False)
    )

    def get_value(self, context, name):
        return 'hello %s' % name

register.tag(Hello)

That's your standard hello world example. Which can be used like this:

  • {% hello %}: Outputs hello world
  • {% hello "classytags" %}: Outputs hello classytags
  • {% hello as myvar %}: Outputs nothing but stores hello world into the template variable myvar.
  • {% hello "my friend" as othervar %}: Outputs nothing but stores hello my friend into the template variable othervar.

Running Tests

You can run tests by executing::

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

.. |pypi| image:: https://badge.fury.io/py/django-classy-tags.svg :target: http://badge.fury.io/py/django-classy-tags .. |build| image:: https://travis-ci.org/divio/django-classy-tags.svg?branch=master :target: https://travis-ci.org/divio/django-classy-tags .. |coverage| image:: https://codecov.io/gh/divio/django-classy-tags/branch/master/graph/badge.svg :target: https://codecov.io/gh/divio/django-classy-tags

.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg :target: https://pypi.org/project/django-classy-tags/ .. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg :target: https://www.djangoproject.com/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].