This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# order-form.html | |
{% load catname %} | |
<form id = "order-form"> | |
{% for form in forms %} | |
<div id="gun-{{ forloop.counter }}"> | |
{% for field in form.fields %} | |
<div id="{{ field }}-item" class="item"> | |
<h3>{{ field|catname }}</h3> | |
{% for choice in form.field.choices %} {# <-- Help me out here #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block basic %} | |
{% if not nolabel %}{{ field.label_tag }}{% endif %} | |
<input type="{{ field_type|default:"text" }}" name="{{ field.html_name }}" id="{{ field.auto_id }}" value="{{ field.value|default:"" }}" class="{{ field.css_classes }} {{ extra_classes }}" /> | |
{{ field.help_text }} | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.template.defaultfilters import stringfilter | |
register = template.Library() | |
@register.filter | |
@stringfilter | |
def catname(cat): | |
return cat.replace('_', ' ').capitalize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.conf import settings | |
from main.models import Verbiage | |
import logging | |
register = template.Library() | |
## @@TODO - add clean method: trim leading/trailing ' or " or whitespace | |
## @@TODO - exception for bad query | |
def getverb(parser, token): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
import main.models # @@TODO this might be a reason to put frame components in a separate file some day | |
import logging | |
logger = logging.getLogger(__name__) | |
register = template.Library() | |
@register.tag(name="getradiomagic") | |
def getradiomagic(parser, token): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 'Category 1' : [ | |
{ | |
'attribute 1' : someVal, | |
'attribute next' : anotherVal, | |
'attribute final' : lastVal, | |
}, | |
{ | |
'attribute 1' : someVal, | |
'attribute next' : anotherVal, | |
'attribute final' : lastVal, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sort by data-position field | |
*/ | |
$('.sort-inputs > .form-item').each(function () { | |
$(this).find('.radio-item').each(function () { | |
$(this).attr('data-position', function () { | |
return $(this).find('input[type="radio"]').attr('data-position'); | |
}); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git status # should be clean | |
git pull unfuddle master # nothing to update | |
## if this fucks up: git reset --hard | |
# then add your files and gitignore | |
git status # gitignore updated | |
git commit #commit local | |
git push unfuddle master # push upstream | |
git pull unfuddle master #redundant | |
# make sure everything's kosher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/path/to/env/bin/uwsgi --http :8000 --chdir /path/to/env/proj/proj --wsgi-file /path/to/env/proj/proj/wsgi.py --virtualenv /path/to/env/bin --env DJANGO_SETTINGS_MODULE=proj.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Imports json in a standard format to Django objects """ | |
import json, re, logging, sqlite3 | |
from redisclg import RedisBayes | |
logging.basicConfig(filename='/root/py-proj/clg-env/clg_proj/logfile.log',level=logging.DEBUG) | |
class BaseImporter(object): | |
# @@TODO add file_path param to init | |
def __init__(self, src, list_id, db_src="clg_proj.sqlite3"): | |
self.list_id = list_id |
OlderNewer