SlideShare a Scribd company logo
1 of 2
Download to read offline
Template filters




                                                                                                                           Iss
                                                                                                                              ue
                                                                                                                                  4
    DJANGO CHEAT SHEET                                                                                                                        default                           value                           escape
                                                                                                                                                                                                                force_escape




                                                                                                                                                                                                      GENERAL
                                                                                                                                              default_if_none                   value
    Version 1.0




                                                                                                                                                                                                                                                                   ESCAPING
                                                                         www.mercurytide.co.uk/careers                                        yesno                             "yes,no,none"                   safe don’t escape
                                                                                                                                              stringformat                      "s"                             escapejs x20 escapes
                                                                                                                                              python “%” formatting
                                                                                                                                                                                                                iriencode IRI to URI
 Template tags                                                                                           ... - end tag required
                                                                                                                                                                                                                urlencode %20 escapes
                                                                                                                                              first
{# one line comment #}                                         ifequal…                       var1 var2                                       last                                                              add                            5
autoescape…         on/off                                     ifnotequal…                    var1 var2                                       random                                                            divisibleby                    3
block…              name                                       include                        "template"                                      length




                                                                                                                                                                                                                                                                   NUMBERS
                                                                                                                                                                                                                floatformat                    decimal_places
comment…                                                       load                           tag_library                                     length_is                         number                          filesizeformat
cycle               "one" "two" "three"                        now                            "date format"                                   join                              ", "                            get_digit                      n




                                                                                                                                                                                                      LISTS
debug                                                          regroup                        list_of_dicts by key as var                     make_list                                                         nth-rightmost digit from integer
extends             "template"                                 spaceless…                                                                     makes list of digits/characters                                   pluralize                      "y,ies"
filter...           filter1|filter2                            templatetag                    openblock                                       slice                             "1:5"
                                                               open or close block, brace, variable, comment                                                                                                    date                           "date_format"
firstof             var1 var2 "default"                                                                                                       dictsort                          "key"
                                                               url                            view arg,kwarg=value                                                                                              time                           "date_format"




                                                                                                                                                                                                                                                                & TIMES
                                                                                                                                              dictsortreversed                  "key"




                                                                                                                                                                                                                                                                DATES
for...              item in a_list
                                                               widthratio                     abc                                                                                                               timesince                      datetime
if…else…endif       boolean expression                         a÷b×c
                                                                                                                                              unordered_list
                                                                                                                                              adds <li> tags                                                    timeuntil                      datetime
ifchanged…          var                                        with…                          var1.attr as var2

                                                                                                                                                                                                                lower
 Template date formats                                                                                                                                                                                          upper
h     01 to 12                   d        01 to 31                                  F       January                                                  T         EST, MDT                                         title




                                                                                                                                                                                                      TIME
                                                                         DAY




g     1 to 12                    j        1 to 31                                   M       Jan                                                      O         +0200                                            capfirst
                     HOUR




H     00 to 23                   S        suffix: st, nd, rd or th                  b       jan                                                                                                                 slugify




                                                                                                                                      MONTH
                                                                                                                                                     Z         -43200 to 43200 (seconds)
G     0 to 23                             Friday                                    N       Jan., Feb., March, May                                                                                              ljust                          width
                                                                                                                                                     f         1, 1:30




                                                                                                                                                                                                      FORMATS
                                                                        DAY OF
                                                                         WEEK




                                          Fri                                       m       01 to 12                                                                                                            rjust                          width
i     00 to 59                                                                                                                                       P         1 a.m., 1:30 p.m., noon
                     & SEC
                      MIN




                                          0 (Sun) to 6 (Sat)                        n       1 to 12                                                                                                             center                         width
s     00 to 59                                                                                                                                       r         Thu, 21 Dec 2000 16:01:07 +0200
                                                                                                                                                                                                                wordwrap                       width
a     a.m. or p.m.               z        day of year: 0 to 365                      y      99                                                       L         is leap year: True or False




                                                                                                                                                                                                                                                                 TEXT FORMATTING
                                                                                                                                      YEAR
                                                                                                                                                                                                                wordcount
                                                                         MISC
                     & PM




                                                                                                                                                                                                      MISC
                      AM




A     AM or PM                   W        week number: 1 to 53                       Y      1999                                                     t         length of month: 28 to 31
                                                                                                                                                                                                                striptags
                                                                                                                                                                                                                removetags                     "a img"
 ModelAdmin options                                                                                                                            InlineModelAdmin options                                         truncatewords                  number
                                                                                                                                              model                                                             truncatewords_html             number
date_hierarchy       ="date_field"                             list_select_related              =False                                                                           =Book
                                                                                                                                                                                                                adds closing tags
form                 =FormClass                                inlines                          =list_of_InlineClasses                        fk_name                            ="book"
                                                                                                                                                                                                                linebreaks
fieldsets            =[("Details", {"fields": ("name",)})]     ordering                         =list_of_field_names                          formset                            =BaseInlineFormSet
                                                                                                                                                                                                                linebreaksbr
fields               =list_of_field_names                      prepopulated_fields              ={"slug": ("name",)}                          extra                              =3
                                                                                                                                                                                                                urlize
filter_horizontal    =False                                    radio_fields                     ={"agree": admin.VERTICAL}                    max_num                            =0
                                                                                                                                                                                                                urlizetrunc                    max_length
filter_vertical      =False                                    raw_id_fields                    =list_of_fk_fields                            template                           ="template"
                                                                                                                                                                                                                cut                            "x"
list_display         =list_of_field_names                      save_as                          =False                                        verbose_name                       ="Book"                        strips "x" from string

list_display_links   =list_of_field_names                      save_on_top                      =False                                        verbose_name_plural                ="Books"                       linenumbers
list_filter          =list_of_field_names                      search_fields                    =list_of_field_names                                                                                            phone2numeric
list_per_page        =100                                                                                                                                                                                       pprint
Model fields                                                                                          Relational model fields




                                        Iss
                                           ue
                                             4
DJANGO CHEAT SHEET                               BooleanField                                       DateTimeField                                     ForeignKey(model)
                                                                                                        auto_now        =False                             related_name              ="model_set"
Version 1.0                                      NullBooleanField
                                                 CharField                                              auto_now_add    =False                             limit_choices_to          =query_kwargs
                                                     max_length                                                                                            to_field                  ="key_field"
                                                                                                    TimeField
                                                                                                        auto_now        =False
Model fields common options                      TextField
                                                                                                        auto_now_add    =False
                                                                                                                                                      ManyToManyField(model)
                                                 SlugField                                                                                                related_name       ="model_set"
null                    =False                       max_length         =50                         EmailField                                            limit_choices_to   =query_kwargs
blank                   =False                                                                           max_length     =75                               through            ="IntermediateModel"
                                                 FilePathField
choices                 =list_of_tuples                                                                                                                   symmetrical        =True
                                                      path              ="/home/images"             IPAddressField
db_column               ="column_name"                match             =r".jpg$"                  URLField                                          OneToOneField(model)
db_index                =False                        recursive         =True                           verify_exists   =True                             parent_link                ="field"
db_tablespace           ="tablespace_name"            max_length        =100                            max_length      =200
                                                                                                                                                      GenericForeignKey("content_type_field",
default                 =value_or_func           IntegerField                                       FileField                                         "object_id_field")
editable                =True                    PositiveIntegerField                                     upload_to     ="uploads/"
help_text               ="text"                  AutoField                                                max_length    =100
primary_key             =False                   DecimalField                                             storage       =FileSystemStorage
unique                  =False                        max_digits        =10                                                                            Form error_messages keys
                                                                                                    ImageField
unique_for_date         ="date_field"                 decimal_places    =2                                                                            required                     max_decimal_places
                                                                                                        upload_to       ="uploads/"
unique_for_month        ="date_field"            FloatField                                             max_length      =100                          max_length                   max_whole_digits
unique_for_year         ="date_field"                                                                   storage         =FileSystemStorage            min_length                   missing
                                                 SmallIntegerField
                                                                                                        height_field    ="field_name"                 invalid                      empty
                                                 PositiveSmallIntegerField                                                                            invalid_choice               invalid_image
                                                                                                        width_field     ="field_name"
Meta class options                               CommaSeparatedIntegerField                                                                           max_value                    invalid_list
                                                      max_length        =50                         XMLField                                          min_value                    invalid_link
abstract                =False                                                                         schema_path      =path_to_RelaxNG_schema       max_digits
                                                 DateField
db_table                ="table_name"                auto_now           =False
db_tablespace           ="tablespace_name"           auto_now_add       =False
get_latest_by           ="field_name"
order_with_respect_to   ="fk_field_name"         Form fields
ordering                =list_of_columns
                                                 BooleanField                 FloatField                                ModelChoiceField                        IPAddressField
permissions             =list_of_tuples                                            max_value                                queryset
                                                 NullBooleanField                                                                                               FileField
unique_together         =list_of_tuples                                            min_value                                empty_label            ="----"
                                                 CharField                                                                                                      ImageField
verbose_name            ="Model"                     max_length                                                             cache_choices          =False
                                                                              DateField                                                                         FilePathField
verbose_name_plural     ="Models"                    min_length                   input_formats      =list_of_formats   ModelMultipleChoiceField                      path               ="/home/images"
                                                                                                                            queryset                                  match              =r".jpg$"
                                                 IntegerField                 DateTimeField
Form fields common options                            max_value                   input_formats      =list_of_formats
                                                                                                                            cache_choices        =False               recursive          =False
                                                      min_value                                                         URLField                                RegexField
required                =True                                                 TimeField                                     max_length
                                                                                  input_formats      =list_of_formats                                               regex
label                   ="Field name"            DecimalField                                                               min_length
                                                     max_value                                                                                                      max_length
initial                 ={}                                                   ChoiceField                                   verify_exists          =False           min_length
                                                     min_value                    choices            =list_of_tuples        validator_user_agent
widget                  =Widget
                                                     max_digits
help_text               ="text"                      decimal_places           MultipleChoiceField                       EmailField                             Copyright 2008 Mercurytide Ltd.
error_messages          ={}                                                        choices           =list_of_tuples        max_length                         Released under the Creative Commons
                                                                                                                            min_length                         Attribution-Share Alike 2.5 UK: Scotland Licence.

More Related Content

Viewers also liked

Executive Overview of Managing Agile Programs with Earned Value
Executive Overview of Managing Agile Programs with Earned ValueExecutive Overview of Managing Agile Programs with Earned Value
Executive Overview of Managing Agile Programs with Earned ValueGlen Alleman
 
EVMS Made Simple
EVMS Made SimpleEVMS Made Simple
EVMS Made SimpleGlen Alleman
 
Earned Value Management Essentials
Earned Value Management EssentialsEarned Value Management Essentials
Earned Value Management EssentialsGlen Alleman
 
Jerald kerby
Jerald kerbyJerald kerby
Jerald kerbyNASAPMC
 
Learning Earned Value Management using Lego Bricks
Learning Earned Value Management using Lego BricksLearning Earned Value Management using Lego Bricks
Learning Earned Value Management using Lego BricksYoussef Mourra
 
Earned value management in action - A Webinar by Vivek Prakash, pmwares
Earned value management in action - A Webinar by Vivek Prakash, pmwares Earned value management in action - A Webinar by Vivek Prakash, pmwares
Earned value management in action - A Webinar by Vivek Prakash, pmwares Vivek Prakash
 
Earned Value Management
Earned Value ManagementEarned Value Management
Earned Value ManagementTiago Franco
 
Earned Value Analysis in Project Management — an Easy Cheat Sheet 🡆 http://b...
Earned Value Analysis in Project Management — an Easy Cheat Sheet  🡆 http://b...Earned Value Analysis in Project Management — an Easy Cheat Sheet  🡆 http://b...
Earned Value Analysis in Project Management — an Easy Cheat Sheet 🡆 http://b...Tipsographic . com
 
Earned Value fundamentals
Earned Value fundamentalsEarned Value fundamentals
Earned Value fundamentalsDenise Fotopoulou
 
Earned value management
Earned value managementEarned value management
Earned value managementAshif AR
 
Back to basics - Earned Value Management for beginners webinar
Back to basics - Earned Value Management for beginners webinarBack to basics - Earned Value Management for beginners webinar
Back to basics - Earned Value Management for beginners webinarAssociation for Project Management
 
Earned value management with Examples | Control Cost | PMBOK | PMP
Earned value management with Examples | Control Cost | PMBOK | PMPEarned value management with Examples | Control Cost | PMBOK | PMP
Earned value management with Examples | Control Cost | PMBOK | PMPJustAcademy
 
A gentle introduction to earned value management systems (neutral)
A gentle introduction to earned value management systems (neutral)A gentle introduction to earned value management systems (neutral)
A gentle introduction to earned value management systems (neutral)Glen Alleman
 
Earning Value from Earned Value Management
Earning Value from Earned Value ManagementEarning Value from Earned Value Management
Earning Value from Earned Value ManagementGlen Alleman
 
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...Project Controls Expo
 
A simple example of Earned Value Management (EVM) in action
A simple example of Earned Value Management (EVM) in actionA simple example of Earned Value Management (EVM) in action
A simple example of Earned Value Management (EVM) in actionPlanisware
 

Viewers also liked (20)

Executive Overview of Managing Agile Programs with Earned Value
Executive Overview of Managing Agile Programs with Earned ValueExecutive Overview of Managing Agile Programs with Earned Value
Executive Overview of Managing Agile Programs with Earned Value
 
EVMS Made Simple
EVMS Made SimpleEVMS Made Simple
EVMS Made Simple
 
Earned Value Management Essentials
Earned Value Management EssentialsEarned Value Management Essentials
Earned Value Management Essentials
 
Jerald kerby
Jerald kerbyJerald kerby
Jerald kerby
 
Learning Earned Value Management using Lego Bricks
Learning Earned Value Management using Lego BricksLearning Earned Value Management using Lego Bricks
Learning Earned Value Management using Lego Bricks
 
Earned value management in action - A Webinar by Vivek Prakash, pmwares
Earned value management in action - A Webinar by Vivek Prakash, pmwares Earned value management in action - A Webinar by Vivek Prakash, pmwares
Earned value management in action - A Webinar by Vivek Prakash, pmwares
 
Earned Value Management
Earned Value ManagementEarned Value Management
Earned Value Management
 
Earned Value Analysis in Project Management — an Easy Cheat Sheet 🡆 http://b...
Earned Value Analysis in Project Management — an Easy Cheat Sheet  🡆 http://b...Earned Value Analysis in Project Management — an Easy Cheat Sheet  🡆 http://b...
Earned Value Analysis in Project Management — an Easy Cheat Sheet 🡆 http://b...
 
EVA/EVM
EVA/EVMEVA/EVM
EVA/EVM
 
Earned Value fundamentals
Earned Value fundamentalsEarned Value fundamentals
Earned Value fundamentals
 
Earned Value Management - Foundation
Earned Value Management - FoundationEarned Value Management - Foundation
Earned Value Management - Foundation
 
Earned value management
Earned value managementEarned value management
Earned value management
 
Projects Performance Analysis & Forecasting
Projects Performance Analysis & Forecasting Projects Performance Analysis & Forecasting
Projects Performance Analysis & Forecasting
 
Back to basics - Earned Value Management for beginners webinar
Back to basics - Earned Value Management for beginners webinarBack to basics - Earned Value Management for beginners webinar
Back to basics - Earned Value Management for beginners webinar
 
Earned value management with Examples | Control Cost | PMBOK | PMP
Earned value management with Examples | Control Cost | PMBOK | PMPEarned value management with Examples | Control Cost | PMBOK | PMP
Earned value management with Examples | Control Cost | PMBOK | PMP
 
A gentle introduction to earned value management systems (neutral)
A gentle introduction to earned value management systems (neutral)A gentle introduction to earned value management systems (neutral)
A gentle introduction to earned value management systems (neutral)
 
Earned Value Management
Earned Value ManagementEarned Value Management
Earned Value Management
 
Earning Value from Earned Value Management
Earning Value from Earned Value ManagementEarning Value from Earned Value Management
Earning Value from Earned Value Management
 
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...
Project Controls Expo 09/10 Nov London 2011 - "Integrating Risk and Earned Va...
 
A simple example of Earned Value Management (EVM) in action
A simple example of Earned Value Management (EVM) in actionA simple example of Earned Value Management (EVM) in action
A simple example of Earned Value Management (EVM) in action
 

Recently uploaded

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Recently uploaded (20)

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

Django10 cheat-sheet-grayscale

  • 1. Template filters Iss ue 4 DJANGO CHEAT SHEET default value escape force_escape GENERAL default_if_none value Version 1.0 ESCAPING www.mercurytide.co.uk/careers yesno "yes,no,none" safe don’t escape stringformat "s" escapejs x20 escapes python “%” formatting iriencode IRI to URI Template tags ... - end tag required urlencode %20 escapes first {# one line comment #} ifequal… var1 var2 last add 5 autoescape… on/off ifnotequal… var1 var2 random divisibleby 3 block… name include "template" length NUMBERS floatformat decimal_places comment… load tag_library length_is number filesizeformat cycle "one" "two" "three" now "date format" join ", " get_digit n LISTS debug regroup list_of_dicts by key as var make_list nth-rightmost digit from integer extends "template" spaceless… makes list of digits/characters pluralize "y,ies" filter... filter1|filter2 templatetag openblock slice "1:5" open or close block, brace, variable, comment date "date_format" firstof var1 var2 "default" dictsort "key" url view arg,kwarg=value time "date_format" & TIMES dictsortreversed "key" DATES for... item in a_list widthratio abc timesince datetime if…else…endif boolean expression aĂ·bĂ—c unordered_list adds <li> tags timeuntil datetime ifchanged… var with… var1.attr as var2 lower Template date formats upper h 01 to 12 d 01 to 31 F January T EST, MDT title TIME DAY g 1 to 12 j 1 to 31 M Jan O +0200 capfirst HOUR H 00 to 23 S suffix: st, nd, rd or th b jan slugify MONTH Z -43200 to 43200 (seconds) G 0 to 23 Friday N Jan., Feb., March, May ljust width f 1, 1:30 FORMATS DAY OF WEEK Fri m 01 to 12 rjust width i 00 to 59 P 1 a.m., 1:30 p.m., noon & SEC MIN 0 (Sun) to 6 (Sat) n 1 to 12 center width s 00 to 59 r Thu, 21 Dec 2000 16:01:07 +0200 wordwrap width a a.m. or p.m. z day of year: 0 to 365 y 99 L is leap year: True or False TEXT FORMATTING YEAR wordcount MISC & PM MISC AM A AM or PM W week number: 1 to 53 Y 1999 t length of month: 28 to 31 striptags removetags "a img" ModelAdmin options InlineModelAdmin options truncatewords number model truncatewords_html number date_hierarchy ="date_field" list_select_related =False =Book adds closing tags form =FormClass inlines =list_of_InlineClasses fk_name ="book" linebreaks fieldsets =[("Details", {"fields": ("name",)})] ordering =list_of_field_names formset =BaseInlineFormSet linebreaksbr fields =list_of_field_names prepopulated_fields ={"slug": ("name",)} extra =3 urlize filter_horizontal =False radio_fields ={"agree": admin.VERTICAL} max_num =0 urlizetrunc max_length filter_vertical =False raw_id_fields =list_of_fk_fields template ="template" cut "x" list_display =list_of_field_names save_as =False verbose_name ="Book" strips "x" from string list_display_links =list_of_field_names save_on_top =False verbose_name_plural ="Books" linenumbers list_filter =list_of_field_names search_fields =list_of_field_names phone2numeric list_per_page =100 pprint
  • 2. Model fields Relational model fields Iss ue 4 DJANGO CHEAT SHEET BooleanField DateTimeField ForeignKey(model) auto_now =False related_name ="model_set" Version 1.0 NullBooleanField CharField auto_now_add =False limit_choices_to =query_kwargs max_length to_field ="key_field" TimeField auto_now =False Model fields common options TextField auto_now_add =False ManyToManyField(model) SlugField related_name ="model_set" null =False max_length =50 EmailField limit_choices_to =query_kwargs blank =False max_length =75 through ="IntermediateModel" FilePathField choices =list_of_tuples symmetrical =True path ="/home/images" IPAddressField db_column ="column_name" match =r".jpg$" URLField OneToOneField(model) db_index =False recursive =True verify_exists =True parent_link ="field" db_tablespace ="tablespace_name" max_length =100 max_length =200 GenericForeignKey("content_type_field", default =value_or_func IntegerField FileField "object_id_field") editable =True PositiveIntegerField upload_to ="uploads/" help_text ="text" AutoField max_length =100 primary_key =False DecimalField storage =FileSystemStorage unique =False max_digits =10 Form error_messages keys ImageField unique_for_date ="date_field" decimal_places =2 required max_decimal_places upload_to ="uploads/" unique_for_month ="date_field" FloatField max_length =100 max_length max_whole_digits unique_for_year ="date_field" storage =FileSystemStorage min_length missing SmallIntegerField height_field ="field_name" invalid empty PositiveSmallIntegerField invalid_choice invalid_image width_field ="field_name" Meta class options CommaSeparatedIntegerField max_value invalid_list max_length =50 XMLField min_value invalid_link abstract =False schema_path =path_to_RelaxNG_schema max_digits DateField db_table ="table_name" auto_now =False db_tablespace ="tablespace_name" auto_now_add =False get_latest_by ="field_name" order_with_respect_to ="fk_field_name" Form fields ordering =list_of_columns BooleanField FloatField ModelChoiceField IPAddressField permissions =list_of_tuples max_value queryset NullBooleanField FileField unique_together =list_of_tuples min_value empty_label ="----" CharField ImageField verbose_name ="Model" max_length cache_choices =False DateField FilePathField verbose_name_plural ="Models" min_length input_formats =list_of_formats ModelMultipleChoiceField path ="/home/images" queryset match =r".jpg$" IntegerField DateTimeField Form fields common options max_value input_formats =list_of_formats cache_choices =False recursive =False min_value URLField RegexField required =True TimeField max_length input_formats =list_of_formats regex label ="Field name" DecimalField min_length max_value max_length initial ={} ChoiceField verify_exists =False min_length min_value choices =list_of_tuples validator_user_agent widget =Widget max_digits help_text ="text" decimal_places MultipleChoiceField EmailField Copyright 2008 Mercurytide Ltd. error_messages ={} choices =list_of_tuples max_length Released under the Creative Commons min_length Attribution-Share Alike 2.5 UK: Scotland Licence.