[Django] #28643: Complete the ORM Function Library

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Django] #28643: Complete the ORM Function Library

Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
               Reporter:  Matthew    |          Owner:  nobody
  Pava                               |
                   Type:  New        |         Status:  new
  feature                            |
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I was surprised to learn that we didn't have a StrIndex function until
 version 2, and yet we had Substr since at least version 1.8.  I wonder how
 users were using Substr without also finding a use for StrIndex this whole
 time.  Anyway, since we seem to be adding these functions one at a time,
 why don't we work on trying to get the built-ins implemented in one sweep
 instead?

 We may even want to split the documentation page
 (https://docs.djangoproject.com/en/dev/ref/models/database-functions/)
 into further categories with String functions and Numeric functions.

 This is just a sample checklist.  There are probably several more that I
 have missed.  These functions are available directly out of the box with
 PostgreSQL.

 String functions not yet implemented:
 ASCII(): Returns numeric value of left-most character
 CHR(): Character with the given code.
 LEFT(): Returns the leftmost number of characters as specified
 LPAD(): Returns the string argument, left-padded with the specified string
 LTRIM(): Removes leading spaces
 MD5(): Calculates the MD5 hash of string, returning the result in
 hexadecimal
 REPEAT(): Repeats a string the specified number of times
 REPLACE(): Replaces occurrences of a specified string
 REVERSE(): Reverse the characters in a string
 RIGHT(): Returns the specified rightmost number of characters
 RPAD(): Appends string the specified number of times
 RTRIM(): Removes trailing spaces
 TRIM(): Removes leading and trailing spaces

 Numeric functions:
 ABS(): Returns the absolute value.
 ACOS(): Returns the arccosine.
 ASIN(): Returns the arcsine.
 ATAN(): Returns the arctangent.
 ATAN2(): Returns the arctangent of the two variables passed to it.
 CEILING(): Returns the smallest integer value that is not less than a
 numeric expression
 COS(): Returns the cosine expressed in radians.
 COT(): Returns the cotangent.
 DEGREES(): Returns a numeric expression converted from radians to degrees.
 EXP(): Returns the base of the natural logarithm (e) raised to the power
 of a numeric expression.
 FLOOR(): Returns the largest integer value that is not greater than a
 numeric expression.
 LOG(): Returns the natural logarithm of a numeric expression.
 MOD(): Returns the remainder of one expression by diving by another
 expression.
 PI(): Returns the value of pi
 POWER(): Returns the value of one expression raised to the power of
 another expression
 RADIANS(): Returns the value of an expression converted from degrees to
 radians.
 ROUND(): Returns a numeric expression rounded to an integer. Can be used
 to round an expression to a number of decimal points
 SIN(): Returns the sine given in radians.
 SQRT(): Returns the square root.
 TAN(): Returns the tangent expressed in radians.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.a45b24564b0accc0111b5fa089f346d3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Josh Smeaton):

 I had hoped that the 3rd party community would take care of providing
 "Function Packs" for each of the backends. But functions are fairly easy
 to create in your own project if you need them so I guess few people have
 bothered to group them into a distributable package.

 I would prefer that the django ecosystem had a standard group of function
 expressions that can be used across backends, rather than a bunch of
 similar but not quite the same implementations. Then 3rd party libraries
 can depend on the known good versions and everyone is better off. Since
 the community hasn't seemed to provide such a library (that I'm aware of),
 I think it's fine for Django to do so.

 Splitting the module up into string/numeric/date types sounds fine. Let's
 take inspiration from postgres and other db vendor docs so navigating them
 is familiar. Let's begin with functions that have standard support across
 our 4 backends, then look into what's left over. If we can approximate
 support by combining other functions we can do that. Otherwise if a
 particular function only has support for one or two backends we can
 consider ignoring it or implementing in a contrib module.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.7ee47c703a413fb31fb3995c41725aec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Josh Smeaton):

 * cc: josh.smeaton@… (added)
 * stage:  Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.adabdf24e682b5498fffe19b95cd0b3a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * cc: felixxm (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.58ad2b20db8b2646e5540d7fd6325e1b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by JunyiJ):

 * owner:  nobody => JunyiJ
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.5727f04d84391f20f1dd64189687e89f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Josh Smeaton):

 For whoever wants to begin here, I think a good plan of attack will be a
 PR per function or per a small set of functions. Then the commit message
 would be something like "Refs #28643 -- Added X, Y, Z functions".

 That way we can get through smaller pieces at a time, without such a large
 burden being placed on any one individual. We could also get some newer
 contributors to help in this way. Each function on its own should be a
 relatively easy thing to implement. A higher level task of re-organising
 the layout into functions/string functions/number may be helpful to get
 the ticket rolling.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.195c30c4058cc6fedbdb14e9a5afd131%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Matthew Pava):

 I did find this third-party utility that handles specific PostgreSQL
 functions.  I wonder if there are other backends that they could be ported
 to.
 https://github.com/hypertrack/django-pg-utils

 And I also wonder how all of this connects with specific PostgreSQL
 aggregate functions already builtin to Django:
 https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/aggregates/

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.4401b3a329c7edd8b61c52972b573481%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mads Jensen):

 Replying to [comment:6 Matthew Pava]:
 > I did find this third-party utility that handles specific PostgreSQL
 functions.  I wonder if there are other backends that they could be ported
 to.
 > https://github.com/hypertrack/django-pg-utils

 From a quick look, these things are already supported by Django.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.61902a25846e5187dd56bcf1230de569%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by felixxm:

Old description:

> I was surprised to learn that we didn't have a StrIndex function until
> version 2, and yet we had Substr since at least version 1.8.  I wonder
> how users were using Substr without also finding a use for StrIndex this
> whole time.  Anyway, since we seem to be adding these functions one at a
> time, why don't we work on trying to get the built-ins implemented in one
> sweep instead?
>
> We may even want to split the documentation page
> (https://docs.djangoproject.com/en/dev/ref/models/database-functions/)
> into further categories with String functions and Numeric functions.
>
> This is just a sample checklist.  There are probably several more that I
> have missed.  These functions are available directly out of the box with
> PostgreSQL.
>
> String functions not yet implemented:
> ASCII(): Returns numeric value of left-most character
> CHR(): Character with the given code.
> LEFT(): Returns the leftmost number of characters as specified
> LPAD(): Returns the string argument, left-padded with the specified
> string
> LTRIM(): Removes leading spaces
> MD5(): Calculates the MD5 hash of string, returning the result in
> hexadecimal
> REPEAT(): Repeats a string the specified number of times
> REPLACE(): Replaces occurrences of a specified string
> REVERSE(): Reverse the characters in a string
> RIGHT(): Returns the specified rightmost number of characters
> RPAD(): Appends string the specified number of times
> RTRIM(): Removes trailing spaces
> TRIM(): Removes leading and trailing spaces
>
> Numeric functions:
> ABS(): Returns the absolute value.
> ACOS(): Returns the arccosine.
> ASIN(): Returns the arcsine.
> ATAN(): Returns the arctangent.
> ATAN2(): Returns the arctangent of the two variables passed to it.
> CEILING(): Returns the smallest integer value that is not less than a
> numeric expression
> COS(): Returns the cosine expressed in radians.
> COT(): Returns the cotangent.
> DEGREES(): Returns a numeric expression converted from radians to
> degrees.
> EXP(): Returns the base of the natural logarithm (e) raised to the power
> of a numeric expression.
> FLOOR(): Returns the largest integer value that is not greater than a
> numeric expression.
> LOG(): Returns the natural logarithm of a numeric expression.
> MOD(): Returns the remainder of one expression by diving by another
> expression.
> PI(): Returns the value of pi
> POWER(): Returns the value of one expression raised to the power of
> another expression
> RADIANS(): Returns the value of an expression converted from degrees to
> radians.
> ROUND(): Returns a numeric expression rounded to an integer. Can be used
> to round an expression to a number of decimal points
> SIN(): Returns the sine given in radians.
> SQRT(): Returns the square root.
> TAN(): Returns the tangent expressed in radians.
New description:

 I was surprised to learn that we didn't have a StrIndex function until
 version 2, and yet we had Substr since at least version 1.8.  I wonder how
 users were using Substr without also finding a use for StrIndex this whole
 time.  Anyway, since we seem to be adding these functions one at a time,
 why don't we work on trying to get the built-ins implemented in one sweep
 instead?

 We may even want to split the documentation page
 (https://docs.djangoproject.com/en/dev/ref/models/database-functions/)
 into further categories with String functions and Numeric functions.

 This is just a sample checklist.  There are probably several more that I
 have missed.  These functions are available directly out of the box with
 PostgreSQL.

 String functions not yet implemented:
 ASCII(): Returns numeric value of left-most character
 CHR(): Character with the given code.
 LEFT(): Returns the leftmost number of characters as specified
 LPAD(): Returns the string argument, left-padded with the specified string
 MD5(): Calculates the MD5 hash of string, returning the result in
 hexadecimal
 REPEAT(): Repeats a string the specified number of times
 REPLACE(): Replaces occurrences of a specified string
 REVERSE(): Reverse the characters in a string
 RIGHT(): Returns the specified rightmost number of characters
 RPAD(): Appends string the specified number of times
 LTRIM(): Removes leading spaces
 ([https://github.com/django/django/pull/9220 PR #9220])
 RTRIM(): Removes trailing spaces
 ([https://github.com/django/django/pull/9220 PR #9220])
 TRIM(): Removes leading and trailing spaces
 ([https://github.com/django/django/pull/9220 PR #9220])

 Numeric functions:
 ABS(): Returns the absolute value.
 ACOS(): Returns the arccosine.
 ASIN(): Returns the arcsine.
 ATAN(): Returns the arctangent.
 ATAN2(): Returns the arctangent of the two variables passed to it.
 CEILING(): Returns the smallest integer value that is not less than a
 numeric expression
 COS(): Returns the cosine expressed in radians.
 COT(): Returns the cotangent.
 DEGREES(): Returns a numeric expression converted from radians to degrees.
 EXP(): Returns the base of the natural logarithm (e) raised to the power
 of a numeric expression.
 FLOOR(): Returns the largest integer value that is not greater than a
 numeric expression.
 LOG(): Returns the natural logarithm of a numeric expression.
 MOD(): Returns the remainder of one expression by diving by another
 expression.
 PI(): Returns the value of pi
 POWER(): Returns the value of one expression raised to the power of
 another expression
 RADIANS(): Returns the value of an expression converted from degrees to
 radians.
 ROUND(): Returns a numeric expression rounded to an integer. Can be used
 to round an expression to a number of decimal points
 SIN(): Returns the sine given in radians.
 SQRT(): Returns the square root.
 TAN(): Returns the tangent expressed in radians.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.7705f70c03da6304a954c21428ee6d3c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 I prepared patch to reorganize database functions docs and code
 ([https://github.com/django/django/pull/9227 PR]). I think we should
 organize code and doc as follows (bolded functions doesn't exist):

 - `docs/ref/models/database-functions.txt` main section
 (`django/db/models/functions/misc.py`):
  - ''**Ascii**, Cast, **Chr**, Coalesce, Greatest, Least, Now'';
 - `docs/ref/models/database-functions.txt` section `Date Functions`
 (`django/db/models/functions/datetime.py`):
  - ''Extract, ExtractDay, ExtractHour, ExtractMinute, ExtractMonth,
 ExtractQuarter, ExtractSecond, ExtractWeek, ExtractWeekDay, ExtractYear,
 Trunc, TruncDate, TruncDay, TruncHour, TruncMinute, TruncMonth,
 TruncQuarter, TruncSecond, TruncTime, TruncYear;';
 - `docs/ref/models/database-functions.txt` section `Math Functions`
 (`django/db/models/functions/math.py`):
  - ''**Abs**, **Acos**, **Asin**, **Atan**, **Atan2**, **Ceil**, **Cos**,
 **Cot**, **Exp**, **Floor**, **Log**, **Mod**, **Sin**, **Sqrt**,
 **Tan**'';
 - `docs/ref/models/database-functions.txt` section `Text Functions`
 (`django/db/models/functions/text.py`):
  - ''Concat, ConcatPair, Length, **Lpad**, Lower, **Ltrim**, **Power**,
 **Replace**, **Round**, **Rpad**, **Rtrim**, StrIndex, Substr, **Trim**,
 Upper'';
 - `docs/ref/models/database-functions.txt` section `Window Functions`
 (`django/db/models/functions/window.py`):
  - ''CumeDist, DenseRank, FirstValue, Lag, LastValue, Lead, NthValue,
 Ntile, PercentRank, Rank, RowNumber''.

 Headers and functions in docs and code should be organized alphabetically.
 Thanks Tim Graham for suggestions.

 I'm not convince that following functions should be implemented because
 there not supported on all databases:
 - LEFT(), MD5(), REPEAT(), REVERSE(), RIGHT(), DEGREES(), PI(), RADIANS().

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.47eb4c7cc132c342635026077b001f74%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

 The "Miscellaneous" group is sort of bothering me.

 `Cast`, `Coalesce`, `Greatest`, `Least` sound like candidates for a
 section called something like "Comparison and conversion functions"

 `Ascii` and `Chr` sound like they could be "text" related.

 `Now` sounds like a candidate for "Date Functions".

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.d4ff27877bb8c10cf936b6f642e43b4a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 Agreed. I updated above comment and both PRs.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.5c1e4ce8133f5fb960bbaec5ba9fcced%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Matthew Pava):

 In regards to Left() and Right(), they are  available in PostgreSQL and
 MySQL, but not in SQLite or Oracle.  However, you can emulate their
 functionality using the corresponding Substr function in the database
 backend.  I would hate to see us leave those out for that reason alone.
 At the same time, developers could use the Substr across all databases
 instead of using Left and Right.

 I was also wondering about the use of Trim.  Python doesn't use that term;
 instead, it uses strip.  I wonder if that really matters.  Some developers
 may look for a strip functionality in Django ORM not realizing that the
 databases use the term Trim.  Perhaps that could be clarified in the
 documentation.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.753b30dd030e9ac54f7be63268d61cf8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Shai Berger):

 * cc: Shai Berger (added)


Comment:

 Replying to [comment:12 Matthew Pava]:
 >
 > I was also wondering about the use of Trim.  Python doesn't use that
 term; instead, it uses strip.  I wonder if that really matters.  Some
 developers may look for a strip functionality in Django ORM not realizing
 that the databases use the term Trim.  Perhaps that could be clarified in
 the documentation.

 Unless there is some other use for the term `strip` in the databases, I'd
 consider "documenting" this by giving an alias:
 {{{
 class Trim(Transform):
     # ...

 Strip = Trim  # Give Trim a more Pythonic name
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.6184dbd9e330c38410628298e8f353bf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

 In [changeset:"ad8036d715d4447b95d485332511b4edb1a40c0e" ad8036d7]:
 {{{
 #!CommitTicketReference repository=""
 revision="ad8036d715d4447b95d485332511b4edb1a40c0e"
 Refs #28643 -- Reorganized database functions docs.

 Thanks Tim Graham for the review.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.8d51dea27a5e9363fe7b910e121098bb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"8b42a18b2d7bbd9e94ee80458a1cfcbb544e588c" 8b42a18b]:
 {{{
 #!CommitTicketReference repository=""
 revision="8b42a18b2d7bbd9e94ee80458a1cfcbb544e588c"
 [2.0.x] Refs #28643 -- Reorganized database functions docs.

 Thanks Tim Graham for the review.

 Backport of ad8036d715d4447b95d485332511b4edb1a40c0e from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:15>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.d37de21d4fff1bff0c7b4c9f530b612a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

 In [changeset:"4f27e475b30d0cf91be24f3116a54b17789ac403" 4f27e475]:
 {{{
 #!CommitTicketReference repository=""
 revision="4f27e475b30d0cf91be24f3116a54b17789ac403"
 Refs #28643 -- Reorganized database functions.

 Thanks Tim Graham for the review.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:16>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.3b753c15e0d160823f24969f0a1582c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 [https://github.com/django/django/pull/9220 PR - Ltrim, Rtrim, Strip, and
 Trim.]

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.81adc885d93f08512cd92f765321ebfa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Matthew Pava):

 And, of course, there is a Python ''lstrip'' and ''rstrip'' as well.

 {{{
 Lstrip = Ltrim  # Give Ltrim a more Pythonic name
 Rstrip = Rtrim  # Give Rtrim a more Pythonic name
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.259768f6ae67b9f94a5fa0a6854526b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28643: Complete the ORM Function Library

Django
In reply to this post by Django
#28643: Complete the ORM Function Library
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  JunyiJ
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 Replying to [comment:18 Matthew Pava]:
 > And, of course, there is a Python ''lstrip'' and ''rstrip'' as well.
 >
 > {{{
 > Lstrip = Ltrim  # Give Ltrim a more Pythonic name
 > Rstrip = Rtrim  # Give Rtrim a more Pythonic name
 > }}}

 I added these aliases.

--
Ticket URL: <https://code.djangoproject.com/ticket/28643#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.94a6277150b2cdc6fd12982a7519836c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
12