Re: [Django] #23626: Change coding style for sql, params return lines

2014-11-16 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  aniav
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:  wontfix
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:  afraid-to-commit |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-
Changes (by mjtamlyn):

 * status:  assigned => closed
 * resolution:   => wontfix


Comment:

 I am inclined to agree. Thanks for doing the detailed research.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.7fc738813f7f6aaae9e2e87c36d88a04%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-11-15 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  aniav
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:  afraid-to-commit |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-

Comment (by aniav):

 There are quite a lot places where `%s` is used in ORM string manipulation
 and I am not quite sure that changing to format is a good idea. It's
 actually not helping much with readability especially in base SQL strings
 defined in `db/backend/schema.py`. Curly braces are also used in T-SQL for
 escaping Date, Time and Timestamp, and in PostgreSQL for supplying Array
 values - this wouldn't make the issue an easy picking one IMO.
 I am not really sure if changing that would have any positive outcome. I
 would just abandon the idea.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.11e1c4903c19607310bf60ca48afcbba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-11-15 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  aniav
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:  afraid-to-commit |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-
Changes (by aniav):

 * owner:  pavel-shpilev => aniav


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ff6ddfbed8e33a391e6700e63952165a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-14 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  pavel-
 Type:   |  shpilev
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  afraid-to-commit |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  1|
-+-
Changes (by pavel-shpilev):

 * owner:  nobody => pavel-shpilev
 * 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.d2a7d1db9464a2a4d7b46bc19d56bdc0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-13 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:  afraid-to-commit |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-
Changes (by EvilDMP):

 * keywords:   => afraid-to-commit


Comment:

 I've marked this ticket as especially suitable for people following the
 ​[https://dont-be-afraid-to-commit.readthedocs.org Don't be afraid to
 commit tutorial] at the [http://python.ie/pycon/2014 PyCon Ireland 2014
 sprints]. If you're tackling this ticket, please don't hesitate to ask me
 for guidance if you'd like any, either here or on the Django IRC channels,
 where I can be found as ''EvilDMP''.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.be1ae9d8190af9caf3f592eefc9038b4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-12 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-
Changes (by AmiZya):

 * cc: amizya@… (added)


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e4710926de9012cfb305306a26d653a1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-11 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-

Comment (by AmiZya):

 @mjtamlyn should I create a new ticket for the formatting part in the ORM
 ?

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.02225b26c23be3ddbeb03dd0d507f05e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-11 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-

Comment (by mjtamlyn):

 This ticket was opened two days ago and there are no commits along those
 lines I can see. For example I mean places like:
 
https://github.com/django/django/blob/bc46e4d4fa61eead13fe58048ae646f07d632e4f/django/db/models/lookups.py#L149-L154
 
https://github.com/django/django/blob/92a17eaae081a213171b044858d6fc29df2df733/django/contrib/postgres/fields/array.py#L167-L172

 There aren't that many, and several are clearer to read than the examples
 in that PR. The docs however suggest the current style used. It may be
 worth looking more generally at string manipulation in the ORM and using
 `.format()` instead of `%s` notation.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5a81c63b7a99dd20cbc8bbd1c09b389d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-11 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-

Comment (by jpadilla):

 This seems to be already taken care of, pretty sure it can be closed.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.c52cbf2f1fba2ccb4df80c2ce131fcb5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23626: Change coding style for sql, params return lines

2014-10-09 Thread Django
#23626: Change coding style for sql, params return lines
-+-
 Reporter:  mjtamlyn |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  1|
-+-
Changes (by collinanderson):

 * easy:  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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.34aca0d1890247ea446a8990383d6132%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23626: Change coding style for sql, params return lines

2014-10-09 Thread Django
#23626: Change coding style for sql, params return lines
-+-
   Reporter:  mjtamlyn   |  Owner:  nobody
   Type: | Status:  new
  Cleanup/optimization   |Version:  master
  Component:  Database   |   Keywords:
  layer (models, ORM)|  Has patch:  0
   Severity:  Normal |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
 The current style can be quite confusing: {{{return '%s @> %s' % (lhs,
 rhs), params}}}

 This is much clearer:
 {{{
 sql =  '{} @> {}'.format(lhs, rhs)
 params = lhs_params + rhs_params
 return sql, params
 }}}

 We should do this everywhere in the ORM or not at all.

 (Originally brought up by Aymeric on
 https://github.com/django/django/pull/3219)

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.0d8c9d12b38a1330bc7309a109242834%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.