开源软件名称:django-cms/django-classy-tags开源软件地址:https://github.com/django-cms/django-classy-tags开源编程语言:Python 96.3%开源软件介绍:Django Classy TagsThe 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:
Note This project is considered 3rd party (no supervision by the django CMS Association). Join us on Slack for more information. Contribute to this project and win rewardsBecause this is a an open-source project, we welcome everyone to get involved in the project and receive a reward for their contribution. Become part of a fantastic community and help us make django CMS the best CMS in the world. 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. We're grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section. DocumentationSee Please refer to the documentation in the docs/ directory for more information or visit our online documentation. ExampleThis is how a tag looks like using django-classy-tags: 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:
Running TestsYou can run tests by executing: virtualenv env source env/bin/activate pip install -r tests/requirements.txt python setup.py test |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论