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

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

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.