Djaneiro Cheat Sheet
by Admoroux (Admoroux) via cheatography.com/25539/cs/6720/
Snippets for Django templates Non-official snippets for templates
autoescape {% autoescape %} {% autoescape %} super {{ block.super }}
block {% block %} {% endblock %} extrahead {% block extrahead %}{% endblock extrahead %}
comment {% comment %} {% endcomment %} extrastyle {% block extrastyle %}{% endblock extrastyle
%}
csrf {% csrf_token %}
var {{ }}
cycle {% cycle %}
tag {% %}
debug {% debug %}
staticu {{ STATIC_URL }}
ext {% extends "" %}
media {{ MEDIA_URL }}
extends {% extends "" %}
filter {% filter %} {% endfilter %}
Snippets for Django model fields
firstof {% firstof %}
mauto models.AutoField()
for {% for in %} {% endfor %}
mbigint models.BigIntegerField()
fore {% for in %} {% empty %} {% endfor %}
mbool models.BooleanField()
if {% if %} {% endif %}
mchar models.CommaSeparatedIntegerField()
ifchanged {% ifchanged %} {% endifchanged %}
mdate models.DateField()
ife {% if %} {% else %} {% endif %}
mdatetime models.DateTimeField()
ifelse {% if %} {% else %} {% endif %}
mdecimal models.DecimalField()
ifeq {% ifequal %} {% endifequal %}
mduration models.DurationField()
ifequal {% ifequal %} {% endifequal %}
memail models.EmailField()
ifnotequal {% ifnotequal %} {% endifnotequal %}
mfile models.FileField()
inc {% include %}
mfilepath models.FilePathField()
include {% include %}
mfloat models.FloatField()
load {% load %}
mimg models.ImageField()
now {% now "" %}
mint models.IntegerField()
regroup {% regroup by as %}
mip models.IPAddressField()
spaceless {% spaceless %} {% endspaceless %}
mnullbool models.NullBooleanField()
ssi {% ssi %}
mphone models.PhoneNumberField()
static {% static %}
mposint models.PositiveIntegerField()
templatetag {% templatetag %}
mpossmallint models.PositiveSmallIntegerField()
url {% url %}
mslug models.SlugField()
verbatim {% verbatim %} {% endverbatim %}
msmallint models.SmallIntegerFiled()
widthratio {% widthratio %}
mtext models.TextField()
with {% with as %} {% endwith %}
mtime models.TimeField()
trans {% trans %}
murl models.URLField()
blocktrans {% blocktrans with as %} {% endblocktrans %}
musstate models.USStateField()
By Admoroux (Admoroux) Published 29th April, 2017. Sponsored by ApolloPad.com
cheatography.com/admoroux/ Last updated 29th April, 2017. Everyone has a novel in them. Finish Yours!
retrofrikis.com/ Page 1 of 3. https://apollopad.com
Djaneiro Cheat Sheet
by Admoroux (Admoroux) via cheatography.com/25539/cs/6720/
Snippets for Django model fields (cont) Snippets for Django Models
mxml models.XMLField() Model Simple Model Class
fk models.ForeignKey() Model_full Full Model Class(with TODOs)
m2m models.ManyToManyField()
Completions
o2o models.OneToOneField()
null blank choices
Snippets for Django form fields db_column db_index db_tablespace
fchar forms.CharField() default related_name editable
fchoice forms.ChoiceField() error_message help_message primary_key
fcombo forms.ComboField() unique unique_together unique_for_date
fdate forms.DateField() unique_for_month unique_for_year verbose_name
fdatetime forms.DateTime() verbose_name_plural validators auto_now_add
fdecimal forms.DecimalField() auto_now required label
fduration forms.DurationField() initial widget localized
femail forms.EmailField() return RequestContext context_instance
ffile forms.FileField() render_to_response render redirect
ffilepath forms.FilePathField() get_object_or_404 get_list_or_404
ffloat forms.FloatField()
Snippets for Django Views
fimg forms.ImageField()
view Function Based View
fint forms.IntegerField()
createview Generic Create View
fip forms.IPAddressField()
updateview Generic Update View
fmochoice forms.ModelChoiceField()
deleteview Generic Delete View
fmomuchoice forms.ModelMultipleChoiceField()
detailview Generic Detail View
fmuchoice forms.MultipleChoiceField()
listview Generic List View
fmuval forms.MultipleValueField()
templateview Generic Template View
fnullbool forms.NullBooleanField()
adminview Generic Admin View
fregex forms.RegexField()
tabularinline Tabular Inline View
fslug forms.SlugField()
stackedinline Stacked Inline View
fsdatetime forms.SplitDateTime()
dispatch dispatch method for CBVs
ftime forms.TimeField()
get_context_data get_context_data method for CBVs
ftchoice forms.TypedChoiceField()
ftmuchoice forms.TypedMultipleChoiceField()
Snippets for Python
furl forms.URLField()
init __init__(self, args, *kwargs)
pdb import pdb ; pdb.set_trace()
ipdb import ipdb ; ipdb.set_trace()
npdb from nose.tools import set_trace; set_trace()
By Admoroux (Admoroux) Published 29th April, 2017. Sponsored by ApolloPad.com
cheatography.com/admoroux/ Last updated 29th April, 2017. Everyone has a novel in them. Finish Yours!
retrofrikis.com/ Page 2 of 3. https://apollopad.com
Djaneiro Cheat Sheet
by Admoroux (Admoroux) via cheatography.com/25539/cs/6720/
Snippets for Python (cont)
traceback import traceback; traceback.print_exc();
utfc coding: utf-8
By Admoroux (Admoroux) Published 29th April, 2017. Sponsored by ApolloPad.com
cheatography.com/admoroux/ Last updated 29th April, 2017. Everyone has a novel in them. Finish Yours!
retrofrikis.com/ Page 3 of 3. https://apollopad.com