here's want do, , did not find similar in search far. in admin page, have filefield in model. rest of fields read only. want able upload file , process , extract info assign these read fields.
i thought of overriding clean_(modelfield) method filefield , parsing , assigning stuff in it. not done right after file uploaded, right? thought done when form/entry saved. next thought of adding custom button admin form called 'process' can clicked after file uploaded. trigger assignment of values read fields. not able decide on best approach process file , display updated fields in 1 page without of tinkering.
any thoughts? thanks
there 2 solutions can think of limited knowledge. since, default, file upload start once request posted, alternative way needs designed.
1. upload file via script , process file: use script (eg: jquery script) upload file , once upload complete, trigger script (oncomplete event) render values read-only field. entire process can associated "process" button or time-delayed trigger once filefield changed.
2 custom form file upload: can detach file field , other fields (read fields mentioned). if design custom form file upload field , once user submits request, can render form rendered initial values in read fields. way need not have script have have 2 forms.
hope helps. if find other solution, share :)
Comments
Post a Comment