Thanks! I'd be glad to get help about the last two issues I described.
On Feb 4, 7:43 pm, Kenneth Lundström <kenneth.t.lundst...@gmail.com> wrote: > The model files will be executed in alfabetical order. So there is a > difference. > > Kenneth > > ----- Ursprungsmeddelande ----- > > > > > > > > > Thanks for your reply. Regarding the first answer: does it mean that > > every model from my app will be called on every page refresh? Do the > > names of the model files have any effect? I.e. if I rename db.py to > > mydb.py, or change "0.py" to something else - what will happen behind > > the scene? > > > Regarding my third question: the tree structure is something that I > > did understand. The problem is an error which makes me think that I do > > something wrong. While trying to perform the described above, I the > > following traceback: > > > Traceback (most recent call last): > > File "C:\Users\viu\Desktop\web2py\gluon\restricted.py", line 188, in > > restricted > > exec ccode in environment > > File "C:\Users\viu\Desktop\web2py\applications\Registrar/views > > \default/index.html", line 99, in <module> > > AttributeError: 'NoneType' object has no attribute 'replace'. > > > I have index.html with "include 'default/user.html'". user.html > > doesn't have extend. > > > Regarding my last question, I will try to clarify: I found out that > > after uploading the app to GAE, the example records are being added to > > my app at GAE. I.e. I have: "Sacemoso Mamaduco Dacotata > > papapato@exam...." in my online app. I have already cleared my GAE > > datastore once. > > > Thanks again. > > > On Feb 4, 6:10 am, Massimo Di Pierro <massimo.dipie...@gmail.com> > > wrote: > > > On Feb 3, 8:27 pm, devGS <vitali....@geniestills.com> wrote: > > > > > Hi, I have a few general questions, answers for which I didn't find > > > > in the book: > > > > 1. How does the model work in web2py's MVC? What is the workflow? > > > > When does the code from those files called? The only relevant > > > > information I found was the sequence diagram from the book. > > > > yes this is an important omission. > > > at every http request, all models are executed in the same > > > environment. Then environment is copied. The requested controller is > > > executed and the called function is called. The output dict() is added > > > to the copied environment and passed to the view. The output is > > > returned to the visitor. > > > > > 2. How does the following form of passing arguments in Python work: > > > > cache.ram.clear(regex='...')? I come from Java, as I understand regex > > > > is some kind of an optional value to be passed? > > > > regex is any regular expression. All keys in the cache matching the > > > regular expression are deleted from the cache. > > > > > 3. How do the layouts work (layout as a pattern that is being used in > > > > the views)? I tried to do the following, which sometimes works and > > > > sometimes not, providing errors: remove the {{extend 'layout.html'}} > > > > from some view, i.e. "myview.html" and add {{include "myview.html"}} > > > > into a second view. Mainly, it works, but when I try to remove > > > > {{extend 'layout.html'}} from "default/user.html" and add {{include > > > > 'default/user.html'}} into "index.html", it fails. Why, and how to do > > > > it properly? > > > > Think of a tree. Each node is an HTML file. You move up by calling > > > extend. You move down by calling include. The parent should have a > > > simple {{include}} not {{include "child.html"}} where the extending > > > child is to be inserted. This is in the book in some detail. > > > > > 4. I understood that in order to manipulate my database from GAE, I > > > > need to index my tables. Where can I find information about indexing > > > > and what is it? > > > > You only need this for speed. You have to do this in sql > > > > db.executesql("....") > > > > > 5. While uploading my app into GAE, I find the example entries inside > > > > my online GAE app. Why is that and how to prevent it? > > > > I am not sure I understand this question.