| | 1 | |
| | 2 | == WEB SETUP IMPLEMENTATION (Detail)== |
| | 3 | |
| | 4 | {{{ |
| | 5 | #!html |
| | 6 | |
| | 7 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b> </b><b><span |
| | 8 | style='font-size:15.0pt;line-height:115%'>MODULES</span> </b></p> |
| | 9 | |
| | 10 | <p class=MsoListParagraphCxSpFirst style='margin-top:0cm;margin-right:0cm; |
| | 11 | margin-bottom:0cm;margin-left:36.15pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 12 | style='font-size:13.0pt;line-height:115%;font-family:Symbol;color:#C00000'><img |
| | 13 | width=18 height=18 src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Bullet-red.png/120px-Bullet-red.png" alt="*"><span |
| | 14 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 15 | style='font-size:13.0pt;line-height:115%;color:#C00000'> <b>Layout.py</b></span></p> |
| | 16 | |
| | 17 | <p class=MsoListParagraphCxSpMiddle style='margin:0cm;margin-bottom:.0001pt'><b><span |
| | 18 | style='font-size:13.0pt;line-height:115%;color:#C00000'> </span></b></p> |
| | 19 | |
| | 20 | <p class=MsoListParagraphCxSpLast style='margin-top:0cm;margin-right:0cm; |
| | 21 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 22 | style='font-family:Wingdings'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 23 | </span></span><b>Def setting() :</b></p> |
| | 24 | |
| | 25 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 26 | |
| | 27 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>These will |
| | 28 | be imported into the models so will run before the models and for the first |
| | 29 | time only</p> |
| | 30 | |
| | 31 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>The settings |
| | 32 | layout needs to be stored in here.</p> |
| | 33 | |
| | 34 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>The settings |
| | 35 | is a dict with keys as the: </p> |
| | 36 | |
| | 37 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 38 | style='font-size:13.0pt;line-height:115%'> </span>“categary”.”field_id”</p> |
| | 39 | |
| | 40 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> |
| | 41 | </p> |
| | 42 | |
| | 43 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 44 | style='color:gray'>Like:- </span></p> |
| | 45 | |
| | 46 | }}} |
| | 47 | {{{ |
| | 48 | #!python |
| | 49 | Settings = {"databse.db_type" : {"nice_name" :T("Database"), |
| | 50 | "description":T("Database Type: "), |
| | 51 | "input_type":"select", |
| | 52 | "options":['sqlite', 'sql', 'mysql'], |
| | 53 | "jquery_validation_requirements”: "required lettersonly" |
| | 54 | }, |
| | 55 | #and similarly other options for language can be set |
| | 56 | } |
| | 57 | |
| | 58 | }}} |
| | 59 | {{{ |
| | 60 | #!html |
| | 61 | <p class=MsoListParagraph style='margin:0cm;margin-bottom:.0001pt'><span |
| | 62 | style='color:#595959'> </span></p> |
| | 63 | |
| | 64 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 65 | style='color:black'>These are really useful for views as this provide the |
| | 66 | information regarding input type, the value to select from, the field name and |
| | 67 | the validation requirement. These layouts are mostly for the views. Some of |
| | 68 | these like port will also contain a validation field for the range of accepted |
| | 69 | values.</span></p> |
| | 70 | |
| | 71 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 72 | style='color:black'> </span></p> |
| | 73 | |
| | 74 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 75 | style='color:black'> We will have to set the settings in accordance with |
| | 76 | modules/s3/s3cfg.py.</span></p> |
| | 77 | |
| | 78 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 79 | style='color:black'> </span></p> |
| | 80 | |
| | 81 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;margin-bottom: |
| | 82 | 0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 83 | style='font-family:Wingdings;color:black'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 84 | </span></span><b><span style='color:black'>Def modules() :</span></b></p> |
| | 85 | |
| | 86 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 87 | style='color:black'> </span></b></p> |
| | 88 | |
| | 89 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 90 | style='color:black'>These needs to store the names of the modules:-</span></p> |
| | 91 | |
| | 92 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 93 | style='color:#595959'> </span></p> |
| | 94 | }}} |
| | 95 | {{{ |
| | 96 | #!python |
| | 97 | modules = { |
| | 98 | "default":True, |
| | 99 | "admin":True, |
| | 100 | "gis":True, |
| | 101 | } |
| | 102 | #true meaning "on" |
| | 103 | }}} |
| | 104 | {{{ |
| | 105 | #!html |
| | 106 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 107 | style='color:black'>Here the “on” indicate that the default value of the module |
| | 108 | status is on.</span></p> |
| | 109 | |
| | 110 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 111 | style='color:black'> </span></p> |
| | 112 | |
| | 113 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 114 | style='color:black'>In the modules the layout is not required, as they are |
| | 115 | stored when we run the modified form of 000_config in the models. The input types |
| | 116 | of these (name, Description, Access level) are quite fixed so they need not to |
| | 117 | be stored separately. Therefore not much help is required for the views to.</span></p> |
| | 118 | |
| | 119 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 120 | style='color:black'> </span></p> |
| | 121 | |
| | 122 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 123 | style='color:black'>This part of the code is on the similar lines as that of |
| | 124 | the models in the previous built version. These modules can be built rather |
| | 125 | quickly and I should not take 3 days to build this.</span></p> |
| | 126 | |
| | 127 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 128 | style='color:black'> </span></p> |
| | 129 | |
| | 130 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 131 | style='color:black'> </span></p> |
| | 132 | |
| | 133 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 134 | style='font-size:15.0pt;line-height:115%;color:black'> </span></p> |
| | 135 | |
| | 136 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 137 | style='font-size:15.0pt;line-height:115%;color:black'> </span></b></p> |
| | 138 | |
| | 139 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 140 | style='font-size:15.0pt;line-height:115%;color:black'> </span></b></p> |
| | 141 | |
| | 142 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 143 | style='font-size:15.0pt;line-height:115%;color:black'>MODELS</span></b></p> |
| | 144 | |
| | 145 | <p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt'><span |
| | 146 | style='font-size:15.0pt;line-height:115%;font-family:Symbol;color:#C00000'><img |
| | 147 | width=18 height=18 src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Bullet-red.png/120px-Bullet-red.png" alt="*"><span |
| | 148 | style='font:7.0pt "Times New Roman"'> </span></span><b><span |
| | 149 | style='font-size:13.0pt;line-height:115%;color:#C00000'>1st_run.py |
| | 150 | This will run before the modified version of 000_config</span></b></p> |
| | 151 | |
| | 152 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span |
| | 153 | style='font-size:13.0pt;line-height:115%;color:#C00000'> </span></b></p> |
| | 154 | |
| | 155 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span |
| | 156 | style='font-size:13.0pt;line-height:115%;color:#C00000'> </span></b></p> |
| | 157 | |
| | 158 | <p class=MsoListParagraphCxSpMiddle style='margin-left:18.0pt;text-indent:-18.0pt'><span |
| | 159 | style='font-family:Wingdings;color:#0D0D0D'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 160 | </span></span><b>Session variable : session.path_to_config</b></p> |
| | 161 | |
| | 162 | <p class=MsoListParagraphCxSpLast style='margin-left:0cm'>This will initialize |
| | 163 | a session variable that will help us get the status of the selector. If the |
| | 164 | session variable is “none” we can initialize it to “”, and later in the |
| | 165 | controller it can be set to the path of 000_config of that particular eden they |
| | 166 | want the to the web-setup to run on.</p> |
| | 167 | |
| | 168 | <p class=MsoNormal>This session variable will help us to get the path of the |
| | 169 | 000_config from the controllers.</p> |
| | 170 | |
| | 171 | <p class=MsoListParagraphCxSpFirst style='margin-left:18.0pt;text-indent:-18.0pt'><span |
| | 172 | style='font-family:Wingdings;color:#0D0D0D'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 173 | </span></span><b>Parsing 000_config.py</b></p> |
| | 174 | |
| | 175 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'>Once we get the |
| | 176 | path of 000_config we need to copy that file in the websetup models by the the |
| | 177 | name of modified_config.py so that it shall run after this file closes. Now |
| | 178 | open modified_config using <b>os.path.join</b> in the “<b>w</b>” mode and |
| | 179 | 000_config in the “<b>r</b>” mode. We need to read 000_config and</p> |
| | 180 | |
| | 181 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'>---------------------------------------------------------------------------------------------------------------------------------------------------------</p> |
| | 182 | <p style='color:#595959'>1.Remove the line containing <b>“s3base.s3config(” </b>from |
| | 183 | the starting of the file</p> |
| | 184 | |
| | 185 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span |
| | 186 | style='color:#595959'> </span></p> |
| | 187 | |
| | 188 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span |
| | 189 | style='color:#595959'>2. Insert </span></p> |
| | 190 | |
| | 191 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span |
| | 192 | style='color:#595959'>“ from gluon.storage import Storage</span></b></p> |
| | 193 | |
| | 194 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span |
| | 195 | style='color:#595959'>from gluon.contrib.simplejson.ordered_dict import |
| | 196 | OrderedDict</span></b></p> |
| | 197 | |
| | 198 | <p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span |
| | 199 | style='color:#595959'>deployment_settings = Storage( “</span></b><span |
| | 200 | style='color:#595959'> </span></p> |
| | 201 | |
| | 202 | <p class=MsoListParagraphCxSpLast style='margin-left:0cm'><span |
| | 203 | style='color:#595959'>before the first line where they find “deployment_settings.” |
| | 204 | Without a “<b>#</b>” in the 000_config.py </span></p> |
| | 205 | |
| | 206 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 207 | style='color:#595959'>3. And add <b>“ ) ”</b> Immediately before the import of |
| | 208 | storage and remove the import of storage from there </span></p> |
| | 209 | |
| | 210 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 211 | style='color:#595959'> </span></p> |
| | 212 | |
| | 213 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 214 | style='color:#595959'>4. Add 4 spaces to each line between “<b>Storage(</b>“ |
| | 215 | and “<b>)</b>” even the commented ones </span></p> |
| | 216 | |
| | 217 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 218 | style='color:#595959'> </span></p> |
| | 219 | |
| | 220 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 221 | style='color:#595959'>5<b>.</b> Make the following to the lines except the ones |
| | 222 | containing “#” before the use of “<b>deployment_settings.</b>” </span></p> |
| | 223 | |
| | 224 | <p class=MsoListParagraphCxSpFirst style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 225 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span |
| | 226 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 227 | style='color:#595959'>Wrap each word containing “<b>deployment_settings.</b>” |
| | 228 | with “” </span></p> |
| | 229 | |
| | 230 | <p class=MsoListParagraphCxSpLast style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 231 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span |
| | 232 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 233 | style='color:#595959'>Add a <b>“,”(coma)</b> after the line </span></p> |
| | 234 | |
| | 235 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 236 | style='color:#595959'> </span></p> |
| | 237 | |
| | 238 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 239 | style='color:#595959'>6. Check if the </span></p> |
| | 240 | |
| | 241 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 242 | style='color:#595959'>“<?module_name?> = Storage( \n” </span></b><span |
| | 243 | style='color:#595959'>has a “#” in the same line then turn </span></p> |
| | 244 | |
| | 245 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 246 | style='color:#595959'>module[module_name] ( variable in layout.py in modules |
| | 247 | ) off .</span></p> |
| | 248 | |
| | 249 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 250 | style='color:#595959'> </span></p> |
| | 251 | |
| | 252 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 253 | style='color:#595959'>7<b>.</b>Remove “#” from there till the line you get <b>“#),” |
| | 254 | </b></span></p> |
| | 255 | |
| | 256 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>----------------------------------------------------------------------------------------------------------------------------------------------------------</p> |
| | 257 | |
| | 258 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>This would |
| | 259 | result in the creation of 2 dicts one is deployment_settings and the other one |
| | 260 | is for the modules deployment_settings.modules .Now 6<sup>th</sup> and 7<sup>th</sup> |
| | 261 | steps will help us to maintain the dicts for modules that were turned off by |
| | 262 | commenting them.</p> |
| | 263 | |
| | 264 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 265 | |
| | 266 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;margin-bottom: |
| | 267 | 0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 268 | style='font-family:Wingdings;color:#0D0D0D'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 269 | </span></span><b>Handling database conflicts</b></p> |
| | 270 | |
| | 271 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 272 | style='color:black'>There should be a list that will keep a list of |
| | 273 | databse_name and database_types of 2 eden application cannot be same at same |
| | 274 | time therefore a list of database types and databse names needs to be made</span></p> |
| | 275 | |
| | 276 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 277 | style='color:black'> </span></p> |
| | 278 | |
| | 279 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 280 | text-indent:-18.0pt'><span style='font-family:Wingdings'>v<span |
| | 281 | style='font:7.0pt "Times New Roman"'> </span></span>For this we will |
| | 282 | first have to generate a list paths .We can search for “<b>Copyright: 2010 (c) |
| | 283 | Sahana Software Foundation</b>” in all the LICENSE files of applications.</p> |
| | 284 | |
| | 285 | <p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm; |
| | 286 | margin-left:18.0pt;margin-bottom:.0001pt'> </p> |
| | 287 | |
| | 288 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Then we will |
| | 289 | have to search in the list of paths for specific keywords like <b><span |
| | 290 | style='color:gray'>“deployment_setting.database.database”</span></b><span |
| | 291 | style='color:gray'> </span>This can be done using regex command in grep</p> |
| | 292 | |
| | 293 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 294 | style='color:#A6A6A6'> </span></p> |
| | 295 | }}} |
| | 296 | {{{ |
| | 297 | |
| | 298 | If path(variable) is in the list of paths containing: |
| | 299 | Command_line = “grep ” + “deployment_setting.database.database” + “path” |
| | 300 | Line = subprocess.Popen(command_line); |
| | 301 | |
| | 302 | }}} |
| | 303 | {{{ |
| | 304 | #!html |
| | 305 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 306 | |
| | 307 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Now search |
| | 308 | the file for deployment_settings.database.db_type<span style='color:gray'> </span>.These |
| | 309 | list will help in validating for the database values. </p> |
| | 310 | |
| | 311 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 312 | |
| | 313 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 314 | |
| | 315 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 316 | |
| | 317 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 318 | text-indent:-18.0pt'><span style='font-size:15.0pt;line-height:115%;font-family: |
| | 319 | Symbol'><img width=18 height=18 src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Bullet-red.png/120px-Bullet-red.png" alt="*"><span |
| | 320 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 321 | style='font-size:13.0pt;line-height:115%;color:#C00000'>MODIFIED_CONFIG.PY |
| | 322 | PARSED VERSION OF 000_CONFIG.PY </span></p> |
| | 323 | |
| | 324 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 325 | style='color:#0D0D0D'> </span></p> |
| | 326 | |
| | 327 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 328 | style='color:#0D0D0D'>It will initialize and define the dict for all the |
| | 329 | settings and the modules of whose we have mentioned before.</span><span |
| | 330 | style='font-size:13.0pt;line-height:115%;color:#C00000'> </span></p> |
| | 331 | |
| | 332 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 333 | style='color:#0D0D0D'> </span></p> |
| | 334 | |
| | 335 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 336 | style='color:#0D0D0D'>This part of the code has not been done before. I expect to |
| | 337 | take a week at max. to complete this code.</span></p> |
| | 338 | |
| | 339 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 340 | style='color:#0D0D0D'> </span></p> |
| | 341 | |
| | 342 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 343 | style='color:#0D0D0D'> </span></p> |
| | 344 | |
| | 345 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 346 | style='color:#0D0D0D'> </span></p> |
| | 347 | |
| | 348 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 349 | style='color:#0D0D0D'> </span></p> |
| | 350 | |
| | 351 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 352 | style='color:#0D0D0D'> </span></p> |
| | 353 | |
| | 354 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 355 | style='color:#0D0D0D'> </span></p> |
| | 356 | |
| | 357 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 358 | style='font-size:15.0pt;line-height:115%;color:#0D0D0D'>CONTROLLERS</span></b></p> |
| | 359 | |
| | 360 | <p class=MsoListParagraphCxSpFirst style='margin-top:0cm;margin-right:0cm; |
| | 361 | margin-bottom:0cm;margin-left:42.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 362 | style='font-size:13.0pt;line-height:115%;font-family:Symbol;color:#C00000'><img |
| | 363 | width=22 height=22 src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Bullet-red.png/120px-Bullet-red.png" alt="*"><span |
| | 364 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 365 | style='font-size:15.0pt;line-height:115%;color:#C00000'>DEFAULT.PY </span></p> |
| | 366 | |
| | 367 | <p class=MsoListParagraphCxSpMiddle style='margin-top:0cm;margin-right:0cm; |
| | 368 | margin-bottom:0cm;margin-left:42.0pt;margin-bottom:.0001pt'><span |
| | 369 | style='font-size:15.0pt;line-height:115%;color:#C00000'> </span></p> |
| | 370 | |
| | 371 | <p class=MsoListParagraphCxSpLast style='margin-top:0cm;margin-right:0cm; |
| | 372 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 373 | style='font-family:Wingdings;color:#0D0D0D'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 374 | </span></span><b><span style='color:#0D0D0D'>Def selector():</span></b></p> |
| | 375 | |
| | 376 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>If the |
| | 377 | session variable of the path is not set then I redirect the user from the index |
| | 378 | function to this function of the controller. </p> |
| | 379 | |
| | 380 | <p class=MsoListParagraphCxSpFirst style='margin-top:0cm;margin-right:0cm; |
| | 381 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 382 | style='font-family:Wingdings'>v<span style='font:7.0pt "Times New Roman"'> |
| | 383 | </span></span>I will access the list of paths generated in the models while |
| | 384 | solving the database conflicts</p> |
| | 385 | |
| | 386 | <p class=MsoListParagraphCxSpLast style='margin-top:0cm;margin-right:0cm; |
| | 387 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 388 | style='font-family:Wingdings'>v<span style='font:7.0pt "Times New Roman"'> |
| | 389 | </span></span>And then there is a drop down menu to select the path ( the user |
| | 390 | will select the name, I will retrieve the path using the request.post_vars in |
| | 391 | the form.accepts and then set the path accordingly).We can create forms using SELECT() |
| | 392 | function for the dropdown and FIELDSET() for creating a filed in the form</p> |
| | 393 | |
| | 394 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 395 | |
| | 396 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;margin-bottom: |
| | 397 | 0cm;margin-left:32.15pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 398 | style='font-family:"Courier New"'>o<span style='font:7.0pt "Times New Roman"'> |
| | 399 | </span></span>This function will also contain a field for <b>creating a new |
| | 400 | eden</b></p> |
| | 401 | |
| | 402 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Selector |
| | 403 | will also contain an option for creating new eden . This should be need no |
| | 404 | network excess, I will execute statement by “exec” for copying the files from |
| | 405 | the existing eden to a new eden with a new name.</p> |
| | 406 | |
| | 407 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>I will copy |
| | 408 | all the files except a few files like database logs, session and some other |
| | 409 | which are developed after you run the first time. After the script has run |
| | 410 | successfully </p> |
| | 411 | |
| | 412 | <p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm; |
| | 413 | margin-left:18.0pt;margin-bottom:.0001pt'> </p> |
| | 414 | |
| | 415 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 416 | style='color:#0D0D0D'>This part of the code should not take more than 4 days to |
| | 417 | code. </span></p> |
| | 418 | |
| | 419 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 420 | style='color:#0D0D0D'> </span></p> |
| | 421 | |
| | 422 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 423 | style='color:#0D0D0D'> </span></p> |
| | 424 | |
| | 425 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;margin-bottom: |
| | 426 | 0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:-18.0pt'><span |
| | 427 | style='font-family:Wingdings;color:#0D0D0D'>Ø<span style='font:7.0pt "Times New Roman"'> |
| | 428 | </span></span><b><span style='color:#0D0D0D'>Def index():</span></b></p> |
| | 429 | |
| | 430 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 431 | style='color:#0D0D0D'>If the session variable is set then this part is |
| | 432 | executed. The main purpose of this is to create forms according to the needs. |
| | 433 | We will have a submit ,back and next button on the every form .</span></p> |
| | 434 | |
| | 435 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 436 | style='color:#0D0D0D'> </span></p> |
| | 437 | |
| | 438 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 439 | style='color:#0D0D0D'>There should be a login form that would verify that admin |
| | 440 | is making changes in the settings. For this we will have to contact the |
| | 441 | database of the selected Eden.</span></p> |
| | 442 | |
| | 443 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 444 | style='color:#0D0D0D'> </span></p> |
| | 445 | |
| | 446 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 447 | style='color:#0D0D0D'>The TABLE() function will be extremely useful for setting |
| | 448 | the user interface and SELECT() function for defining dropboxes. INPUT() will |
| | 449 | help us define check boxes and other input types. All the fields stored in |
| | 450 | modules for every setting will be sent to the user using INPUT() (jquery |
| | 451 | validation requirement, input type and default value ) and FIELDSET(for field |
| | 452 | id and the keys of the, setting variable are extremely important here) </span></p> |
| | 453 | |
| | 454 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 455 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#0D0D0D'>v<span |
| | 456 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 457 | style='color:#0D0D0D'>Module Forms:</span></p> |
| | 458 | |
| | 459 | <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 |
| | 460 | style='border-collapse:collapse;border:none'> |
| | 461 | <tr> |
| | 462 | <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt; |
| | 463 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 464 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 465 | normal'><span style='color:#0D0D0D'>Module name</span></p> |
| | 466 | </td> |
| | 467 | <td width=297 valign=top style='width:178.05pt;border:solid windowtext 1.0pt; |
| | 468 | border-left:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 469 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 470 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 471 | <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 |
| | 472 | style='border-collapse:collapse;border:none'> |
| | 473 | <tr> |
| | 474 | <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt; |
| | 475 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 476 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 477 | line-height:normal'><span style='color:#0D0D0D'>Checkboxes for access level |
| | 478 | </span></p> |
| | 479 | </td> |
| | 480 | </tr> |
| | 481 | <tr> |
| | 482 | <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt; |
| | 483 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 484 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm; |
| | 485 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent: |
| | 486 | -18.0pt;line-height:normal'><span style='font-family:"Courier New"; |
| | 487 | color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 488 | style='color:#0D0D0D'>Admin</span></p> |
| | 489 | </td> |
| | 490 | </tr> |
| | 491 | <tr> |
| | 492 | <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt; |
| | 493 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 494 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm; |
| | 495 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent: |
| | 496 | -18.0pt;line-height:normal'><span style='font-family:"Courier New"; |
| | 497 | color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 498 | style='color:#0D0D0D'>Anonymous </span></p> |
| | 499 | </td> |
| | 500 | </tr> |
| | 501 | <tr> |
| | 502 | <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt; |
| | 503 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 504 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm; |
| | 505 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent: |
| | 506 | -18.0pt;line-height:normal'><span style='font-family:"Courier New"; |
| | 507 | color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 508 | style='color:#0D0D0D'>Only Division users</span></p> |
| | 509 | </td> |
| | 510 | </tr> |
| | 511 | <tr> |
| | 512 | <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt; |
| | 513 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 514 | <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm; |
| | 515 | margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent: |
| | 516 | -18.0pt;line-height:normal'><span style='font-family:"Courier New"; |
| | 517 | color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 518 | style='color:#0D0D0D'>None </span></p> |
| | 519 | </td> |
| | 520 | </tr> |
| | 521 | </table> |
| | 522 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 523 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 524 | </td> |
| | 525 | <td width=297 valign=top style='width:178.05pt;border:solid windowtext 1.0pt; |
| | 526 | border-left:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 527 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 528 | normal'><span style='color:#0D0D0D'> ?help</span></p> |
| | 529 | </td> |
| | 530 | </tr> |
| | 531 | <tr> |
| | 532 | <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt; |
| | 533 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 534 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 535 | normal'><span style='color:#0D0D0D'>Module nice name</span></p> |
| | 536 | </td> |
| | 537 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 538 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 539 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 540 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 541 | normal'><span style='color:#0D0D0D'>Textbox </span></p> |
| | 542 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 543 | normal'><span style='color:#0D0D0D'>(with correct width)</span></p> |
| | 544 | </td> |
| | 545 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 546 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 547 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 548 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 549 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 550 | </td> |
| | 551 | </tr> |
| | 552 | <tr> |
| | 553 | <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt; |
| | 554 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 555 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 556 | normal'><span style='color:#0D0D0D'>Module Description </span></p> |
| | 557 | </td> |
| | 558 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 559 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 560 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 561 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 562 | normal'><span style='color:#0D0D0D'>Textbox</span></p> |
| | 563 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 564 | normal'><span style='color:#0D0D0D'>(with correct width)</span></p> |
| | 565 | </td> |
| | 566 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 567 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 568 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 569 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 570 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 571 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 572 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 573 | </td> |
| | 574 | </tr> |
| | 575 | <tr> |
| | 576 | <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt; |
| | 577 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 578 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 579 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 580 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 581 | normal'><span style='color:#0D0D0D'>BACK(after the last module)</span></p> |
| | 582 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 583 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 584 | </td> |
| | 585 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 586 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 587 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 588 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 589 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 590 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 591 | normal'><span style='color:#0D0D0D'>NEXT(after the last module)</span></p> |
| | 592 | </td> |
| | 593 | <td width=297 valign=top style='width:178.05pt;border-top:none;border-left: |
| | 594 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 595 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 596 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 597 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 598 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 599 | normal'><span style='color:#0D0D0D'>SAVE AND QUIT(after the last module )</span></p> |
| | 600 | </td> |
| | 601 | </tr> |
| | 602 | </table> |
| | 603 | |
| | 604 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 605 | style='color:#0D0D0D'> </span></p> |
| | 606 | |
| | 607 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 608 | style='color:#0D0D0D'> </span></p> |
| | 609 | |
| | 610 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 611 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#0D0D0D'>v<span |
| | 612 | style='font:7.0pt "Times New Roman"'> </span></span><span |
| | 613 | style='color:#0D0D0D'>There will be similar forms for the settings; however I |
| | 614 | would like to have separate forms for different categories of settings</span></p> |
| | 615 | |
| | 616 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 617 | style='color:#0D0D0D'> </span></p> |
| | 618 | |
| | 619 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 620 | style='color:#0D0D0D'>Like thsese:-</span></p> |
| | 621 | |
| | 622 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 623 | style='color:#0D0D0D'> </span></p> |
| | 624 | |
| | 625 | <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 |
| | 626 | style='border-collapse:collapse;border:none'> |
| | 627 | <tr> |
| | 628 | <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt; |
| | 629 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 630 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 631 | normal'><span style='color:#0D0D0D'>SETTINGS CATEGORY</span></p> |
| | 632 | </td> |
| | 633 | <td width=260 valign=top style='width:155.9pt;border:solid windowtext 1.0pt; |
| | 634 | border-left:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 635 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 636 | normal'><span style='color:#0D0D0D'>(before the first setting only)</span></p> |
| | 637 | </td> |
| | 638 | <td width=302 valign=top style='width:181.4pt;border:solid windowtext 1.0pt; |
| | 639 | border-left:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 640 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 641 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 642 | </td> |
| | 643 | </tr> |
| | 644 | <tr> |
| | 645 | <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt; |
| | 646 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 647 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 648 | normal'><span style='color:#0D0D0D'>Setting name</span></p> |
| | 649 | </td> |
| | 650 | <td width=260 valign=top style='width:155.9pt;border-top:none;border-left: |
| | 651 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 652 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 653 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 654 | normal'><span style='color:#0D0D0D'>FIELD according to the Input type |
| | 655 | required</span></p> |
| | 656 | </td> |
| | 657 | <td width=302 valign=top style='width:181.4pt;border-top:none;border-left: |
| | 658 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 659 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 660 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 661 | normal'><span style='color:#0D0D0D'> ?help</span></p> |
| | 662 | </td> |
| | 663 | </tr> |
| | 664 | <tr> |
| | 665 | <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt; |
| | 666 | border-top:none;padding:0cm 5.4pt 0cm 5.4pt'> |
| | 667 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 668 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 669 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 670 | normal'><span style='color:#0D0D0D'>BACK(after the last one only)</span></p> |
| | 671 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 672 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 673 | </td> |
| | 674 | <td width=260 valign=top style='width:155.9pt;border-top:none;border-left: |
| | 675 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 676 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 677 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 678 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 679 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 680 | normal'><span style='color:#0D0D0D'>NEXT(after the last one only)</span></p> |
| | 681 | </td> |
| | 682 | <td width=302 valign=top style='width:181.4pt;border-top:none;border-left: |
| | 683 | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; |
| | 684 | padding:0cm 5.4pt 0cm 5.4pt'> |
| | 685 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 686 | normal'><span style='color:#0D0D0D'> </span></p> |
| | 687 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: |
| | 688 | normal'><span style='color:#0D0D0D'>SAVE AND QUIT(after the last on only)</span></p> |
| | 689 | </td> |
| | 690 | </tr> |
| | 691 | </table> |
| | 692 | |
| | 693 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 694 | style='color:#0D0D0D'> </span></p> |
| | 695 | |
| | 696 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 697 | text-indent:-18.0pt'><span style='font-family:Wingdings'>v<span |
| | 698 | style='font:7.0pt "Times New Roman"'> </span></span>for adding some text |
| | 699 | on the main page</p> |
| | 700 | |
| | 701 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 702 | style='color:#0D0D0D'> </span></p> |
| | 703 | |
| | 704 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 705 | style='color:#0D0D0D'>We will just set a text field in the form. Where he can |
| | 706 | type anything which he wants to be displayed at the main landing page of eden. |
| | 707 | I will set a global variable, that later I will write to the file |
| | 708 | 000_config.Then a division would be created in the index page of eden for |
| | 709 | displaying simple text. </span></p> |
| | 710 | |
| | 711 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 712 | style='color:#0D0D0D'> </span></p> |
| | 713 | |
| | 714 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>In the |
| | 715 | form.accepts you will need to set the module values according to the |
| | 716 | request.post_vars.</p> |
| | 717 | |
| | 718 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 719 | |
| | 720 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 721 | |
| | 722 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 723 | text-indent:-18.0pt'><span style='font-family:Wingdings'>Ø<span |
| | 724 | style='font:7.0pt "Times New Roman"'> </span></span><b>Def write_out():</b></p> |
| | 725 | |
| | 726 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'> </p> |
| | 727 | |
| | 728 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>This writes |
| | 729 | data to 000_config</p> |
| | 730 | |
| | 731 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>For this |
| | 732 | they would need to open the config using os.path.join and write data to the |
| | 733 | config in the correct format. </p> |
| | 734 | |
| | 735 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Like modules |
| | 736 | needs to be done in this format:-</p> |
| | 737 | }}} |
| | 738 | {{{ |
| | 739 | “deployment_settings.modules = Storge(\n” + |
| | 740 | |
| | 741 | #For for all keys |
| | 742 | “ “ + <?module.key?> "= Storage(\n” + |
| | 743 | |
| | 744 | #For all keys in module.keys |
| | 745 | “ “ + “ ” + <?keys of module.keys?> + “=” + <?values of their respective fields?> + “,\n” + |
| | 746 | |
| | 747 | " " + “),\n” #after module.key |
| | 748 | |
| | 749 | + “)” #for the main |
| | 750 | }}} |
| | 751 | {{{ |
| | 752 | #!html |
| | 753 | |
| | 754 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Writing |
| | 755 | settings will be much more easier, as they are not stored in dict, somewhat |
| | 756 | like:-</p> |
| | 757 | |
| | 758 | }}} |
| | 759 | {{{ |
| | 760 | For all keys of settings |
| | 761 | <?Keys of the settings ?> + “=” + <?values of the respective keys?> “\n” |
| | 762 | }}} |
| | 763 | {{{ |
| | 764 | #!html |
| | 765 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>I would |
| | 766 | write default values if any request.post_var returns an invalid value according |
| | 767 | to the validation.</p> |
| | 768 | |
| | 769 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 770 | style='color:#0D0D0D'> </span></p> |
| | 771 | |
| | 772 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 773 | style='color:#0D0D0D'>This part of the code needs to be done again. This should |
| | 774 | not take me more than a week and a half to complete this</span></p> |
| | 775 | |
| | 776 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 777 | style='font-size:15.0pt;line-height:115%;color:#0D0D0D'> </span></b></p> |
| | 778 | |
| | 779 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 780 | style='font-size:15.0pt;line-height:115%;color:#0D0D0D'>VIEWS</span></b></p> |
| | 781 | |
| | 782 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span |
| | 783 | style='font-size:15.0pt;line-height:115%;color:#0D0D0D'> </span></b></p> |
| | 784 | |
| | 785 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 786 | style='color:#0D0D0D'>Though we have not talked about this part directly, |
| | 787 | however in the last section of index(): function we have talked about the forms |
| | 788 | that I would like to create. Most part of this code can be reused from the |
| | 789 | previous application.</span></p> |
| | 790 | |
| | 791 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 792 | style='color:#0D0D0D'> </span></p> |
| | 793 | |
| | 794 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 795 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#0D0D0D'>v<span |
| | 796 | style='font:7.0pt "Times New Roman"'> </span></span><b><span |
| | 797 | style='color:#0D0D0D'>CREATING A LICENCE PAGE:</span></b></p> |
| | 798 | |
| | 799 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 800 | style='color:#0D0D0D'>This will be created only if “FINISHED_EDITING_CONFIG_FILE” |
| | 801 | is false in the modified_config.py</span></p> |
| | 802 | |
| | 803 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span |
| | 804 | style='color:#0D0D0D'> </span></p> |
| | 805 | |
| | 806 | <p class=MsoListParagraph style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 807 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#0D0D0D'>v<span |
| | 808 | style='font:7.0pt "Times New Roman"'> </span></span><b><span |
| | 809 | style='color:#0D0D0D'>SENDING POST METHOD TO GET THE ARGUMENTS TO CONTROLLERS</span></b></p> |
| | 810 | |
| | 811 | <p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm; |
| | 812 | margin-left:18.0pt;margin-bottom:.0001pt'><span style='color:#0D0D0D'> </span></p> |
| | 813 | |
| | 814 | <p class=MsoListParagraphCxSpFirst style='margin-bottom:0cm;margin-bottom:.0001pt; |
| | 815 | text-indent:-18.0pt'><span style='font-family:Wingdings;color:#0D0D0D'>v<span |
| | 816 | style='font:7.0pt "Times New Roman"'> </span></span><b><span |
| | 817 | style='color:#0D0D0D'>THESE WILL CONTAIN A STATIC FOLDER CONTAONG THE CSS AND |
| | 818 | THE </span>extjs </b></p> |
| | 819 | |
| | 820 | <p class=MsoListParagraphCxSpLast><b> </b></p> |
| | 821 | |
| | 822 | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>This part of |
| | 823 | the code is almost reusable.</p> |
| | 824 | }}} |