--
Ticket URL: <https://code.djangoproject.com/ticket/16429>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:1>
Comment (by James Walters):
At DjangoCon US, taking a look at this.
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:2>
* owner: nobody => James Walters
* status: new => assigned
Comment:
I've been able to reproduce this, which I wanted to make sure to do given
the age of this ticket. FilePathField's choices remain stale after
changing the contents of its specified filepath. Now I'll get to work on
this.
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:3>
* has_patch: 0 => 1
Comment:
Alright, I've opened a PR implementing this!
[https://github.com/django/django/pull/17416 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:4>
* needs_better_patch: 0 => 1
Comment:
Setting as patch needs improvement because I think we need to clarify
expectations about the solution, specifically, what "automatically refresh
choices" mean.
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:5>
* needs_better_patch: 1 => 0
Comment:
Unticking the "patch needs improvement" box to indicate this is ready for
review again over on GitHub.
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:6>
* cc: Carlton Gibson, David Smith (added)
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:7>
Old description:
> As noted by a couple of people on django-users, FilePathField does not
> automatically refresh choices if files are add to or removed from the
> path being pointed to (http://groups.google.com/group/django-
> users/browse_thread/thread/6778fa138b848996 and
> http://groups.google.com/group/django-
> users/browse_thread/thread/403d872cf9433905).
>
> A nice addition to FilePathField would be the ability to control how long
> the choices are cached for, ranging from "never cached" to "cached
> forever" (or at least for the lifetime of the webserver process).
New description:
As noted by a couple of people on django-users, FilePathField does not
automatically refresh choices if files are add to or removed from the path
being pointed to (http://groups.google.com/group/django-
users/browse_thread/thread/6778fa138b848996 and
http://groups.google.com/group/django-
users/browse_thread/thread/403d872cf9433905).
A nice addition to FilePathField would be the ability to refresh the path
choices on a per-request basis.
--
Comment (by Natalia Bidart):
After [https://github.com/django/django/pull/17416#issuecomment-1855854814
these comment in the PR], I'm re-titling this ticket accordingly to adjust
scope and allow for a more pragmatic yet useful solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/16429#comment:8>