Skip to content

Uploading from the admin panel

@Marjolaine was describing an issue where the client uploads a logo using the sib-form on the front-end. They can edit the logo to an existing web url (e.g. from Google images), but they can't select a local file to upload, like so: Screenshot_2020-03-04_at_16.35.43

How to do this now This is possible to work-around

  1. Select add new DjangoLDP_Uploader Document in the admin panel Screenshot_2020-03-04_at_16.36.34

  2. Select the file to upload and then select 'save and continue editing' Screenshot_2020-03-04_at_16.36.48

  3. Copy the URL id: Screenshot_2020-03-04_at_16.37.02

  4. Return to the model, and paste the URL id into the logo field, and save

A cleaner solution

  1. Make a new Field UploadedDocumentURL, which extends Django's URLField, without changes
  2. Override the form-field of UploadedDocumentURL to provide a custom widget which displays a file upload alongside a URL text input (the current value displayed here)

Estimation: 2-4 hours

@sylvain @balessan what do you think? This is perhaps a lot of coding to improve the admin panel UX

Edited by Jean-Baptiste Pasquier