Re: [Django] #10070: Named parameters not working on raw sql queries with sqlite

2022-10-30 Thread Django
#10070: Named parameters not working on raw sql queries with sqlite
-+-
 Reporter:  Matias Surdi |Owner:  Ryan
 |  Cheley
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * status:  new => assigned
 * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701842c6df15d-be675f98-ed8f-45c7-8d50-0e12d8aff32e-00%40eu-central-1.amazonses.com.


Re: [Django] #10070: Named parameters not working on raw sql queries with sqlite

2022-10-30 Thread Django
#10070: Named parameters not working on raw sql queries with sqlite
-+-
 Reporter:  Matias Surdi |Owner:  Ryan
 |  Cheley
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Ryan Cheley):

 Thanks for the feed back Shai and Simon. I will take a look and see how I
 can work that into the solution.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701842a5cee0e-2a81b84c-0f40-4c79-8bdb-4405ea2cab2c-00%40eu-central-1.amazonses.com.


Re: [Django] #10070: Named parameters not working on raw sql queries with sqlite

2022-10-30 Thread Django
#10070: Named parameters not working on raw sql queries with sqlite
-+-
 Reporter:  Matias Surdi |Owner:  Ryan
 |  Cheley
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I agree with Shai that we should avoid using regex here.

 The most straightforward solution I can think of, I haven't looked at the
 Oracle implementation in details, would be to simply implement
 `__getitem__`

 {{{#!python
  class SQLiteParams:
 def __getitem__(self, param):
 return f":{param}"

 sql = sql % SQLiteParams()
 }}}

 This will ensure the backend reports the low level ''missing param''
 message in cases a parameter is missing instead of a `KeyError` during the
 Django ''translation'' phase

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701842a41a611-625d4020-a806-46cc-b92d-0e2f61803a52-00%40eu-central-1.amazonses.com.


Re: [Django] #10070: Named parameters not working on raw sql queries with sqlite

2022-10-30 Thread Django
#10070: Named parameters not working on raw sql queries with sqlite
-+-
 Reporter:  Matias Surdi |Owner:  Ryan
 |  Cheley
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Shai Berger):

 Replying to [comment:27 Ryan Cheley]:
 >
 > I think the way to fix the issue is to update that method to include the
 following logic:
 >
 >
 > {{{
 > query  = re.sub("\)s", "",  re.sub("%\(", ":", query))
 > }}}
 >

 This looks quite fragile (consider, e.g. a query which, for whatever
 reason, includes {{{)s}}} in a string constant).
 A more robust approach is to create a naming-dict from all the param-
 names, and use that to format the original text:
 {{{#!python
 naming_dict = { param: f":{param}" for param in param_names}
 query = query % naming_dict
 }}}
 Where {{{param_names}}} can be collected either by parsing the query, or
 from the parameters given.

 (take a look at the Oracle backend -- I wrote that piece too long ago to
 remember which it takes, but at the time I knew what I was doing there)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701842a2e6402-21b1e7d6-3590-4ef5-a251-02a6c204b553-00%40eu-central-1.amazonses.com.


Re: [Django] #34077: Make BoundField renderable.

2022-10-30 Thread Django
#34077: Make BoundField renderable.
-+
 Reporter:  David Smith  |Owner:  skidipap
 Type:  New feature  |   Status:  assigned
Component:  Forms|  Version:  4.1
 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 David Smith):

 >I think this is the logical next/final? step in the form

 I think so.

 @skidipap -- How are you getting on with this. I had made a tentative
 start, but then realised you have claimed the ticket and therefore wanted
 to avoid duplicate work. Maybe if you have some work to share I could help
 with comments on a PR?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018429de6be1-ed5db449-45df-429c-940a-e6225c0b80ee-00%40eu-central-1.amazonses.com.


Re: [Django] #10070: Named parameters not working on raw sql queries with sqlite

2022-10-30 Thread Django
#10070: Named parameters not working on raw sql queries with sqlite
-+-
 Reporter:  Matias Surdi |Owner:  Ryan
 |  Cheley
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Ryan Cheley):

 I've done a bit of research and it looks like
 `django.db.backends.sqlite3.base` has a class called
 `SQLiteCursorWrapper`.

 This in turn has a method `convert_query` which per the doc string of the
 `SQLiteCursorWrapper ` method does:

 Django uses "format" style placeholders, but pysqlite2 uses "qmark"
 style.
 This fixes it -- but note that if you want to use a literal "%s" in a
 query,
 you'll need to use "%%s".

 I think the way to fix the issue is to update that method to include the
 following logic:


 {{{
 query  = re.sub("\)s", "",  re.sub("%\(", ":", query))
 }}}

 this will convert the string passed using the expectations of the ORM API
 to what SQLite is expecting for parameters, i.e. a passed in query will go
 from this

 {{{
 'select * from content_injuredlist where id =  %(id)s and app_name =
 %(app_name)s'
 }}}

 to this

 {{{
 'select * from content_injuredlist where id =  :id and app_name =
 :app_name'
 }}}

 which will then work with SQLite

 Still to do:

 - Update the method
 - Write any tests
 - submit PR

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018429bdc3e4-259a5e81-bc35-4eb6-bc9e-87eb607e2751-00%40eu-central-1.amazonses.com.


Re: [Django] #34110: Add InMemoryStorage

2022-10-30 Thread Django
#34110: Add InMemoryStorage
-+-
 Reporter:  Josh |Owner:  Francesco
 |  Panico
 Type:  New feature  |   Status:  assigned
Component:  File |  Version:  dev
  uploads/storage|
 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 Francesco Panico):

 * owner:  nobody => Francesco Panico
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018428bf217c-1d8bfe9b-64e0-4dd6-b138-725eb92ea9cf-00%40eu-central-1.amazonses.com.


Re: [Django] #32319: Add support to HashedFilesMixin for ES modules

2022-10-30 Thread Django
#32319: Add support to HashedFilesMixin for ES modules
-+
 Reporter:  gilmrjc  |Owner:  gilmrjc
 Type:  New feature  |   Status:  new
Component:  contrib.staticfiles  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by blighj):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184284cda85-f376392c-81d3-4342-a144-13eff09347e2-00%40eu-central-1.amazonses.com.


Re: [Django] #34094: RTL alignment is off in admin header area

2022-10-30 Thread Django
#34094: RTL alignment is off in admin header area
-+-
 Reporter:  Thibaud Colas|Owner:  Francesco
 |  Panico
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  rtl  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Francesco Panico):

 * cc: Francesco Panico (added)
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/16240 PR]

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184283cf50e-d8a88b37-d0bd-4d19-b522-24ad3a352d79-00%40eu-central-1.amazonses.com.