dynamic FilePathField question

后端 未结 4 1763
臣服心动
臣服心动 2020-12-18 15:48

I have a model where the location of pdf directory I\'m pointing to with my FilePathField is based on the \"client\" and \"job_number\" fields.

class CCEntry         


        
4条回答
  •  鱼传尺愫
    2020-12-18 16:26

    Based on your subsequent post on similar functionality in the FileField (see last link below) And my inability to get any of the above to work, I'm gonna hazard a guess that it's not yet possible for the FilePathField field type.

    I know that passing a callable works for most fields' 'default' parameters... https://docs.djangoproject.com/en/dev/ref/models/fields/#default ... as it appears to work for the upload_to param of FieldField (eg https://stackoverflow.com/questions/10643889/dynamic-upload-field-arguments/ ) andImageField` (eg Django - passing extra arguments into upload_to callable function )

    Anyone interested in extending FilePathField to include this feature?

提交回复
热议问题