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
class MultipleChoiceAnswerForm(ModelForm): | |
class Meta: | |
model = MultipleChoiceAnswer | |
fields=('question' ,'answer',) | |
widgets = { | |
'question': HiddenInput(), | |
'answer': RadioSelect(renderer=MyRadioRenderer), | |
} | |
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
class FooAdmin(ModelAdmin): | |
… | |
def lookup_allowed(self, key, value): | |
# NOTE: Django 1.2.5 changed the call signature to add the value | |
# Django 1.2.4 restricted the list of allowed lookups to only those | |
# specified in list_filter or date_hierarchy, which doesn't help when | |
# we need to filter on a list with thousands of options. We'll | |
# override that to allow the few which we actually use: | |
if key in ('related__pk', 'related__custom_field'): | |
return True |
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.core.urlresolvers import reverse | |
from django.contrib.admin import site | |
from django.template.loader import render_to_string | |
from django.utils.safestring import mark_safe | |
from cms.utils import get_page_from_url | |
class NavigableMixin(object): | |
""" |
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
https://github.com/exogen/django-adminbrowse |
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
import os | |
DEBUG = True | |
TEMPLATE_DEBUG = True | |
LOCAL_DEV = True | |
OFFLINE = False | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', |
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
<!DOCTYPE html> | |
<html> | |
<head data-gwd-animation-mode="quickMode"> | |
<title>Index</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="generator" content="Google Web Designer 1.0.0.924"> | |
<style type="text/css"> | |
html, body { | |
width: 100%; |
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
var stockApp = angular.module('stockApp', [ | |
'ngResource', | |
]); | |
stockApp.value('currentBooking', {bookingId: BOOKING_ID}); | |
stockApp.factory('TimeBlock', [function() { | |
}]); |
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
<div id='BookingCtrl' ng-controller="BookingCtrl"> | |
<div id='StockListCtrl' ng-controller="StockListCtrl"> | |
<h1>Status: {{ booking().status }} Chargeable days: {{ booking().chargeable_days }}</h1> | |
<section class="timeline-stock light clearfix"> | |
<header class="timeline-header clearfix"> | |
<div id="form-booking"> | |
<div class="input-pair"><label for="hire-start">Est. Delivery</label><input name="hire-start" class="text lg" type="datetime-local" value="{{ booking().estimated_dispatch }}"></div> | |
<div class="input-pair"><label for="hire-end">Est. Collection</label><input name="hire-end" class="text lg" type="datetime-local" value="{{ booking().estimated_return }}"></div> | |
<button id="refresh-hire-period" class="button action lg"><i class="fa fa-refresh fa-lg"></i></button> | |
<div class="search-wrapper"> |
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.core.management.base import BaseCommand, CommandError | |
from sorl.thumbnail import default | |
from shutil import rmtree | |
from os import listdir | |
class Command(BaseCommand): | |
help = ( | |
u'Truncates kvstore and cleanup _thumbs_ folder' | |
) |
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
<dd><input type="text" value="{{ getBooking().account.name }}"></dd> | |
Goes to | |
<dd><input type="text" ng-model="getBooking().account.name"></dd> |
OlderNewer