Re: [Django] #31221: HStoreField returns str instead of dict during tests

2020-01-31 Thread Django
#31221: HStoreField returns str instead of dict during tests
+--
 Reporter:  Michael Mulholland  |Owner:  (none)
 Type:  Uncategorized   |   Status:  new
Component:  contrib.postgres|  Version:  2.2
 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
+--

Comment (by Michael Mulholland):

 Replying to [comment:1 Simon Charette]:
 > Did you make sure to add `django.contrib.postgres` to your
 `INSTALLED_APPS`
 [https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#hstorefield
 as documented]?

 Yes, that was already in the installed apps when I encountered the
 problem.

 When I debug the test program, it does appear to be running
 register_type_handlers as expected during database setup. It also seems to
 be performing the deserialization to a python dict when the fixtures are
 loaded (using to_python). I'm not sure what it's doing with the models
 after that though, since there's nothing in the test db during testing,
 and accessing model instance values from the queryset gives the hstore
 formatted strings.
 So the test data I gave above turns into: {{{[(4, 'First', ''), (5,
 'Second', '"details"=>"this one isn\'t blank"')]}}}

-- 
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/070.ca45de990d4482547e8c72c4d3d6601f%40djangoproject.com.


Re: [Django] #31220: Widgets ignores "cols" attribute.

2020-01-31 Thread Django
#31220: Widgets  ignores "cols" attribute.
+--
 Reporter:  david html  |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  3.0
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  widgets | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by david html):

 Replying to [comment:3 felixxm]:
 > You can just use `forms.Textarea` instead of `AdminMarkdownxWidget`.

 Thank you, much appreciated. I can confirm that it was an issue with the
 external package

-- 
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/066.a49241dc516f7484e164067e90c6af05%40djangoproject.com.


Re: [Django] #31221: HStoreField returns str instead of dict during tests

2020-01-31 Thread Django
#31221: HStoreField returns str instead of dict during tests
+--
 Reporter:  Michael Mulholland  |Owner:  (none)
 Type:  Uncategorized   |   Status:  new
Component:  contrib.postgres|  Version:  2.2
 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
+--

Comment (by Simon Charette):

 Did you make sure to add `django.contrib.postgres` to your
 `INSTALLED_APPS`
 [https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#hstorefield
 as documented]?

 The latter is in charge of
 
[https://github.com/django/django/blob/b9cf764be62e77b4777b3a75ec256f6209a57671/django/contrib/postgres/apps.py#L11-L28
 connecting a signal receiver] that
 
[https://github.com/django/django/blob/b9cf764be62e77b4777b3a75ec256f6209a57671/django/contrib/postgres/signals.py#L37-L43
 registers] the necessary `psycopg2` adapters on connection creation.

 If that's the origin of your issue I suggest we re-purpose this ticket to
 add system checks to all `django.contrib.postgres.fields` that errors when
 a field is used but `self.model._meta.apps.get('postgres')` is missing.

-- 
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/070.c77ad471b2a591a3867dee559a942480%40djangoproject.com.


Re: [Django] #31220: Widgets ignores "cols" attribute.

2020-01-31 Thread Django
#31220: Widgets  ignores "cols" attribute.
+--
 Reporter:  david html  |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  3.0
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  widgets | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by felixxm):

 You can just use `forms.Textarea` instead of `AdminMarkdownxWidget`.

-- 
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/066.e8ea36b92148aec2d3a492af79844c07%40djangoproject.com.


Re: [Django] #30943: Add support for bloom indexes.

2020-01-31 Thread Django
#30943: Add support for bloom indexes.
-+-
 Reporter:  Nick Pope|Owner:  Nick Pope
 Type:  New feature  |   Status:  closed
Component:  contrib.postgres |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  bloom, index,| Triage Stage:  Ready for
  postgres, db-indexes   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"a260001a2d3b2d9a7e872c24295e793bdbd10698" a260001a]:
 {{{
 #!CommitTicketReference repository=""
 revision="a260001a2d3b2d9a7e872c24295e793bdbd10698"
 Refs #30943 -- Fixed postgres_tests on PostgreSQL 9.5.

 Bloom extension is available on PostgreSQL 9.6+.
 }}}

-- 
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/065.b7f800e3dae328762fb137858c29f80c%40djangoproject.com.


Re: [Django] #31220: Widgets ignores "cols" attribute.

2020-01-31 Thread Django
#31220: Widgets  ignores "cols" attribute.
+--
 Reporter:  david html  |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  3.0
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  widgets | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by david html):

 Replying to [comment:1 felixxm]:
 > It works with builtin widgets e.g. `forms.Textarea`, so it's not an
 issue in Django but in 3rd party packages.
 thanks for your fast reply.
 could you please tell me how to test this e.g. without using the
 AdminMarkdownxWidget ? I mean replacing the admin TextField attributes. I
 did search in the manual but there is no example with cols. Also I am not
 looking to rewrite any css of the admin or using this in Django forms.
 Just to change it in the admin. I did try removing the widget
 AdminMarkdownx and it still doesn't resize.

-- 
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/066.94aced6bc9f3dd1d4d3507123a74f3fd%40djangoproject.com.


[Django] #31221: HStoreField returns str instead of dict during tests

2020-01-31 Thread Django
#31221: HStoreField returns str instead of dict during tests
--+
   Reporter:  Michael Mulholland  |  Owner:  (none)
   Type:  Uncategorized   | Status:  new
  Component:  contrib.postgres|Version:  2.2
   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   |
--+
 It appears that while running tests on my app, the behavior of HStoreField
 is not consistent. The TestCase I am trying to run is to test a script
 (which normally runs fine as a management command) that crashes upon
 trying to use metadata in an HStoreField. Model instances for testing are
 loaded from a fixture.

 While debugging the test, I've found that accessing an HStoreField on a
 model instance will return a str type instead of the expected dict. What's
 stranger is that this doesn't occur when the test database already exists
 and --keepdb is used (the first run with --keepdb will fail, but the
 second doesn't). This leads me to believe that the way fixtures are loaded
 during testing is breaking HStoreField's to_python conversion or
 something.

 I found a similar issue #25454, where the same problem was solved, but it
 looks like the problem is either occurring under different circumstances
 or has been reintroduced.

 My test runner is from this gist, where the test db is created with hstore
 extension installed:
 [https://gist.github.com/smcoll/bb2533e4b53ae570e11eb2ab011b887b]

 Currently my knowledge of the django code base isn't extensive enough to
 suggest a fix, but I have been able to reproduce this problem with the
 following models/tests:

 {{{
 # models.py
 class MyModel(models.Model):
 name = models.CharField(max_length=66)
 metadata = HStoreField(blank=True)
 }}}

 {{{
 # tests.py
 class TestMyApp(TestCase):
 fixtures = ['i_myapp']
 def test_mymodel(self):
 for mymodel_instance in MyModel.objects.all():
 self.assertEqual(type(mymodel_instance.metadata), dict)
 }}}

 {{{
 # i_myapp.json
 [
 {
 "model": "myapp.mymodel",
 "pk": 4,
 "fields": {
 "name": "First",
 "metadata": "{}"
 }
 },
 {
 "model": "myapp.mymodel",
 "pk": 5,
 "fields": {
 "name": "Second",
 "metadata": "{\"details\": \"this one isn't blank\"}"
 }
 }
 ]
 }}}

 The test test_mymodel fails with:
 {{{
 AssertionError:  != 
 }}}

-- 
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/055.d899cd90b69af1435611e11dfe4abf33%40djangoproject.com.


Re: [Django] #11927: Allow manage.py dumpdata to dump YAML in block style

2020-01-31 Thread Django
#11927: Allow manage.py dumpdata to dump YAML in block style
-+-
 Reporter:  sampablokuper|Owner:  Matthijs
 |  Kooijman
 Type:  New feature  |   Status:  assigned
Component:  Core (Management |  Version:  master
  commands)  |
 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 Florian Demmer):

 * cc: Florian Demmer (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/071.675bce007d644d54b64c6507fa78341d%40djangoproject.com.


Re: [Django] #31207: ForeignObject.to_fields is allowed to point to non-local remote fields.

2020-01-31 Thread Django
#31207: ForeignObject.to_fields is allowed to point to non-local remote fields.
-+-
 Reporter:  un.def   |Owner:  Hasan
 |  Ramezani
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  3.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

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


Comment:

 Fixed by [a97111eabf39e50625d7a8acc6cd46f4c5dad0da]

-- 
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/064.71da42187c4cf54e68fa51d9e97d3412%40djangoproject.com.


Re: [Django] #27604: Use set_signed_cookie for contrib.messages Cookie storage

2020-01-31 Thread Django
#27604: Use set_signed_cookie for contrib.messages Cookie storage
-+-
 Reporter:  Anthony King |Owner:  Craig
 Type:   |  Anderson
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.messages |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * needs_better_patch:  1 => 0


Comment:

 I created a [https://github.com/django/django/pull/12397 new PR] where the
 storage is using the `Signer` sign and unsign methods.

 About using `set_signed_cookie`, I don't think it makes sense, because
 `CookieStorage` has to calculate the length of the signed encoded messages
 before setting the cookie value. So when we are setting the real cookie
 value, we already have the signed value at hand. Using `set_signed_cookie`
 instead of `set_cookie` would simply re-compute needlessly the messages,
 and would also need refetching a new signer when we have already one at
 hand (as we need it for the length stuff).

-- 
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/067.74945d846b36908301753173ca7f2c74%40djangoproject.com.


Re: [Django] #22426: Django >= 1.6.0 can't handle old style messages cookie

2020-01-31 Thread Django
#22426: Django >= 1.6.0 can't handle old style messages cookie
-+-
 Reporter:  iivvoo   |Owner:  ofirov
 Type:  Bug  |   Status:  closed
Component:  contrib.messages |  Version:  1.6
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  messages, cookie,| Triage Stage:  Accepted
  1.4|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"e7d62e97eb40ab441778d1dff9885b5d892d0f80" e7d62e97]:
 {{{
 #!CommitTicketReference repository=""
 revision="e7d62e97eb40ab441778d1dff9885b5d892d0f80"
 Refs #22426 -- Removed pre-Django 1.5 messages compatibility code and
 test.

 This reverts commit f286721f7fdc2202f77a5f4d650d9d0779b86811.
 }}}

-- 
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/064.b7e4e6c840fd0bc2b761c06c27eb7bcf%40djangoproject.com.


Re: [Django] #30032: Allow expressions to be used for default

2020-01-31 Thread Django
#30032: Allow expressions to be used for default
-+-
 Reporter:  Gavin Wahl   |Owner:  Johannes
 |  Hoppe
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Johannes Hoppe):

 * needs_docs:  1 => 0
 * 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 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/067.55388c27374b539d1d4b65b0d401b080%40djangoproject.com.


Re: [Django] #31219: Raising error about protected related objects can crash.

2020-01-31 Thread Django
#31219: Raising error about protected related objects can crash.
-+-
 Reporter:  Matthias Kestenholz  |Owner:  Matthias
 |  Kestenholz
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

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


Comment:

 In [changeset:"4e8d89020cca87fcf484eb6b6b514b4c9bfa592f" 4e8d8902]:
 {{{
 #!CommitTicketReference repository=""
 revision="4e8d89020cca87fcf484eb6b6b514b4c9bfa592f"
 Fixed #31219 -- Fixed object deletion crash for nested protected related
 objects.
 }}}

-- 
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/067.56dc57e02323b00a77b4b6dd8d16d895%40djangoproject.com.