Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2022-08-21 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  François
 |  Granade
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by François Granade):

 * owner:  (none) => François Granade
 * 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/01070182c17c5c26-04dcf9b6-21e3-45a2-b9c5-5bfc67925362-00%40eu-central-1.amazonses.com.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2022-08-21 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by François Granade):

 Proposing 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/01070182c17c44c9-689baf75-798e-463d-84d3-abca2614702c-00%40eu-central-1.amazonses.com.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2022-08-10 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by François Granade):

 I got badly bitten by this bug in #33912, and I think that there are two
 issues, related but not the same, here -

 1) the current behavior (validating against the default database for
 object that live in another database) does not make sense
 2) it should be be possible to define against what DB the validation
 happens.

 To me, the first issue is a very serious bug, and the second a useful
 feature.

 What about fixing the first one first ? For that, the patch 15130.2.diff
 above would work.

 What would be needed for this patch to be accepted ? I can clean it up

-- 
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/0107018287cd4273-2dc0e85b-5e36-4928-b091-02743ebc3899-00%40eu-central-1.amazonses.com.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2020-08-20 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Menno Manheim):

 * cc: Menno Manheim (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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.d073318762ad9f105e0457e8fd904ef5%40djangoproject.com.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2019-03-20 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlos Palol):

 * cc: Carlos Palol (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/061.e7d9c87b730897031396ef86fea09e23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2016-12-01 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | 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 Charette):

 Replying to [comment:19 Michel Perez]:
 > Is this already fixed?, I'm still having this problem using
 Django==1.10.3 and Python 3.5

 This has not been fixed yet.

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2016-12-01 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  Tetsuya Morimoto |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Michel Perez):

 Is this already fixed?, I'm still having this problem using Django==1.10.3
 and Python 3.5

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-10-29 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 As an addition - maybe we don't even want the complete solution. Because
 if we add using to model.validate(), we kind of have to add it to
 `ModelForm.is_clean()`, too. And then we have to decide what we do with
 `ModelChoiceField(Author.objects.all())`, shouldn't it use the specified
 database for validation, too?

 But it seems usages where you need to validate the same model against
 multiple databases really aren't that common. So, how much effort should
 we spend on fixing this, instead of for example trying to add composite
 foreign key support?

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-10-29 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 Yes, that would be a step in the right direction. But using the write
 router is just a guess. There is an explicit way to tell which database to
 use when saving, so there should also be an explicit way to tell Django
 which database to use when validating.

 The solution I see as the right one is:
 {{{
   1) Use explicitly given database for validation
   2) Use write router's database for validation
   3) Use the default database for validation
 }}}

 And currently, if I'm not mistake, we have this:
 {{{
   1) Use read router's database for validation
   2) Use the default database for validation
 (here 2 is actually implemented by the router for reading)
 }}}

 So, just changing Django to use write router instead of read router as
 done in the attached patch would be an improvement, but not a complete
 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 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/061.97d748a3749d79cb4e3b213d48b63776%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-10-28 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 Did you see the solution proposed in attachment:15130.2.diff? That seems
 on the right track to me. I don't see why the programmer should have to
 specify the database when we already have database routers to figure out
 where the model will be saved?

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-10-27 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 Hmmh, I think the core problem is that .validate() doesn't take a using
 argument, while some of the checks are dependent on the used database. I
 don't think we can fix this without adding the using argument.

 If we do that, then ModelForms should likely also have
 .is_valid(using=...) keyword argument. The next question is should the
 using argument be used for ModelChoiceField queryset checks, too? I say
 yes, with the exception that if the queryset has an explicit using
 argument, then honor that.

 We can start with adding using argument to .validate() only, and then
 continue to further changes if wanted.

 Any opinions if we should go forward with this?

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-10-06 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 #25514 is another duplicate.

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2015-07-29 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
 Reporter:  t2y  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  multi-db | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 #20301 is a duplicate.

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


Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-05-20 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
-+-
   Reporter:  t2y|  Owner:
   Type:  Bug| Status:  reopened
  Milestone:  1.3|  Component:  Database layer
Version:  1.2|  (models, ORM)
 Resolution: |   Severity:  Normal
   Triage Stage:  Accepted   |   Keywords:  multi-db
Needs documentation:  0  |  Has patch:  1
Patch needs improvement:  1  |Needs tests:  0
 |  Easy pickings:  0
-+-
Changes (by ramiro):

 * component:  ORM aggregation => Database layer (models, ORM)
 * easy:   => 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-03-10 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
---+
   Reporter:  t2y  |Owner:
 Status:  reopened |Milestone:  1.3
  Component:  ORM aggregation  |  Version:  1.2
 Resolution:   | Keywords:  multi-db
   Triage Stage:  Accepted |Has patch:  1
Needs documentation:  0|  Needs tests:  0
Patch needs improvement:  1|
---+
Changes (by bberes):

 * cc: botondus@… (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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-31 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
---+
   Reporter:  t2y  | Owner:  
 Status:  reopened | Milestone:  1.3 
  Component:  ORM aggregation  |   Version:  1.2 
 Resolution:   |  Keywords:  multi-db
   Triage Stage:  Accepted | Has patch:  1   
Needs documentation:  0|   Needs tests:  0   
Patch needs improvement:  1|  
---+

Comment (by ramiro):

 `15130.3-tests.diff` contains new more granular tests (new model for
 tests, separated the unique_for_{date,month,year} tests). It runs ten new
 tests; five of them by saving first an instance to the 'default' database
 and then trying to save an identical instance to the 'other' DB, and the
 other five in the inverse order.

 Theoretically all of them should fail before applying a fix for this
 ticket, but only the five tests with the 'default', 'other' order do.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-30 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
---+
   Reporter:  t2y  | Owner:  
 Status:  reopened | Milestone:  1.3 
  Component:  ORM aggregation  |   Version:  1.2 
 Resolution:   |  Keywords:  multi-db
   Triage Stage:  Accepted | Has patch:  1   
Needs documentation:  0|   Needs tests:  0   
Patch needs improvement:  1|  
---+
Changes (by ramiro):

  * needs_better_patch:  0 => 1


Comment:

 Russell suggested to avoid modifying `._state.db` so test were changed so
 the fist model is saved to the 'other' DB and the second one to the
 'default' DB:

 {{{
 #!python
 class MultiDbUniqueTests(TestCase):
 multi_db = True

 def test_unique_multi_db_isolation(self):
 "Attempt to save two model instances that don't pass Field.unique
 checks to different DBs."
 UniqueFieldsModel(unique_charfield='Hello world',
 unique_integerfield=42, non_unique_field=3).save(using='other')
 b = UniqueFieldsModel(unique_charfield='Hello world',
 unique_integerfield=42, non_unique_field=3)
 try:
 b.full_clean()
 except ValidationError:
 self.fail("unique field validation shouldn't erroneosuly
 trigger when the identical model instances are on different databases.")
 else:
 b.save()
 self.assertEqual(UniqueFieldsModel.objects.using('default').count(), 1)
 self.assertEqual(UniqueFieldsModel.objects.using('other').count(), 1)

 def test_unique_together_multi_db_isolation(self):
 "Attempt to save two model instances that don't pass
 Meta.unique_together checks to different DBs."
 UniqueTogetherModel(cfield='Hello world', ifield=42,
 efield='u...@example.org').save(using='other')
 b = UniqueTogetherModel(cfield='Hello world', ifield=42,
 efield='u...@example.org')
 try:
 b.full_clean()
 except ValidationError:
 self.fail("Meta.unique_together validation shouldn't
 erroneosuly trigger when the identical model instances are on different
 databases.")
 else:
 b.save()
 self.assertEqual(UniqueTogetherModel.objects.using('default').count(), 1)
 self.assertEqual(UniqueTogetherModel.objects.using('other').count(), 1)

 def test_unique_for_x_multi_db_isolation(self):
 "Attempt to save two model instances that don't pass
 Field.unique_for checks to different DBs."
 today = datetime.date.today()
 now = datetime.datetime.now()
 UniqueForDateModel(start_date=today, end_date=now, count=314,
 order=21, name='Foo').save(using='other')
 b = UniqueForDateModel(start_date=today, end_date=now, count=314,
 order=21, name='Foo')
 try:
 b.full_clean()
 except ValidationError:
 self.fail("Meta.unique_for_* validation shouldn't erroneosuly
 trigger when the identical model instances are on different databases.")
 else:
 b.save()
 self.assertEqual(UniqueForDateModel.objects.using('default').count(), 1)
 self.assertEqual(UniqueForDateModel.objects.using('other').count(), 1)
 }}}

 Problem is: In this case these tests don't fail if the changes to
 `django/db/models/base.py` are undone.

 So it seems there is some deeper problem 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-25 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  reopened | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  0   
Needs_better_patch:  0|  
--+-
Comment (by t2y):

 Replying to [comment:9 ramiro]:

 I tested my application(AdminSite) which found this problem originally
 after it applied Alex's patch. It's OK. Thank you Alex.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-25 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  reopened | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  0   
Needs_better_patch:  0|  
--+-
Changes (by ramiro):

  * needs_tests:  1 => 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-25 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  reopened | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Comment (by ramiro):

 Thanks for showing my tests were wrong. I didn't take in account
 Model.save() doesn't do validation by default.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-23 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  reopened | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Changes (by t2y):

  * 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-23 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  reopened | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  0   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Changes (by t2y):

  * status:  closed => reopened
  * has_patch:  1 => 0
  * resolution:  worksforme =>

Comment:

 Hi ramiro, thank you for reviewing and making tests code.
 Though my explanation was not good, this problem occur only when a
 Model.validate_unique method is called. So, I fixed your test code to call
 validate_unique method. By running my test code, you can see
 ValidationError.

 I think what the save method was successed makes you wonder. The reason
 why the save mehtod is considered with "using" parameter for multi-db.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15130: Model.validate_unique method doesn't take in account multi-db

2011-01-21 Thread Django
#15130: Model.validate_unique method doesn't take in account multi-db
--+-
  Reporter:  t2y  | Owner:  
Status:  closed   | Milestone:  1.3 
 Component:  ORM aggregation  |   Version:  1.2 
Resolution:  worksforme   |  Keywords:  multi-db
 Stage:  Accepted | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Changes (by ramiro):

  * status:  new => closed
  * resolution:  => worksforme
  * summary:  Model.validate_unique method is not considered with multi-db
  => Model.validate_unique method doesn't take in
  account multi-db

Comment:

 I've added tests (against trunk) that exercise the `unique` and
 `unique_for_(date,month,year)` field options plus the
 `Meta.unique_together` option by saving identical model instances to
 different databases. Saving is successful so I can't reproduce this at the
 ORM level.

 I'm going to close this ticket as ''works for me''. If you can describe
 better your use case (bonus points if they are a modification to the
 attached tests) your scenario, please reopen. I suspect this might be a
 problem in another part of the stack (admin app?) instead, or maybe I
 forgot to test some condition?.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.