Skip to content
Snippets Groups Projects
Verified Commit c9d701cd authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Initial import.

parents
No related branches found
No related tags found
No related merge requests found
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# pyenv
.python-version
# Environments
.env
.venv
env/
venv/
ENV/
# Editors
*~
DEADJOE
# Database
db.sqlite3
# Compiled CSS files
*.css
from django.apps import AppConfig
class DjangoStarfieldConfig(AppConfig):
name = 'django_starfield'
{% for i in stars %}<!--
--><input type="radio" name="{{ name }}" id="{{ name }}-{{ forloop.counter0 }}"
value="{{ i }}" {% if value == i %}checked="checked"{% endif %} /><!--
--><label for="{{ name }}-{{ forloop.counter0 }}"></label><!--
-->{% endfor %}
from django.forms.widget import Widget
class Stars(Widget):
template_name = 'django_starfield/stars.html'
def __init__(self, attrs=None, stars=5):
super(Stars, self).__init__(attrs)
self.stars = 5
def get_context(self, name, value, attrs):
context = super(Stars, self).get_context(name, value, attrs)
context['stars'] = self.stars
return context
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment