On Thursday, April 15, 2010 11:23:15 selecta wrote:
> for request.args I can do
>
> request.args(0)
>
> and will return None if there is no such element, much nicer than
>
> request.args[0] if len(request.args)>0 else None
>
> I always wondered why this does not work for request.vars I have the
a little more as I am
> still learning MVC and Web2Py. In my PHP app multiple descriptions
> gave me the ability to host different formats of content for a single
> product. I could do plaintext and html descriptions for use in two
> different places.
>
> On Nov 9, 7:29 am, M
n/sql.py", line 1454, in
> _create_references
> raise SyntaxError, 'Table: table \'%s\'does not exist' %
> referenced
> SyntaxError: Table: table 'product_description'does not exist
>
> =
>
> On Nov 9, 6:55 am, Mladen Milankov
Hi.
When using reference you don't need the db. part. Only the name of the table.
Like:
Field('description', 'reference product_description'),
It uses the same database as the table you are just creating.
regards
mmlado
On Monday 09 November 2009 13:51:05 David wrote:
> So I have the followin
Hi.
I updated today to version 1.71.0, and there was a problem with the
_extra row.
When there are multiple fields that go into to _extra row, only one of
them is present. For example when getting separate sums for two fields
only the last one can be found in _extra.
I debuged a little and found
Hi.
Your missing a comma before the _title attribute.
regards
mmlado
On Thursday 29 October 2009 11:26:01 Doxaliber wrote:
> response.write(A(row.autori.nome_autore.title(), _href=URL(r=request,
> f="autore", args=row.autori.id) _title="visualizza autori"))
>
> ^
> SyntaxError: invalid syntax
Hi.
Try:
num = 1
SELECT(OPTION('candy',_value=1),OPTION('chocolate',_value=2), value=num)
The SELECT will give selected to the option which has the value of num.
regards
mmlado
On Thursday 22 October 2009 05:26:32 Avik Basu wrote:
> Sorry, my example was too simplistic for what I am trying to
Hi.
You could try:
solution = db(db.solution.id.belongs((request.args[0], request.args[1],
request.args[2], request.args[3], etc...))).select()
belongs translates to IN in sql. It accepts a list of parameters to which the
field will be compared.
regards
mmlado
On Monday 28 September 2009 11:
Hi.
I think it's a bug in rewrite.py modul.
If you open the file, it's in gluon directory, on line 54 you can see the
following:
if k.find(':/') > 0:
i = k.find(':/')
k = r'%s:https?://[^:/]+:[a-z]+ %s' % (k[:i], k[i+1:])
Think this should insert regex part for the domain when written
Hi.
executesql will return results in "natural" form, as the library gives it.
Don't know for others, but mysql (try for others), will return a list of
tuples of results.
In your case:
person.ip_user is person[0]
person.strafb1 is person[1]
try this:
{{for person in results:}}
{{=person[0]
Hi.
I tried it and it didn't work, and then looked at it with firebug and changed
it a little. The ul that contains the menu has the class menu, in this case.
As you wrote the css, it says ul which is somewhere in some element with class
menu.
So I changed the definitions like this:
ul.menu{
Hi.
Don't know how does your code for the menu look like, but I'll assume you're
using the built-in function MENU.
So if you have something like this:
{{=MENU(response.menu, _class = 'web2py-menu web2py-menu-vertical')}}
just change the vertical to horizontal, like:
{{=MENU(response.menu, _c
Hi.
Hmm... I thought designers know javascript. At least for design things like
this... :)
Try something like this.
Give a class to the element that needs the click action. You can reference
elements in a jquery through any valid css selection. This way you can get all
the elements and assig
Hi.
1.
If you want to open a file you have to give the file with path on the file
system
and not through url.
I do like this:
import os
filename = os.path.join(request.folder, 'modules', 'appsettings.py')
request.folder contains the path to the current application
2.
I think it's bad idea to
Hi.
When you use multiple tables in a query, it return DALStorage object in
DALStorage object for each table you requested. Simpler every row object is a
dict which contains dict object for each table.
try:
{{for review in reviews:}}
{{=review.reviews.headline}}: {{=review.users.username}}
Hi.
Try:
{{=IMG(_src=URL(r=request, c='static', f='Tux.jpg'))}}
Everything you want to write out in the view, from python code needs =
like: {{=variable}}
regards
mmlado
On Thursday 06 August 2009 16:36:11 Johann Spies wrote:
> I am trying my first web2py page and I am wasting hours even afte
Hi.
The id of inserted records will be in form.vars.id, assuming you call the
form, form.
Like:
if form.accepts(request.vars, session):
id = form.vars.id
regards
mmlado
On Thursday 06 August 2009 10:43:26 max wrote:
> i am inserting Form values into a postgres database.
> For on-the fly
Hi
On Saturday 01 August 2009 16:47:41 Pynthon Pynthon wrote:
> Hey
>
> Maybe I will switch back to Web2Py but I still have some questions :P.
>
> 1. Why it is here http://pastebin.com/f4c8cd718 db().select(query) and here
> http://pastebin.com/m291dbd6d db(query).select?
Simply: first parenthes
Hi.
IS_IN_SET works alone, not in combination with other validators.
Anyway IS_NOT_EMPTY is not required because the field must have one of the
values given in IS_IN_SET.
try:
db.pampa_classificacaocliente.aceita.requires=IS_IN_SET(['Sim', 'Não'])
regards
mmlado
On Thursday 30 July 2009 15:00
Hi.
Problem is in line:
db.Field("password", ‘password’,readable=False, label="Password"),
It's the ‘ which isn't a real apostrophe. ' this is. It looks like it, but
when I copy/pasted your code, syntax highlighting didn't mark it as a string.
Try replacing it.
regards
mmlado
On Wednesday 29
Hi.
You need to define the type of the field, the IS_DATE is only a
validator that will check the values before insert/update.
Use:
db.define_table('users',
SQLField('dob', 'date',requires=IS_DATE()),
regards
mmlado
On Wed, Jun 3, 2009 at 4:36 PM, durga wrote:
>
> Hi,
>
> i have defined a
Hi.
Do something like this:
form = SQLFORM(db(db.company),fields = ['compname','designation','location'])
if form.accepts(request.vars, session):
db(db.company.id == form.vars.id).update(userid = session.userid)
# do something else like redirect if needed
The id of the new record can be
Hi.
There's a parameter to SQLFORM, showid which is True by default. Just set it
to False.
Like:
form = SQLFORM(db.users,user,fields=['firstname','lastname'], showid = False)
regards
mmlado
On Wednesday 03 June 2009 08:32:16 durga wrote:
> Hi ,
>
> I have created a table for user. to update
Hi.
You don't need the [] brackets.
use:
db.define_table('user',
db.Field('sex', requires = IS_IN_SET(['male', 'female'])))
regards
mmlado
On Tuesday 02 June 2009 13:39:35 durga wrote:
> hi
>
> I would like create a form through SQLFORM in which one of my field to
> be generated as combo b
Hi.
You'll need to add html for formating in the view. You can also add the XML
helper if you want to have html code in the post. Like:
{{for post in posts:}}
{{=post.titel}}
{{=post.time}}
{{=XML(post.post)}}
{{pass}}
regards
mmlado
On Saturday 25 April 2009 13:0
Hi.
For the html editor, wouldn't know to recommend.
When you got the post for the blog, just put it into XML() helper. Like:
XML(post) This way it won't be escaped.
regards
mmlado
On Saturday 25 April 2009 12:54:44 Pynthon wrote:
> BTW, is there also something like a editor for my blog. Becau
13 Pynthon wrote:
> But I see that there is also with profiles etc.
>
> On Apr 25, 12:45 pm, Mladen Milankovic wrote:
> > Hi.
> >
> > You can do something with the auth class.
> > Here some tutorial about
> > it.http://mdp.cti.depaul.edu/examples/default/tools
Hi.
You can do something with the auth class.
Here some tutorial about it.
http://mdp.cti.depaul.edu/examples/default/tools
You can expose only functions for login/logout. Create a user by hand, through
web2py admin.
Then create controllers/functions that requires authorization.
For the safety
Hi.
I'm assuming you have some query from where you take the posts.
In the select part there's a parameter orderby. To give it to sort it in
reverse order just write the sign ~ in front of the orderby parameter.
example
db(some_query).select(db.table.ALL, orderby = ~db.table.field)
regards
mml
Hi.
I'm testing things out and I think got a bug.
I'm trying to get root on localhost to show /my_app/default/index page and not
the example, so I wrote:
routes_in = (('^.*?:https?://localhost:[a-z]+ /$', '/my_app/default/index'), )
It didn't work, and I throw in some logging. I watched what
Hi.
Thank you very much. This is more powerful and more useful then what I did. I
see I have a lot to learn.
regards
mmlado
On Thursday 16 April 2009 19:57:47 mdipierro wrote:
> A request comes in and you want to redirect it to a controller action
> filtering by
> - IP of client (for example 1
Hi.
You can do this with the routes.py file.
Something like:
routes_in = ( ('^/([^\/]+)/?$', '/app/cont/function/$1'), )
with the patern [^\/]+ I make sure the param doesn't contain / characters.
This way if it happens that it's http://my_site/my_app/cont/func it will still
work and not redir
32 matches
Mail list logo