- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
from django.views.generic.edit import FormView | |
from django.views.generic.base import RedirectView | |
from registration.models import RegistrationProfile | |
from forms import RegistrationForm | |
class AccountRegistrationView(FormView): | |
template_name = 'authentication/registration_form.html' | |
form_class = RegistrationForm |
coding=utf-8 | |
from django import http | |
from django.db.models import Q | |
from django.contrib import messages | |
from django.utils.translation import ugettext as _ | |
from cbv import TemplateView | |
from faq.models import FAQ, FAQGroup | |
from itertools import groupby | |
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by'); | |
typeof(options) != 'undefined' || (options = {}); | |
typeof(this.limit) != 'undefined' || (this.limit = 20); | |
typeof(this.offset) != 'undefined' || (this.offset = 0); | |
typeof(this.filter_options) != 'undefined' || (this.filter_options = {}); | |
typeof(this.sort_field) != 'undefined' || (this.sort_field = ''); |
#-*- coding: utf-8 -*- | |
import urlparse | |
from django.contrib.auth import REDIRECT_FIELD_NAME, login | |
from django.contrib.auth.forms import AuthenticationForm | |
from django.http import HttpResponseRedirect | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import never_cache | |
from django.views.decorators.csrf import csrf_protect | |
from django.views.generic.edit import FormView | |
from django.conf import settings |
[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |
from django.test import LiveServerTestCase | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.firefox.webdriver import WebDriver | |
class MySeleniumTests(LiveServerTestCase): | |
@classmethod | |
def setUpClass(cls): |
$sudo chmod 777 /etc/apt/sources.list | |
$sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list | |
$sudo apt-get update | |
$sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
$sudo apt-get update |
<?php | |
namespace Acme\Bundle\AppBundle\Form\EventListener; | |
use Symfony\Component\Form\Event\DataEvent; | |
use Symfony\Component\Form\FormFactoryInterface; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\Form\FormEvents; | |
class IsAdminFieldSubscriber implements EventSubscriberInterface |