Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-10-31 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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 Mariusz Felisiak ):

 In [changeset:"17752003a8c115ff79f5f21655f5e9b8b2af67f4" 17752003]:
 {{{
 #!CommitTicketReference repository=""
 revision="17752003a8c115ff79f5f21655f5e9b8b2af67f4"
 Refs #28428 -- Made FileSystemStorage.save() to support pathlib.Path.
 }}}

-- 
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.14c5ac98d01b76d6efe4957839938c29%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-10-31 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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 Mariusz Felisiak ):

 In [changeset:"0f2975534dc6a010a4da28165b235f36bf1df24f" 0f297553]:
 {{{
 #!CommitTicketReference repository=""
 revision="0f2975534dc6a010a4da28165b235f36bf1df24f"
 Refs #28428 -- Added tests for using FileSystemStorage with pathlib.Path.
 }}}

-- 
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.7972042ee5116ee9ac0834559d1621f0%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-10-30 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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 Mariusz Felisiak ):

 In [changeset:"6315a272c5cfcc70b745f87b25148a158663a222" 6315a27]:
 {{{
 #!CommitTicketReference repository=""
 revision="6315a272c5cfcc70b745f87b25148a158663a222"
 Refs #28428 -- Made filepath_to_uri() support pathlib.Path.
 }}}

-- 
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.1b399db7e2c9e1fe443d719291104fb9%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-08-18 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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
--+
Changes (by felixxm):

 * has_patch:  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/061.e9278b77ef26a62c5a6ed13100116578%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-08-18 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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
--+

Comment (by Mariusz Felisiak ):

 In [changeset:"d1c2e6dd04d4ddc8ace17e6abfed16ac46459d1e" d1c2e6dd]:
 {{{
 #!CommitTicketReference repository=""
 revision="d1c2e6dd04d4ddc8ace17e6abfed16ac46459d1e"
 Refs #28428 -- Made FileField.upload_to support pathlib.Path.
 }}}

-- 
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.54e8efb2c2375080a69f23a09b48f30b%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-08-18 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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
--+

Comment (by Mariusz Felisiak ):

 In [changeset:"af69842dbd98e69519f1263eca2619c3165ba13b" af69842d]:
 {{{
 #!CommitTicketReference repository=""
 revision="af69842dbd98e69519f1263eca2619c3165ba13b"
 Refs #28428 -- Added test for a callable FileField.upload_to that returns
 pathlib.Path.
 }}}

-- 
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.a7cd42304e85a5fde0dacfc6daae5198%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2019-08-15 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
--+
 Reporter:  Tom Forbes|Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  File uploads/storage  |  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):

 * has_patch:  0 => 1
 * stage:  Someday/Maybe => Accepted


Comment:

 [https://github.com/django/django/pull/11674 PR].

 It's easier now that Python 3.6 is the minimal version.

-- 
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.91a39ec803472f35a93a472fa577b28d%40djangoproject.com.


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2018-09-06 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+-
 Reporter:  Tom Forbes   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  master
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kyle Agronick):

 Pathlib provides a much nicer object oriented syntax rather than dealing
 with strings. os.path supports pathlib. Django really should too. At the
 very least all you would have to do is cast to a string and everything
 else would work as normal.

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


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2017-10-30 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+-
 Reporter:  Tom Forbes   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  master
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Roger G. Coram):

 As of Python 3.6 (specifically running 3.6.3)
 `django.core.files.storage.Storage.generate_filename` doesn't appear to
 raise this error when passed a `pathlib.Path`. Instead the `os.path.split`
 therein appears to handle it as expected:

 {{{
 Python 3.6.3 (default, Oct  6 2017, 08:44:35)
 >>> import os, pathlib
 >>> os.path.split(pathlib.PosixPath("some/folder/test_with_space.txt"))
 ('some/folder', 'test_with_space.txt')
 }}}

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


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2017-07-24 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+-
 Reporter:  Tom  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  master
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Unreviewed => Someday/Maybe


Comment:

 I'm not sure. I guess I'd have to see a patch to evaluate the idea.

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


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2017-07-22 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+-
 Reporter:  Tom  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  master
  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
-+-

Comment (by Tom):

 In my case we have a bunch of methods in our applications that all use
 pathlib instances, some of which is used by our upload_to methods. It
 feels a bit strange to have to return the string representation from them
 when interacting with Django. With Python 2 support out of the picture
 there isn't much reason to, other than historical ones.

 The main advantage is readability, in a lot of cases using Pathlib makes
 `os.path` heavy code a lot less dense.

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


Re: [Django] #28428: Add support for Pathlib objects in django.core.storage

2017-07-21 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+-
 Reporter:  Tom  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  master
  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 Tim Graham):

 * component:  Uncategorized => File uploads/storage


Comment:

 Do you have a use case in mind? What are the advantages?

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


[Django] #28428: Add support for Pathlib objects in django.core.storage

2017-07-21 Thread Django
#28428: Add support for Pathlib objects in django.core.storage
-+
   Reporter:  Tom|  Owner:  nobody
   Type:  New feature| Status:  new
  Component:  Uncategorized  |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  |
-+
 Code in django.core.storage will explode when given a Pathlib object on
 Python 3.4 and 3.5. For example, this throws a cryptic `AttributeError:
 'PosixPath' object has no attribute 'rfind'` exception due to
 `generate_filename` only expecting strings:


 {{{
 def upload_to(filename):
   return pathlib.Path(filename)

 class Storage(models.Model):
file = models.FileField(upload_to=upload_to)
 }}}


 More generally, it would be nice if all methods in the django.core.files
 accepted pathlib objects, and used pathlib objects internally. For
 compatibility reasons I think strings would have to be returned.

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