Changes between Version 11 and Version 12 of NewAdminChanges
- Timestamp:
- Oct 18, 2005, 3:55:08 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewAdminChanges
v11 v12 73 73 Without these changes, the new fixes will not work. It should work about as well as the trunk without these changes. 74 74 75 == Manipulators ==75 == Manipulators and inline editing == 76 76 77 77 Manipulators have a new optional argument to their constructors: {{{follow}}}. The argument is a dictionary indicating which fields and related objects to extract in flatten_data and examine when saving the object. … … 83 83 84 84 This is the set of fields shown by the admin. 85 86 Currently, the FormWrapper must be passed edit_inline=True to gain access to these fields. 87 This will probably be removed. 88 89 examples of dictionarys to be used as {{{follow}}} arguments. 90 91 Suppress the field 'name'. 92 {{{ 93 follow = { 94 'name': False, 95 } 96 }}} 97 98 Show the editable=False field 'job' 99 {{{ 100 101 follow = { 'job' : True, } 102 103 104 }}} 105 106 Show the set of related objects in the module 'choices' 107 {{{ 108 follow = { 109 'choices': True, 110 } 111 112 }}} 113 114 Show the set of related objects in the module 'choices', but suppress the 'poll' field of each choice object: 115 {{{ 116 117 follow = { 118 'choices': { 119 'poll': False 120 } 121 } 122 123 }}} 124 125 Put it all together: 126 {{{ 127 follow = { 128 'name' : False, 129 'job' : True, 130 'choices' : { 131 'poll' : False 132 } 133 } 134 }}} 135 136 An example of using this in a view function: 85 137 86 138 {{{ … … 110 162 111 163 # Populate the FormWrapper. 112 form = formfields.FormWrapper(manipulator, new_data, errors, edit_inline = True) # ,----- EXTRA ARGUMENT164 form = formfields.FormWrapper(manipulator, new_data, errors, edit_inline = True) # <----- EXTRA ARGUMENT 113 165 114 166 … … 116 168 117 169 }}} 118 119 Manipulators have a new method, {{{flatten_data()}}}. This takes the data from the existing object (or the defaults in the case of an {{{AddManipulator}}}) and turns it into a suitable form for an HTTP post. It must be called before creating the formfield wrapper is created.120 170 121 171 == Templates ==