Opened 15 years ago
Closed 15 years ago
#12652 closed (wontfix)
create_update should support extra data to be intial and bind on form
Reported by: | jasongreen | Owned by: | nobody |
---|---|---|---|
Component: | Generic views | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
i have write some code to resolve this problem.
- sometimes we need initilize the form by querystring when we create an object. e.g. /student/create/?school=2 , is it?
- initilize by request.GET
- sometimes we need initialze the form by sepecified data not contains in request.GET
- add an initial parameter in create_object,e.g. create(...initial={'owner':request.user,'somthing':something_runtime})
- sometimes we need to force to update some field with specified data that not contained in request.POST. or something must be set at server side.
- add an force_data parameter in create_object and update_object. e.g. create(...force_data=('ip_addr':request.METAREMOTE_ADDR)
- additional change. because of browser cache the form values for each name, if the name is 'name' or some name else appears offen, the browser tip is verbosely. so i think add a prefix to form is good.
- add prefix for form.
Attachments (1)
Change History (3)
by , 15 years ago
Attachment: | create_update.diff added |
---|
comment:1 by , 15 years ago
Component: | Uncategorized → Generic views |
---|---|
Needs tests: | set |
comment:2 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I'm going to close this wontfix in favour of #6735. Class-based generic views will either have the functionality described here, or will be able to be extended to add this functionality.
Also, as a procedural note, I almost closed this ticket "invalid". Please keep to 1 issue per ticket. In this case, points 1 and 2 are clearly good ideas; 3 and 4 are at the very least debatable. Having all 4 ideas on a single ticket makes it difficult to manage the subproblems.