Re: [Django] #25889: Organize tests in tests/queries

2017-01-29 Thread Django
#25889: Organize tests in tests/queries
-+-
 Reporter:  Claude Paroz |Owner:  reficul31
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Testing framework|  Version:  master
 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 reficul31):

 After cleaning most of the method names and adding some context in
 comments. There are some methods that have multiple tests. Eg.
 test_ticketno_1 then we have test_ticketno_2. What should be done with
 such tests. We could group them into a single class maybe and provide some
 additional information in the comments? Or we could have like
 test_context_of_test_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/065.c6f983e4abace278da61f096cffa7b71%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2

2017-01-29 Thread Django
#25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2
-+
 Reporter:  James Pulec  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:  py2  | 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):

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


Comment:

 Mini-discussion on the DevelopersMailingList:
 https://groups.google.com/d/msgid/django-developers/e984d61f-45bc-4620
 -a10f-91bf1113979c%40googlegroups.com

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


Re: [Django] #25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2

2017-01-29 Thread Django
#25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2
-+---
 Reporter:  James Pulec  |Owner:  Shai Berger
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:  py2  | 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):

 * status:  new => assigned
 * owner:  nobody => Shai Berger


Comment:

 [https://github.com/django/django/pull/7985 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 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/064.66051e8c33f214b5b2c42d6116092d07%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2

2017-01-29 Thread Django
#25192: Can't Squash Migration that uses migrations.RunPython.noop in Python 2
-+---
 Reporter:  James Pulec  |Owner:  Shai Berger
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:  py2  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---
Changes (by Shai Berger):

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


[Django] #27791: update_or_create() doesn't work properly when model has auto_now=True

2017-01-29 Thread Django
#27791: update_or_create() doesn't work properly when model has auto_now=True
-+-
   Reporter:  Andrew |  Owner:  nobody
  Chiw   |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  1.10
  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'm writing an exchange rate app:

 models.py
 {{{
 from django.db import models


 class ExchangeRate(models.Model):
 base = models.CharField(max_length=3)
 target = models.CharField(max_length=3)
 rate = models.DecimalField(max_digits=17, decimal_places=8)
 date = models.DateField(auto_now=True)

 def __str__(self):
 return "{}->{} on {}".format(self.base, self.target,
 str(self.date))

 class Meta:
 unique_together = (("base", "target", "date"),)

 }}}

 fx.py
 {{{
 from datetime import datetime, date
 import requests

 from .models import ExchangeRate


 def get_eur_rates():
 url = 'http://api.fixer.io/latest'
 eur_rates = requests.get(url).json()
 print(eur_rates)
 for target in eur_rates["rates"]:
 import ipdb; ipdb.set_trace()
 ExchangeRate.objects.update_or_create(base="EUR", target=target,
 date=eur_rates["date"], defaults={"rate": eur_rates["rates"][target]})
 print(ExchangeRate.objects.all())
 }}}

 I already have ExchangeRate objects in the database from 2017-01-29.
 Now, when I want to run update_or_create() with date='2017-01-27', it
 fails:

 {{{
 ipdb> ExchangeRate.objects.update_or_create(base="EUR", target=target,
 date='2017-01-27', defaults={"rate": eur_rates["
 rates"][target]})
 *** django.db.utils.IntegrityError: duplicate key value violates unique
 constraint "fx_exchangerate_base_f6916782_uniq"
 DETAIL:  Key (base, target, date)=(EUR, CZK, 2017-01-29) already exists.
 }}}

 I'm sure Django is working internally in a way that might result in this
 error, but this shouldn't happen and the error message is confusing.

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


[Django] #27792: Extended category support for Atom and RSS feeds

2017-01-29 Thread Django
#27792: Extended category support for Atom and RSS feeds
-+-
   Reporter:  Pavlo  |  Owner:  nobody
  Kapyshin   |
   Type:  New| Status:  new
  feature|
  Component: |Version:  1.10
  contrib.syndication|
   Severity:  Normal |   Keywords:  feedgenerator
   Triage Stage: |  Has patch:  1
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I’m working on category (label, scheme/domain) attributes support for Atom
 and RSS. I have a patch for Atom
 (https://github.com/PavloKapyshin/django/tree/feeds_category_object), and
 want to ask what's the best way to implement same functionality for RSS
 feeds.

 RSS domain maps fairly well to Atom's scheme.

 Question is: for RSS, should category label be taken from Atom namespace
 (so there'll be an attribute) or just put inside  instead of
 term, if available?

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


Re: [Django] #27792: Extended category support for Atom and RSS feeds

2017-01-29 Thread Django
#27792: Extended category support for Atom and RSS feeds
-+-
 Reporter:  Pavlo Kapyshin   |Owner:  Pavlo
 |  Kapyshin
 Type:  New feature  |   Status:  assigned
Component:  contrib.syndication  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:  feedgenerator| Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Pavlo Kapyshin):

 * owner:  nobody => Pavlo Kapyshin
 * status:  new => assigned


Old description:

> I’m working on category (label, scheme/domain) attributes support for
> Atom and RSS. I have a patch for Atom
> (https://github.com/PavloKapyshin/django/tree/feeds_category_object), and
> want to ask what's the best way to implement same functionality for RSS
> feeds.
>
> RSS domain maps fairly well to Atom's scheme.
>
> Question is: for RSS, should category label be taken from Atom namespace
> (so there'll be an attribute) or just put inside  instead of
> term, if available?

New description:

 I’m working on category (label, scheme/domain) attributes support for Atom
 and RSS. I have a patch for Atom
 (https://github.com/PavloKapyshin/django/tree/feeds_category_object), and
 want to ask what's the best way to implement same functionality for RSS
 feeds.

 RSS domain maps fairly well to Atom's scheme.

 Question is: for RSS, should category label be taken from Atom namespace
 (so there'll be an attribute) or just put inside 
 instead of term, if available?

--

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


Re: [Django] #27792: Extended category support for Atom and RSS feeds

2017-01-29 Thread Django
#27792: Extended category support for Atom and RSS feeds
-+-
 Reporter:  Pavlo Kapyshin   |Owner:  Pavlo
 |  Kapyshin
 Type:  New feature  |   Status:  assigned
Component:  contrib.syndication  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  feedgenerator| Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Pavlo Kapyshin):

 * version:  1.10 => master


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


[Django] #27793: Use the new ipaddress module for IP validation

2017-01-29 Thread Django
#27793: Use the new ipaddress module for IP validation
+
   Reporter:  Claude Paroz  |  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  new
  Component:  Utilities |Version:  master
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 Python 3.4 and up have a new ipaddress module that we could use to replace
 the validation code in IP address validators.
 https://docs.python.org/3/library/ipaddress.html

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


Re: [Django] #27793: Use the new ipaddress module for IP validation

2017-01-29 Thread Django
#27793: Use the new ipaddress module for IP validation
-+-
 Reporter:  Claude Paroz |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Utilities|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

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


Re: [Django] #25643: Allow update() with aggregates and joins via subqueries

2017-01-29 Thread Django
#25643: Allow update() with aggregates and joins via subqueries
-+-
 Reporter:  jorgecarleitao   |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
-+-

Comment (by Mads Jensen):

 1.11 includes `Subquery` (and `OuterRef` that could probably be of use in
 some way) make this something less cumbersome to implement support for.

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


[Django] #27794: Fix confusing error messages for broken `context_processors`

2017-01-29 Thread Django
#27794: Fix confusing error messages for broken `context_processors`
-+-
   Reporter:  Elena  |  Owner:  (none)
  Williams   |
   Type: | Status:  new
  Uncategorized  |
  Component:  Error  |Version:  1.10
  reporting  |   Keywords:  errors,
   Severity:  Normal |  context_processors
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 If there is something broken about one or many items in
 `context_processors` produces the error message:

 {{{
 No module named context_processors
 }}}

 A better error message would say that an item was broken, not that the
 module doesn't exist (it usually does exist).

 Preferably mention which item is broken.

 This is confusing when either `TEMPLATES['OPTIONS']['context_processors']`
 or `TEMPLATE_CONTEXT_PROCESSORS` ''do'' exist. Particularly when upgrading
 or when the `context_processors` list is quite long.


 Can be trivially replicated by starting a new project and adding any
 syntactically correct, but otherwise broken entry to `context_processors`
 list, for example:

 {{{
 TEMPLATES = [
 {
 'BACKEND': 'django.template.backends.django.DjangoTemplates',
 'DIRS': [],
 'APP_DIRS': True,
 'OPTIONS': {
 'context_processors': [
 'broken.context_processors',
 'django.template.context_processors.debug',
 'django.template.context_processors.request',
 'django.contrib.auth.context_processors.auth',
 'django.contrib.messages.context_processors.messages',
 ],
 },
 },
 ]
 }}}

 Examples of this having confused users is discussed:
 http://stackoverflow.com/questions/32828536/django-no-module-named-
 context-processors-error-after-reboot
 http://stackoverflow.com/questions/38772498/importerror-no-module-named-
 context-processors

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


Re: [Django] #27794: Fix confusing error messages for broken `context_processors`

2017-01-29 Thread Django
#27794: Fix confusing error messages for broken `context_processors`
-+-
 Reporter:  Elena Williams   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Error reporting  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:  errors,  | Triage Stage:
  context_processors |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Elena Williams):

 * Attachment "Screenshot from 2017-01-30 13-49-26.png" added.

 Screen capture of ImportError "No module named context_processors" in new
 project.

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


Re: [Django] #23004: Cleanse entries from request.META in debug views

2017-01-29 Thread Django
#23004: Cleanse entries from request.META in debug views
-+
 Reporter:  Daniel Hahler|Owner:  Ryan Castner
 Type:  New feature  |   Status:  assigned
Component:  Error reporting  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Ryan Castner):

 * owner:  nobody => Ryan Castner
 * 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/065.15596aa5c0c5418c87169cddc0e2486e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27777: File object does not consistently open itself in context manager use

2017-01-29 Thread Django
#2: File object does not consistently open itself in context manager use
-+-
 Reporter:  Raphael Gaschignard  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  File |  Version:  1.10
  uploads/storage|
 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
-+-
Changes (by Raphael Gaschignard):

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


Comment:

 Sorry,  I chose the wrong property. Here's two examples of behavior I
 found that didn't make sense to me at first.

 {{{ ContentFile}}} does not properly seek back to 0 on context manager re-
 use.

 {{{
 In [8]: from django.core.files.base import ContentFile

 In [9]: my_file = ContentFile("Hi there")

 In [10]: with my_file as f: print(f.read())
 Hi there

 In [11]: with my_file as f: print(f.read())
 # empty string, no content
 }}}

 for {{{File}}}s that use actual files in their backend, multiple context
 manager usages results in a value error (I/O operation on closed file)

 {{{

 In [12]: from django.core.files.base import File

 In [13]: my_file = File(open('hi.txt'))

 In [14]: with my_file as f: print(f.read())
 ...: with my_file as f: print(f.read())
 ...:
 Hi

 ---
 ValueErrorTraceback (most recent call
 last)
  in ()
   1 with my_file as f: print(f.read())
 > 2 with my_file as f: print(f.read())
   3

 ValueError: I/O operation on closed file.
 }}}

 I figured out that this behaviour *is* consistent with the behavior of
 python's {{{file}}} object. But given that Django's {{{File}}} object
 includes an "idempotent" {{{open}}}, it would seem useful for the context
 manager to call {{{open}}}, so that we open the file and seek back to 0.

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