We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Pushing the ORM to its limits

00:00

Formal Metadata

Title
Pushing the ORM to its limits
Title of Series
Number of Parts
32
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
You can do a lot more with the Django ORM than you might think, and when something isn’t possible using the existing primitives, you can easily add your own. In this talk you will learn about both advanced features of the ORM and how to run your own SQL queries. Django’s ORM makes it super simple to run quick queries against your database, but it can do a lot more for you than you might think. Need to get some statistics on a monthly-basis? Easy, just annotate your queryset with year and month using ExtractYear and ExtractMonth, and you can use .values() to get the data aggregated by month. When you find yourself in need of something that is not already covered by the existing ORM functions, you will often be able to create it yourself. Have you modelled your data with separate date and time fields, but need to compare this to a datetime field? You can make a custom expression in Django for combining the date and time into a datetime in the database. Starting with Django 1.11, you can easily make subqueries using the Django ORM. In Django 2.0 we got support for window functions. Django 2.1 exposes additional functions that are available in many databases, and version 2.2 will introduce support for custom constraints and extends the primitives for custom indexes. It is also easy to drop down to writing raw SQL if you need to. It is probably not something you need to do every day, but it’s good to know that the option is there, and know how and when to do it.
Keywords
Object-relational mappingLimit (category theory)Projective planeCodeEndliche ModelltheorieObject-relational mappingConstraint (mathematics)Window functionBitComputer virusData storage deviceCASE <Informatik>Fault-tolerant systemSoftware developerObject (grammar)Logistic distributionData managementSubject indexingSet (mathematics)Computer animationLecture/Conference
Product (business)Endliche ModelltheorieDigital filterObject (grammar)Order (biology)Endliche ModelltheorieSerial portView (database)Order (biology)Default (computer science)Multiplication signQuery languageProduct (business)Object (grammar)Set (mathematics)CASE <Informatik>Data managementCore dumpDifferent (Kate Ryan album)EmailField (computer science)Data storage deviceComputer animation
Query languageOrder (biology)Object (grammar)Function (mathematics)DatabaseComputer configurationQuery languageFile formatResultantProcess (computing)Point (geometry)Computer animation
Order (biology)Object (grammar)Query languageOrder (biology)Line (geometry)Condition numberSet (mathematics)Point (geometry)Query languageDatabaseEntire functionMathematical optimizationCore dumpSelectivity (electronic)Relational databaseLoop (music)Computer animation
Product (business)Object (grammar)Atomic numberCondition numberBlock (periodic table)DatabaseRow (database)Query languageComputer configurationSelectivity (electronic)Condition numberObject (grammar)Database transactionBitProduct (business)CASE <Informatik>Point (geometry)Torus
ArmMultiplication signOrder (biology)Computer animation
Object (grammar)Order (biology)Digital filterExistenceCodeKey (cryptography)Query languageMultiplication signOrder (biology)DatabaseFlow separationTimestampCASE <Informatik>Object (grammar)Social classResultantSquare numberField (computer science)Bit
Digital filterOrder (biology)Object (grammar)Electronic mailing listOcean currentTotal S.A.Computer wormResultantElectronic mailing listRow (database)Group actionSummierbarkeitObject (grammar)Order (biology)Level (video gaming)Field (computer science)Table (information)Database
Object (grammar)Order (biology)Digital filterLine (geometry)Function (mathematics)SummierbarkeitTable (information)Group actionKey (cryptography)Function (mathematics)Query languageOrder (biology)Ocean currentSet (mathematics)Object (grammar)CASE <Informatik>ResultantDirection (geometry)DatabaseRow (database)WordConstraint (mathematics)Social classSubject indexingPoint (geometry)Attribute grammarBit rateUniqueness quantificationComputer animation
Subject indexingConstraint (mathematics)Subject indexingUniqueness quantificationCondition numberConstraint (mathematics)Point (geometry)Relational databaseComputer animation
Endliche ModelltheorieData modelUniqueness quantificationRelational databaseConstraint (mathematics)Subject indexingValidity (statistics)Uniqueness quantificationType theorySubject indexingRow (database)Relational databaseTable (information)1 (number)Pointer (computer programming)Condition numberOrder (biology)Limit (category theory)Field (computer science)Range (statistics)DatabaseQuery languageCASE <Informatik>Constraint (mathematics)Electronic mailing listNormal (geometry)Combinational logicProcess (computing)Multiplication signShift operatorInclusion map
Window functionFunction (mathematics)Partition (number theory)Order (biology)Object (grammar)ASCIIWindow functionPoint (geometry)Social classOrder (biology)Multiplication signFunction (mathematics)Row (database)Partition (number theory)CumulantResultantQuery languageSet (mathematics)Total S.A.SummierbarkeitWordDatabaseCASE <Informatik>Computer animation
Function (mathematics)Complex (psychology)CompilerTime zoneContext awarenessCASE <Informatik>Function (mathematics)Multiplication signFront and back endsTime zoneFlow separationTable (information)Field (computer science)Proper mapDatabaseCodeTimestampTemplate (C++)InformationNumberRoundness (object)Parity (mathematics)Greatest elementComputer animation
WritingOrder (biology)Object (grammar)Cursor (computers)Entire functionFunction (mathematics)TupleQuery languageSet (mathematics)DatabaseRow (database)Core dumpRule of inferenceSocial classCursor (computers)WordCASE <Informatik>
DiameterQuery languageColor confinementBlogTwitterOffice suiteComputer animation
Transcript: English(auto-generated)