Opened 7 years ago
Closed 7 years ago
#29434 closed Cleanup/optimization (needsinfo)
model_to_dict should work with prefix
| Reported by: | Maxim Danilov | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | |
| Severity: | Normal | Keywords: | models, prefix |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
model_to_dict Returns a dict containing the data in instance suitable for passing as a Form's initial keyword argument.
i am agree with that.
but sometimes it can helped to generate it with prefix in keys.
Change History (2)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 7 years ago
| Resolution: | → needsinfo |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Can you describe your use case in a bit more detail? Is the idea that the function would accept a
prefixargument and simply add that prefix to all keys in the resulting dictionary? I'm unsure why you couldn't do that outside of Django.model_to_dict()is a private API and I don't see much argument for adding options that Django itself doesn't use.