Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#364 closed defect (fixed)

_{post,pre}_file hooks

Reported by: maurycy Owned by: adrian
Component: Metasystem Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

17:21 < maurycy> hey. is there any way to parse data after file upload? any
                 file upload hooks or something?
17:22 < mmarshall> would _post_save work?
17:31 < maurycy> mmarshall: no. it doesn't work - post_save is called after
                 database .save(), nor file upload
17:32 < mmarshall> But you could then open the file, process it, then save it
                   again.
17:32 < maurycy> mmarshall: i'd not like to wait for .save() to process the file
17:33 < mmarshall> Then I think you should take a look at the source.
17:34 < mmarshall> Check out django/core/meta/__init__.py
17:34 < mmarshall> And maybe django/core/meta/fields.py
17:35 < maurycy> mmarshall: there should be _post_file_upload() etc.
17:36 < mmarshall> maurycy: I agree.

We can also think about more generic subsystem of hooks called after and before various actions, like file upload, image resize etc., etc.

Change History (2)

comment:1 Changed 10 years ago by maurycypw@…

See #421 ticket. It introduces new event framework, that should be used here.

comment:2 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

This is no longer an issue in the magic-removal branch, where you can override save() on models.

Note: See TracTickets for help on using tickets.
Back to Top