Stu*_*xon 3 python django upload django-models
我有这样的模特
def upload_location(instance, filename): return 'validate/%s/builds/%s' % (get_current_user(), filename) class MidletPair(models.Model): jad_file = models.FileField(upload_to = upload_location) jar_file = models.FileField(upload_to = upload_location) upload_to=tempfile.gettempdir()
如何在upload_location()中获取当前用户...?
旁注:看起来django的东西令人困惑,因为网上有很多前1.0的东西.
| 归档时间: |
|
| 查看次数: |
5136 次 |
| 最近记录: |