misc: allow prefilling file fields with a dictionary (#25385) #1303
Loading…
Reference in New Issue
No description provided.
Delete Branch "wip/25385-prefill-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
679af42ded
to18a0a14f07
18a0a14f07
toab64d97f8e
ab64d97f8e
to47381d0e09
@ -142,0 +144,4 @@
value = misc.unlazy(value)
if isinstance(value, str) and urllib.parse.urlparse(value).scheme in ('http', 'https'):
try:
response, dummy, data, dummy = misc.http_get_page(value, raise_on_http_errors=True)
Le ticket évoque à la fois la possibilité de préremplissage via un dictionnaire type {"content": "...", "filename": "..."} et la possibilité de préremplissage en donnant juste une URL. Ici on ajoute au convert_value_from_anything la prise en compte d'une chaine qui serait une url.
@ -927,0 +928,4 @@
from wcs.fields.file import FileField
try:
value = FileField.convert_value_from_anything(value)
Et dans le set_value() du champ fichier, on appelle convert_value_from_anything().
WIP: misc: allow prefilling file fields with a dictionary (#25385)to misc: allow prefilling file fields with a dictionary (#25385)