[web2py] beginner question: select first

2015-02-06 Thread Alex Glaros
can someone please consolidate my knowledge or tell me where in documentation this is explained the "first()" in this line below: this_message = db(db.InternalMessage.id == request.get_vars.filter).select() *.first()* allows below to work in view: {{=this_message.created_by.last_name}} if th

[web2py] Beginner question: separate styles of auth for two groups of users

2014-10-02 Thread Nick C
Hi, I have a few questions regarding the design of my app: -Let's say there are two types of users, "doctors" and "patients"; they have different properties. For example, a patient will specify his height and weight, but a doctor will not. I would like both patients and doctors to have to be r

[web2py] Beginner question: Plain HTML file for landing page instead of web2py app

2014-07-13 Thread Alex Glaros
Are there reasons for not using a plain HTML page for user landing page and having links from it to the w2p app? Index.html would be normal HTML file, not within w2p \...\web2py\applications\myProgram\views\default folder. Main reason I'm considering this that carousel is easier to set up

[web2py] Beginner question: foreign key constraint failed (?)

2014-03-27 Thread Krzysztof Socha
I created a simple table that uses another table as a list of possible values for a field: db.define_table('country', Field('name','string',length=DEFAULT_STRING_LENGTH)) db.define_table('company', Field('name', 'string', requires=IS_NOT_EMPTY(error_message=auth.messages.is_empty)), Field('addre

[web2py] Beginner question about DAL

2012-08-10 Thread Spez
Hi All, I am very new to web2py and in general to web framework. I am trying to read a db content from a remote machine, db is mysql, web2py version 1.99.7 stable. I have created a new simple application and added a model db1.py with: legacy_db = DAL('mysql://username:password@my_server:3306/tim

[web2py] beginner question 2

2010-09-02 Thread b vivek
Ok, I am unable to use the shell for checking out mysql db. I have the mysqldb driver installed and it works properly when I edit the controller and the model and can see the tables being created in mysql .. however when i use the shell, it does not work.. here are the commands I gave at the shell

Re: [web2py] Beginner Question

2010-07-07 Thread Jonathan Lundell
On Jul 7, 2010, at 7:29 PM, Bruno Rocha wrote: > Open a Python terminal, and try this example > d = {'id':1,'title':'web2py'} d > {'id': 1, 'title': 'web2py'} "Title for id %(id)s is %(title)s " % d > 'Title for id 1 is web2py ' Unfortunately, none of this explains how the label a

Re: [web2py] Beginner Question

2010-07-07 Thread Bruno Rocha
Open a Python terminal, and try this example >>> d = {'id':1,'title':'web2py'} >>> d {'id': 1, 'title': 'web2py'} >>> "Title for id %(id)s is %(title)s " % d 'Title for id 1 is web2py ' >>> 2010/7/7 Bruno Rocha : > Take a look to the String Formating and String Interpolation in Python > Documen

Re: [web2py] Beginner Question

2010-07-07 Thread Bruno Rocha
Take a look to the String Formating and String Interpolation in Python Documentation http://docs.python.org/library/stdtypes.html#string-formatting-operations 2010/7/7 ra3don : > I apologize for a seemingly simple question, but what exactly does '% > (title)s' do? I ran across it in the book in t

[web2py] Beginner Question

2010-07-07 Thread ra3don
I apologize for a seemingly simple question, but what exactly does '% (title)s' do? I ran across it in the book in the wiki section, the whole line reads. db.document.page_id.requires = IS_IN_DB(db, 'page.id', '%(title)s') Thanks in advance, ra3don.