Re: [Django] #22531: Q objects lack a useful repr

2014-05-16 Thread Django
#22531: Q objects lack a useful repr
-+-
 Reporter:  Keryn Knight |Owner:  nobody
   |   Status:  closed
 Type:  New feature  |  Version:  master
Component:  Database layer   |   Resolution:  fixed
  (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:  0|
-+-
Changes (by Tim Graham ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"393ddc10a78354b573b9e746247df013f7bd6151"]:
 {{{
 #!CommitTicketReference repository=""
 revision="393ddc10a78354b573b9e746247df013f7bd6151"
 Fixed #22531 -- Added tree.Node.__repr__ and tests for the class.

 While Node class has a useful `__str__`, its `__repr__` is not that
 useful. Added a `__repr__` that makes use of the current `__str__`.
 This is especially useful since the more popular `Q` class inherits
 `tree.Node`. Also created new tests that cover most of `Node` class
 functionality.
 }}}

-- 
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/095.aa95b6761520cc69695fcd2227406621%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #22531: Q objects lack a useful repr

2014-05-03 Thread Django
#22531: Q objects lack a useful repr
-+-
 Reporter:  Keryn Knight |Owner:  nobody
   |   Status:  new
 Type:  New feature  |  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:  0|
-+-

Comment (by mardini):

 PR: https://github.com/django/django/pull/2628

-- 
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/095.39b13fe167e053628f3c23953bbfcbaa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #22531: Q objects lack a useful repr

2014-04-28 Thread Django
#22531: Q objects lack a useful repr
-+-
 Reporter:  Keryn Knight |Owner:  nobody
   |   Status:  new
 Type:  New feature  |  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:  0|
-+-
Changes (by timo):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


-- 
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/095.214a707a28e4861fc6584d024f35e76c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #22531: Q objects lack a useful repr

2014-04-28 Thread Django
#22531: Q objects lack a useful repr
--+
 Reporter:  Keryn Knight    |  Owner:  nobody
 Type:  New feature   | Status:  new
Component:  Database layer (models, ORM)  |Version:  master
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 {{{
 >>> from django.db.models.query_utils import Q
 >>> a = Q()
 >>> b = Q(a=1, b=2)
 >>> c = b & Q(c=3)
 >>> d = c | Q(d=4)
 >>> e = Q(d) & Q(e=5)
 >>> f = e | ~Q(f=6)
 >>> repr(f)  # actually just typing f into ipython/pdb/python REPL
 ''
 }}}
 That's not exactly useful, given a Q object may represent a complex tree.
 As it turns out, Q objects '''do''' implement str, which is the SQL output
 for the Node subclass, which would be more useful than the above repr, and
 possibly more useful than the nested repr of .children

 The simplest repr implementation would probably be something like:

 {{{
 def __repr__(self):
 return '{obj.__class__!r} {obj!s}'.format(obj=self)
 }}}

-- 
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/080.e634bd1e2cc4d76116351911c441ff98%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.