One way is to insert these lines in the user() function:
db.auth_user.first_name.writable=False
db.auth_user.first_name.readable=False
db.auth_user.last_name.writable=False
db.auth_user.last_name.readable=False
I have this field
db.define_table('B',
Field('my_table', db.A, notnull=False, ondelete=SET NULL),
db.B.my_table.requires = IS_EMPTY_OR (
IS_IN_DB(db(db.A.author_id==auth.user_id),
db.A.id, '%(title)s'))
That means that my_table can have references from A but only the
Hello all
I have the following crontab file:
#crontab
@reboot cht *applications/atvestpp/modules/SchedulerDownload.py
In the applications folder, I have a simbolik link 'init' pointing to
my application 'atvestpp'.
When I started the web2py server, two instances of
SchedulerDownload.py are
relative url in css have to work, have nothing to do with web2py.
My files are:
static/css/myfont.eot
static/css/layout.css
My def:
src: url('myfont.eot');
My files are:
static/css/fonts/myfont.eot
static/css/layout.css
My def:
src: url('fonts/myfont.eot');
2011/11/30 monotasker
I have one application in web2py
This application executes somes instructions for me in my sql bank
One this make download of one table choosed in one directory
I put one file called produtos.csv in directory called requisicao
And then the application make download of table called
Great! It works. This is so fantastic. I love the way stuff works in
web2py. Thanks Massimo.
Thanks Rahul D (www.flockbird.com - web2py powered)
On Nov 29, 7:16 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
gird(,...user_sigature=fFalse)
than do your own authentication outside
Is there a way to change the submit button into clickable text (like
an _href) next to a field?
Lets say i have this form:
form = SQLFORM.factory(Field('my_table'))
Hello all of you ,
I need a help from web2py group actually i want to develop feedback
from for my website so for thats i'm using this controller code and
this code is working when, i'm using rock server with smtp and when i
use with 'gae' with google appengine it not working so
so i need your
I have got the select function of mongodb adapter working, but know I
need to convert a pymongo cursor to row.
The point is the pymongo supports nested documents and that can be a
bit hard to convert for a parameter of the parse method.
Here is the select function a have ajusted, but this one
Are you sure this works when not on GAE -- looks like there are some
problems even in that case? More below...
def mailid():
#import Mail
from gluon.tools import Mail
mail=Mail()
No need to instantiate mail with Mail() if you are going to use
auth.settings.mailer
I get this:
type 'exceptions.SyntaxError' invalid syntax (user_agent_parser.py,
line 214)
This is the line:
prefs = dict(browser=[Microsoft Internet Explorer, 'Firefox'],
dist=['WindowsMobile'] flavor=None)
Should be (comma is missing):
prefs =
I found the solution myself
In order to save the change i have to use: update_record
On Nov 30, 12:07 pm, thodoris pasxi...@gmail.com wrote:
I have this field
db.define_table('B',
Field('my_table', db.A, notnull=False, ondelete=SET NULL),
db.B.my_table.requires = IS_EMPTY_OR (
On Wednesday, November 30, 2011 6:07:16 AM UTC-5, thodoris wrote:
db.B[id].my_table = None
db.B[id] is a Row object (i.e., the result of a select), not a reference to
the db record. So, you are simply changing the value in the Row object, not
the db. To change the value in the db, you can do:
Web2py default layouts certainly have come a long way since the (IMHO,
quite awful :p ) fluorescent orange and black-green looks.
I do seem to miss some best-practices documentation about how to
effectively apply themes to a web2py application. The downloadable
themes do not always properly
Thanks.
Or if you really don't want to use them for any purpose, you can create a
custom auth_user table without
them: http://web2py.com/book/default/chapter/08#Customizing-Auth
On Wednesday, November 30, 2011 3:19:18 AM UTC-5, pbreit wrote:
One way is to insert these lines in the user() function:
Hi guys,
I created two links:
a
href={{=URL('default','user',args='login',vars=dict(next=request.env.path_info))}}login/a
a
href={{=URL('default','user',args='register',vars=dict(next=request.env.path_info))}}register/a
The first link (login) works. After logging in, the user is redirected
should be _next
http://zerp.ly/rochacbruno
Em 30/11/2011 12:46, lyn2py lyn...@gmail.com escreveu:
Hi guys,
I created two links:
a
href={{=URL('default','user',args='login',vars=dict(next=request.env.path_info))}}login/a
a
And how did I miss that??
Thanks Bruno!
Funny behavior?:
* I used next and it worked for the login link.
* if I used auth.login(_next=...) and an error tells me I can't use
_next (I have to use next) - but I didn't try what works with
auth.register(_next or next?)
On Nov 30, 10:52 pm, Bruno
Very nice! Thank You!
If I want to create a link from a string, is there a function in
web2py to do that?
For example I have a post title Today is Wonderful! and I want to
create
/blog/show/today-is-wonderful
instead of
/blog/show/today-is-wonderful%21
which gives a Invalid Request error...
Thanks!
Is there a way to change the submit button into clickable text?
Lets say i have this form:
form = SQLFORM.factory(Field('my_table'))
and i can do
table = form.element() to get the element
table.append(INPUT(_type='submit', _value='submit')): this appends the
submit button next to the
I love the framework but hate the name Web2py
Everyone uses names related to animals, objects,etc. At least it gives a
better change for a nice logo.
Best regards
2011/11/30 stefaan stefaan.hi...@gmail.com
Web2py default layouts certainly have come a long way since the (IMHO,
quite awful :p
If you're receiving the title from a form submission, you can use the
IS_SLUG validator on the title field, which will convert it to a slug
(remove non-alphanumeric characters and convert spaces to hyphens). You can
also use the validator on it's own:
title_slug = IS_SLUG()('Today is
web2python.
we have 'web' an object and 'python' an animal :)
http://zerp.ly/rochacbruno
Em 30/11/2011 13:16, António Ramos ramstei...@gmail.com escreveu:
I love the framework but hate the name Web2py
Everyone uses names related to animals, objects,etc. At least it gives a
better change for
On Wednesday, November 30, 2011 10:00:05 AM UTC-5, lyn2py wrote:
And how did I miss that??
Thanks Bruno!
Funny behavior?:
* I used next and it worked for the login link.
Are you sure the 'next' value for login isn't being set somewhere else (or
isn't simply the default 'index')? Using
I love the framework but hate the name Web2py
Honestly, I agree. Django sounds cool but not web2py. I like gluon
better :)
On Nov 30, 9:16 am, António Ramos ramstei...@gmail.com wrote:
I love the framework but hate the name Web2py
Everyone uses names related to animals, objects,etc. At least it
On Tue, Nov 29, 2011 at 1:39 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
sorry it took me a while
SQLFORM.widgets.string.widget and SQLFORM.widgets.date.widget
are the same.
I couldn't find anything in the docs about it. Reading there, we are
lead to face them as different
Hello,
Thanks for the help.
I'll perform the request in 2 steps to achieve the results.
On 30 nov, 04:09, monotasker scotti...@gmail.com wrote:
When I've done date-related operations I've had to use the python datetime
and calendar modules. They're both in the standard library so you can just
*db.define_table('pages',*
*Field('title', unique=True, notnull=True),*
*Field('slug', unique=True)*
*)*
*db.pages.slug.compute = lambda row: IS_SLUG()(row.title)[0]*
On Wed, Nov 30, 2011 at 1:24 PM, Anthony abasta...@gmail.com wrote:
If you're receiving the title from a form
On Wed, Nov 30, 2011 at 1:15 PM, thodoris pasxi...@gmail.com wrote:
table.append(A('Submit',_type='submit', _value='submit')))
table.append(A('Submit',_href=#, _onclick=$('form').submit()))
--
Bruno Rocha
[http://rochacbruno.com.br]
table.append(A('Submit',_href=#, _onclick=*$('form').submit(); return
false;*))
You shoould define an id to form if you have more than one form in a page.
*$('#form_id').submit(); return false;*
--
Bruno Rocha
[http://rochacbruno.com.br]
You can do this or equivalent using web2py helpers:
a class=button onclick=$(this).prevAll('form').submit();\Submit/
a
On Nov 30, 3:15 pm, thodoris pasxi...@gmail.com wrote:
Is there a way to change the submit button into clickable text?
Lets say i have this form:
form =
Just got the same with firefox on windows
(dp1
S'output'
p2
Stype 'exceptions.SyntaxError' invalid syntax (user_agent_parser.py,
line 214)
--
Bruno Rocha
[http://rochacbruno.com.br]
Note, this is also causing 'admin' to fail. I submitted a ticket.
On Wednesday, November 30, 2011 12:19:48 PM UTC-5, rochacbruno wrote:
Just got the same with firefox on windows
(dp1
S'output'
p2
Stype 'exceptions.SyntaxError' invalid syntax (user_agent_parser.py,
line 214)
--
Hello,
I have the following models for Operations.
db.define_table('operations',Field('date','date'),Field('budget',db.budgets),Field('title','string'),Field('amount','double'),format='%
(budget)s-%(amount)d-%(date)s:%(title)s')
I'm performing the following query to get the total amount of
Chapter 8 says, All of the methods above can be extended or replaced by
subclassing Auth. However, it does not give the best place to add the code
to do so. There is mention of adding to your model, but I'm a little
unclear about that too.
It seems that the models are imported in order, since
Thanks, I'll use this for now.
I just removed the {{is_mobile=request.user_agent().is_mobile}} from the
*/layout views and admin controller
it worked..
On Wed, Nov 30, 2011 at 4:03 PM, Anthony abasta...@gmail.com wrote:
Note, this is also causing 'admin' to fail. I submitted a ticket.
On Wednesday, November 30, 2011
+1 for Webfaction. It takes a bit of tweaking and configuration to get your
app running with the cheapest plan without hitting the RAM limit (which is
what I suspect some of the mentioned issues were) but once it's up and
running, it works great. I have my apps running on Lighttpd and couldn't
Dont do it in models, do in /modules
in modules/myauth.py
from gluon.tools import Auth
form gluon import *
class MyAuth(Auth):
def __init__(self):
#do whatever you want here
Auth.__init__(self)
in any place of app (model, controller)
from myauth import MyAuth
auth =
There is an error on line 214 of gluon/contrib/user_agent_parser.py,
should be:
dist=['WindowsMobile'], flavor=None
2011/11/30 Bruno Rocha rochacbr...@gmail.com:
I just removed the {{is_mobile=request.user_agent().is_mobile}} from the
*/layout views and admin controller
it worked..
On
Or you can just add that missing comma to user_agent_parser.py.
On Wednesday, November 30, 2011 1:11:49 PM UTC-5, rochacbruno wrote:
I just removed the {{is_mobile=request.user_agent().is_mobile}} from the
*/layout views and admin controller
it worked..
On Wed, Nov 30, 2011 at 4:03 PM,
I used the following example:
http://web2py.com/book/default/chapter/06?search=sum#sum,-min,-max-and-len
I created your operations table, but not the budget table:
sum = db.operations.amount.sum().coalesce_zero()
monthly_amount = db((db.operations.date.year()==current_year)
...
Thanks. Modules is actually where I started to put it last night, but
decided I should ask the question, since I really want to learn web2py well.
It is probably useful to see the following as well:
sum = db.operations.amount.sum().coalesce_zero()
sum
gluon.dal.Expression object at 0x12e68d0
print sum
COALESCE(SUM(operations.amount),0)
monthly_amount_first = db((db.operations.date.year()==current_year)
...
Hi All:
I've this situation:
Based in a config file, the app must read /modify rows from some table,
i.e. tableA BUT if in config file have setted an test mode must
read/modify rows from another tables. i.e. tableA_test
So, in db.py i read if is setted test mode or not, and then initalize
I would keep using that url, but it includes my app name -- a problem since
I'm trying to build a presentation *plugin* that includes the font-face
embedding. So I need a url that begins above the appname folder.
I'll try these again. So far they didn't seem to work for me.
Also, what do you need to do exactly? There are some customizations
available that don't require sub-classing.
I can't answer your question specifically, but if you were to rewrite your
code, you could use db.get() to get your table.
tableA = db.get(table_name)
You could then set table_name based on whether test mode was set or not.
I have downloaded a plugin from http://dev.s-cubism.com/plugin_solidform
It consists of two files:
- controller/plugin_solidform.py (demo)
- *modules/plugin_solidform.py* (the actual plugin)
When using the exact same command as in the provided example:
from plugin_solidform import SOLIDFORM
On Wednesday, November 30, 2011 3:13:54 PM UTC-5, juanduke wrote:
Maybe something like: db['tableA'] = db.tableA_test and then the rest of
the code, always reference: db.tableA.etc
Yes, I think you can do that, or just:
db.tableA = db.tableA_test
That may cause problems in some cases,
If you use the relative URL static/..., what does the browser resolve it to?
On Nov 30, 2011, at 12:55 PM, monotasker scotti...@gmail.com wrote:
I would keep using that url, but it includes my app name -- a problem since
I'm trying to build a presentation *plugin* that includes the font-face
Good question. I want to override retrieve_username(). Of course, I expect
I'll eventually want to override any of the methods exposed by Auth. If
there is another way, I would prefer it.While subclassing is easy, it may
be overkill.
try:
#get/set something with memcache
except:
#get/set from DB (or other authoritative source)
Hi Anthony,
Thanks for the clarification.
Regarding:
Are you sure the 'next' value for login isn't being set somewhere else (or
isn't simply the default 'index')? Using 'next' (rather than '_next') in
the URL should not work.
I'm new to this, and I am not sure if the 'next' value isn't being
I'm not sure, what do you want to do?, or why do you need to include app
path?. But you can also make it this in the view to make use of URL() in
the view or layout include the tag style simil to this:
style type=text/css
...
@font-face {
src: url('{{=URL('static','myfont.eot')}}');
}
/style
Thanks Anthony.
That's interesting syntax to use a validator!
Yes it works :)
On Nov 30, 11:24 pm, Anthony abasta...@gmail.com wrote:
If you're receiving the title from a form submission, you can use the
IS_SLUG validator on the title field, which will convert it to a slug
(remove
On Wednesday, November 30, 2011 5:16:59 PM UTC-5, lyn2py wrote:
Thanks Anthony.
That's interesting syntax to use a validator!
Well, the validators are mostly intended to be used for validating form
fields. They are callable objects, so you instantiate a validator like
IS_SLUG(), which is an
On Nov 30, 2011, at 2:15 PM, Martín Mulone wrote:
I'm not sure, what do you want to do?, or why do you need to include app
path?. But you can also make it this in the view to make use of URL() in the
view or layout include the tag style simil to this:
style type=text/css
...
@font-face
I'm going through the official book, currently at the DAL chapter. I'm
having confusions over query and set objects.
for e.g.
1. To fetch rows one uses , rows = db(db.mytable.myfield!=None).select()
it returns a collection of rows, that is fine. But, what is a 'set'
then? Isn't 'rows'
I guess you can think of a collection and set as the same thing. The key is
that you can iterate through it like:
for row in rows:
if row.myfield == 'Joe':
...
That's just a style thing if you want to separate out the query from the
rest of the db() function.
OK, I think that probably requires subclassing. I subclassed once for
customizing the navbar but ended up just creating my own navbar independent
of auth. I don't recall it being too bad.
On Wednesday, November 30, 2011 5:41:34 PM UTC-5, Chandra wrote:
I'm going through the official book, currently at the DAL chapter. I'm
having confusions over query and set objects.
for e.g.
1. To fetch rows one uses , rows = db(db.mytable.myfield!=None).select()
it returns a
On Thu, Dec 1, 2011 at 4:31 AM, Anthony abasta...@gmail.com wrote:
On Wednesday, November 30, 2011 5:41:34 PM UTC-5, Chandra wrote:
I'm going through the official book, currently at the DAL chapter. I'm
having confusions over query and set objects.
for e.g.
1. To fetch rows one uses ,
this should be simple but it is not working right. All i am trying
to do is insert form variables into the database and make sure
duplicates are not inserted. I would imagine the controller is
bypassing the db.requires, but i am a newbie and don't understand why
it is being bypassed. What is
2. A query object represents a sql 'where' clause like, myquery =
(db.mytable.myfield != None) | (db.mytable.myfield 'A')
Can't the same thing be done like, rows =
db((db.mytable.myfield!=None) | (db.mytable.myfield 'A'))
what is the need of having a query object?
What is
Good thing you mentioned Bruno's solution. It appeared as show quoted
text to me, and at first glance didn't look like it contained new
text. *sorry Bruno!*
Just a side question on best practices, where should I put my little
lambda so that all files (and functions) in my app can use it? Geez,
On Thu, Dec 1, 2011 at 5:26 AM, Anthony abasta...@gmail.com wrote:
2. A query object represents a sql 'where' clause like, myquery =
(db.mytable.myfield != None) | (db.mytable.myfield 'A')
Can't the same thing be done like, rows =
db((db.mytable.myfield!=None) | (db.mytable.myfield
p.s. Should i be adding something to my post to show that a question
is solved, like they do on stackoverflow? i saw somebody do that on
this forum and did not know if I should be doing the same.
Most people don't, but I suppose you could add [SOLVED] to the subject, or
something like
On Wednesday, November 30, 2011 6:56:50 PM UTC-5, lyn2py wrote:
Good thing you mentioned Bruno's solution. It appeared as show quoted
text to me, and at first glance didn't look like it contained new
text. *sorry Bruno!*
Just a side question on best practices, where should I put my little
Thanks Anthony!
I must have skimmed over this part of the book. I got it now.
chawk
Note, the 'requires' argument to Field sets validators for form
submissions
-- it does not affect regular insert() or update() methods on the table.
The validate_and_insert() and validate_and_update()
Hello,
I was previously using the binaries, and hadn't run into this error
before.
I just downloaded and run from source, and ran into:
class 'gluon.rocket.SocketTimeout'(Socket timed out before request.)
Why did I encounter this issue and how do I resolve it?
Thanks!
Gotcha!
On Dec 1, 8:19 am, Anthony abasta...@gmail.com wrote:
On Wednesday, November 30, 2011 6:56:50 PM UTC-5, lyn2py wrote:
Good thing you mentioned Bruno's solution. It appeared as show quoted
text to me, and at first glance didn't look like it contained new
text. *sorry Bruno!*
I think that it would be practical to have the option when calling
SQLTABLE to specify images in place of id links.
Here is how i would change it (seems to work with version 1.99.2)
diff -r 7dd85a51bb2a gluon/sqlhtml.py
--- a/gluon/sqlhtml.py Tue Nov 29 22:32:30 2011 -0600
+++
Instead, why not make it more general and simply allow the linkto lambda to
return an (r, href) tuple, where r could be an IMG object or anything else.
Something like:
elif linkto and field.type == 'id':
try:
href = linkto(r, 'table', tablename)
if isinstance(href, (list,
Here is a working example and the corresponding googlecode project used to
create it that you can use as a reference. FYI squirrelfont has a nice
automated system that allows you to create font packages that include
most of what you will need. I used if for the following project.
Running
This is a trifle behavior that I experience every time I create a new
simple application from the admin interface. For some reason, the new
app gets compiled. I'm running Ubuntu 10.04 and running web2py from source.
I need to press the remove compiled to proceed with editing the new app. I've
Arghh... for some reason or another, I lost my:
auth.define_tables()
Thanks for the feedback Massimo.
On Tuesday, November 29, 2011, Nik Go wrote:
I've been deleting tables and playing around with various settings, so I
don't know what I've done exactly but now my app lost the links for
I needed an advanced profile for a registered user with fields coming from
another table. Since I want to keep the same auth_user profile link, I
thought I'd used a virtual field in the auth_user table to display a link
to the other table.
class VFprofile(object):
def
their install script setup needs to be changed to use less memory by
default. Seems quite a few people have contacted their support about this.
That sound peculiar Richard. Could we get a little more info on your load
test? Where are you getting the 45% and 100% figures from, the Gnome
monitoring applet? If it is an app you can share, I could try the same
setup on a similar system for you.
Chris
I made a new diff with Anthony suggestions: Now any helper instance
can be returned by lambda as a second argument.
diff -r 7dd85a51bb2a gluon/sqlhtml.py
--- a/gluon/sqlhtml.py Tue Nov 29 22:32:30 2011 -0600
+++ b/gluon/sqlhtml.py Thu Dec 01 00:44:05 2011 -0300
@@ -1972,6 +1972,8 @@
Are your servers behing a load balancer? If so, do you have sticky
sessions? If not you may run into trouble if two servers try access
the same session.
On Nov 30, 1:25 am, Rohan yourbuddyro...@gmail.com wrote:
web2py version: 1.98.2
I have two servers with shared database and I am trying to
you just should not do this:
Field(...,default=request.args(0))
in models.
You can do (as a workaround)
if request.args:
db.table.field.default=request.args(0)
but I still would not do it this way. Instead do in the controller
where you need it:
def myaction():
Mind that with this change anybody who can intercept your network
traffic can get full access to your account.
On Nov 30, 1:55 am, Angelo Compagnucci angelo.compagnu...@gmail.com
wrote:
Get the trunk!
If you want to use the admin app whitout setting aup https in a
private environment, you
Please submit a ticket about this. Althought I am not sure how to fix
this because web2py will think you have two apps.
On Nov 30, 4:54 am, dsanchez dsanchezll...@gmail.com wrote:
Hello all
I have the following crontab file:
#crontab
@reboot cht
Are there a way to use trailing slash after page name like: /about/
This is because jQuery Mobile requires it to work properly. Otherwise
it adds a hash '#' after redirection which prevents from form submitting.
I had a lot of issues with the hash which is generated and initially
disabled Ajax
I do not like names that have google search conflicts. Others like
that because their search results go up.
We had a different name and I was threatened to be sued. I spend $500
to trademark web2py.
Can anybody find a better name that has no search conflicts, is not
trademarked, and is willing to
I would consider this an improvement. Please open a ticket.
On Nov 30, 9:46 am, Vinicius Assef vinicius...@gmail.com wrote:
On Tue, Nov 29, 2011 at 1:39 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
sorry it took me a while
SQLFORM.widgets.string.widget and
sorry. fixed.
On Nov 30, 12:21 pm, Anthony abasta...@gmail.com wrote:
Or you can just add that missing comma to user_agent_parser.py.
On Wednesday, November 30, 2011 1:11:49 PM UTC-5, rochacbruno wrote:
I just removed the {{is_mobile=request.user_agent().is_mobile}} from the
It gets compiled without you clicking the button?
On Nov 30, 8:44 pm, Nik Go nikolai...@gmail.com wrote:
This is a trifle behavior that I experience every time I create a new
simple application from the admin interface. For some reason, the new
app gets compiled. I'm running Ubuntu 10.04 and
JQuery Mobile + web2py presents unique challenge because JQuery Mobile
takes over control after server side. One issue I had was with redirections
which does not work properly in this environment. JQuery Mobile recognized
this and added an option how to make this working properly by returning
OK, now I get it. {gigantic knowing smile}, You are right, the Web2py
solution of changing the database line would not work in this particular
situation.
In a nutshell something that wold work is this: Start over and use either
w2p_clone or [ w2p_apps and w2p_run ] but never ever mix them in
Hi,
I'm obviously super new at this. I appreciate any gentle pointers,
guidelines and best practices on when to use classes when writing code
with web2py (and/or python for that matter).
I ask this because:
- In Ruby on Rails, everything is put under a class of some kind
- I have briefly seen a
A possibly related (and possibly unrelated) data point:
I've always been running from source. Occasionally, when I try to read
request.body I get a socket timeout, even though exactly zero seconds have
passed, and the timeout is set at 60 seconds.
Running the same request again (it's
Folks,
I've just released i-Trac
i-Track is a simple issue/bug tracking system developed in web2py, it
is Open Source Software released under the Simplified BSD License, the
site is live at:
http://www.i-track.org/
There is a demo site also at http://demo.i-track.org/ feel free to
use to test
On 30 November 2011 23:08, haikuvend Resident haikuv...@gmail.com wrote:
I have downloaded a plugin from http://dev.s-cubism.com/plugin_solidform
Did you install the plugin in your app? The easiest way is through the
admin interface.
Regards
Johann
--
Because experiencing your loyal love is
Currently, there are two ways exceptions are handled in web2py:
If the controller/view does *NOT* use try: except:, and an exception is
raised, then it is very helpfully logged in the ticket system, and a
somewhat-useful message (that can be customized a little, see e.g.
1 - 100 of 102 matches
Mail list logo