Opened 13 years ago
Last modified 10 years ago
#19193 closed New feature
Save only one field to database which refereced to FieldFile — at Version 1
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
django.db.models.fields.FieldFile:
def save(self, name, content, save=True):
....
if save:
self.instance.save(update_fields=[self.field.name])
....
or:
def save(self, name, content, save=True, **kwargs)
....
if save:
self.instance.save(**kwargs)
....
So, we get rid of re-saving fields when updating
Change History (1)
comment:1 by , 13 years ago
| Description: | modified (diff) |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
Note:
See TracTickets
for help on using tickets.
Option 1 is highly backwards incompatible and option 2 looks like an API bloat - passing
save=Falseand callinginstance.save()does exactly the same and avoids potential kwargs naming conflict.