Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2018-08-22 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
--+
 Reporter:  Simon Willison|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (System checks)  |  Version:  1.9
 Severity:  Normal|   Resolution:  fixed
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"586a9dc4295357de1f5ad0590ad34bf2bc008f79" 586a9dc4]:
 {{{
 #!CommitTicketReference repository=""
 revision="586a9dc4295357de1f5ad0590ad34bf2bc008f79"
 Fixed #26352 -- Made system check allow ManyToManyField to target the same
 model if through_fields differs.
 }}}

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2018-07-18 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
--+
 Reporter:  Simon Willison|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  1.9
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Simon Willison):

 I've opened a new pull request that applies this change against the latest
 master of Django 2.x

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-10-14 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
--+
 Reporter:  Simon Willison|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  1.9
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1
 * component:  Database layer (models, ORM) => Core (System checks)
 * stage:  Unreviewed => Accepted


Comment:

 Does the original pull request solve it? If so, feel free to update and
 resend it.

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-10-13 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  Simon Willison   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 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 Raymond Penners):

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


Comment:

 This ticket got closed because of a missing use case. For what it is
 worth, our "real world use case" is the following:

 {{{#!python
 class ShippingMethod(models.Model):
 
 to_countries = models.ManyToManyField(
 Country, through='carriers.ShippingMethodPrice',
 through_fields=('method', 'to_country'))

 # This is the 2nd ManyToManyField causing E003:
 #
 # from_countries = models.ManyToManyField(
 # Country, through='carriers.ShippingMethodPrice',
 # through_fields=('method', 'from_country'), related_name='+')


 class ShippingMethodPrice(models.Model):
 ...
 method = models.ForeignKey(
 ShippingMethod,
 related_name='prices'
 )
 to_country = models.ForeignKey(Country)
 from_country = models.ForeignKey(Country, related_name='+')
 price = models.DecimalField()

 }}}

 So, basically, we have list of shipping methods, and each shipping method
 has a price list, containing a specific price per from/to-country
 combination.
 Given a method, `method.from_countries` should represent the set of all
 countries that are occur in the price list as a from-country.

 I do not think the workaround suggested in
 https://code.djangoproject.com/ticket/26352#comment:2 works for us, as our
 case involves 3 models.

 The hack to disable E003 seems to work, though a real fix (or suggestions
 how to receive the same result otherwise) would be appreciated.

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-03-21 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  simonw   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  wontfix
 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 timgraham):

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


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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-03-15 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  simonw   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 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
-+-

Comment (by timgraham):

 In absence of a reported use case, I don't mind closing the issue for now.

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-03-14 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  simonw   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 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
-+-

Comment (by charettes):

 The only use-case I can think of right now is working around limitations
 of reverse relationships (#897 seems to mention this exact workaround).

 If we ever unify the reverse relationships API by exposing them as normal
 fields I think an explicit way of defining them would be necessary (to
 define options such as `verbose_name`).

 In the meantime I'm not sure about what should be done here as I vaguely
 remember relying on a similar field definition in the past and it
 definitely worked in Django 1.2. On the other hand I wouldn't be surprised
 if it breaks Django in subtle ways as it seems untested (migrations come
 to mind here).

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-03-14 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  simonw   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 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
-+-

Comment (by simonw):

 As Simon Charette pointed out in a comment on the pull request, this may
 not be necessary. In the above example the same effect can be achieved
 using the related_name property, like this:

 {{{#!python
 class User(models.Model):
 friends = models.ManyToManyField(
 'self', through='Followship', symmetrical=False,
 through_fields=('user', 'target'),
 related_name='followers'
 )
 }}}

 In which case, is there a real world use-case in which it's useful to be
 able to specify multiple ManyToManyFields in the way proposed by this
 ticket?

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


Re: [Django] #26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self that differ by through_fields

2016-03-14 Thread Django
#26352: models.E003 check incorrectly prevents duplicate ManyToMany through-self
that differ by through_fields
-+-
 Reporter:  simonw   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 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 simonw):

 * has_patch:  0 => 1


Comment:

 I've posted a pull request with a potential fix to Github:
 https://github.com/django/django/pull/6295

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