This file contains hidden or 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.shortcuts import render_to_response | |
| from django.template import RequestContext, Context, loader | |
| from django.http import Http404, HttpResponse | |
| from django.utils import simplejson | |
| from apps.menus.models import Menu, Category, Label, Item, Recommend | |
| from apps.menus.forms import CategoryForm, ItemForm | |
| def json_response(x): | |
| return HttpResponse(simplejson.dumps(x, sort_keys=True, indent=2), |
This file contains hidden or 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
| Joshua | |
| have you heard of jHtmlArea? | |
| me | |
| Now hat is it? | |
| Joshua | |
| something like tiny | |
| you recommend tiny? |
This file contains hidden or 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.contrib.syndication.views import Feed | |
| from django.utils.feedgenerator import Rss201rev2Feed | |
| from apps.news.models import Article | |
| class RssNewsFeedGenerator(Rss201rev2Feed): | |
| def add_item_elements(self, handler, item): | |
| super(RssNewsFeedGenerator, self).add_item_elements(handler, item) | |
| if 'image' in item: | |
| handler.addQuickElement(u'enclosure', '', { |
This file contains hidden or 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
| {% extends "main-site/base.html" %} | |
| {% load sekizai_tags %} | |
| {% block content %} | |
| <div id="menu-editor"> | |
| <h1>Your Menus</h1> | |
| {% for menu in menus %} | |
| <div class="menu sortableCats" rel="{{ menu.id }}"> |
This file contains hidden or 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
| import os | |
| from datetime import datetime | |
| import settings | |
| from django.conf import settings as dsettings | |
| from fdfgen import forge_fdf | |
| from tempfile import NamedTemporaryFile | |
| from subprocess import call |
This file contains hidden or 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
| import os | |
| from datetime import datetime | |
| import settings | |
| from django.conf import settings as dsettings | |
| from fdfgen import forge_fdf | |
| from tempfile import NamedTemporaryFile | |
| from subprocess import call |
This file contains hidden or 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
| import os | |
| from datetime import timedelta | |
| from django.db import models | |
| from django_extensions.db.fields.encrypted import EncryptedCharField | |
| from django.contrib.localflavor.us.models import PhoneNumberField | |
| from django.contrib.localflavor.us.us_states import STATE_CHOICES | |
| from django.contrib.auth.models import User | |
| from django.core.urlresolvers import reverse | |
| from django.conf import settings |
This file contains hidden or 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
| def choose_state(request): | |
| # try to auto find the city/state from IP address | |
| geo_ip = GeoIP() | |
| city_info = geo_ip.city('12.201.194.50') | |
| if city_info is not None and 'city' in city_info and 'region' in city_info and 'dont_auto_crime_stats' not in request.session: | |
| request.session['dont_auto_crime_stats'] = True | |
| return HttpResponseRedirect(reverse('crime-rate:crime-stats', kwargs={'city': city_info['city'], 'state': city_info['region']})) | |
| states = State.objects.order_by('name') | |
| forms = {} |
This file contains hidden or 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
| <table class="table table-striped table-bordered table-condensed"> | |
| <thead> | |
| <tr> | |
| <th>Name</th> | |
| <th>Email</th> | |
| <th>Phone</th> | |
| <th>Intake Status</th> | |
| <th></th> | |
| </tr> | |
| </thead> |
This file contains hidden or 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
| import os | |
| from datetime import timedelta, datetime | |
| from subprocess import call | |
| from django.db import models | |
| from django_extensions.db.fields.encrypted import EncryptedCharField | |
| from django.contrib.localflavor.us.models import PhoneNumberField | |
| from django.contrib.localflavor.us.us_states import STATE_CHOICES | |
| from django.contrib.auth.models import User | |
| from django.core.urlresolvers import reverse |