Where do I insert the code? In model?
this is now my code in db.py
if session['school_db'] != request.cookies['mycookie'].value:
auth.logout()
session['school_db'] = request.cookies['mycookie'].value
But I get an error
'NoneType' object has no attribute 'insert'
seems like
For controler you mean the user controler?
Or do I create a new one?
this is my current user controler
def user():
form = auth()
if request.vars.msg:
response.flash = 'u'Registracija je v postopku odobritve. Ko bo
vaš račun potrjen boste o tem obveščeni preko e-maila.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
Traceback (most recent call last):
File /Users/web2py/gluon/restricted.py, line 209, in restricted
exec ccode in environment
File
If I put session.clear() into the controler of the default page it works
Is that I good solution? It is true that a user has to log in again but it
kind of works
On Monday, September 24, 2012 8:48:03 AM UTC+2, Yebach wrote:
Where do I insert the code? In model?
this is now my code in db.py
No news about workflows in web2py?
2012/4/16 António Ramos ramstei...@gmail.com
For me, the advantage i see is to centrally manage(create,change,edit,etc)
all workflow rules of all apps that use workflow.
maybe there is some disadvantagesomewhere else on the line ...
2012/4/16 Carlos
In web2py 2.0.9 source I'm printing a variable which is a string including
the substring timestamp1
which gets rendered in the debugger as x (that is, times become the
cross being a multiplication symbol
If I reverse the string, it shows what I expect.
The minimal testcase is to do this in the
As indicated in the title, I'm using 2.0.9, which is latest as of now.
On Sunday, September 23, 2012 4:41:15 PM UTC-5, Massimo Di Pierro wrote:
What version are you using?
This is what I get:
db=DAL()
product = db.define_table('product', Field('cost1'), Field('cost2'),
Field('total',
This survey couid inspire someone
http://snarfed.org/workflow_software_survey
--
Dear Yebach ,
just add this in the default/school in the controller :
if request.vars.school == 'database':
response.flash = 'your_Massage!'
Notes :
check if you have {{=response.flash or ' '}} in you school page so it can
show the response you sent from the controller .
Best
Same question here
Ross,
How's the workflow engine going ?
Cheers
António
2012/7/6 Andrew awillima...@gmail.com
Hi Ross,
How's the workflow engine going ?
Regards
Andrew W
--
what is the status?
2012/5/22 Ross Peoples ross.peop...@gmail.com
Richard,
Thanks for the offer. I *think* I'm nearly done. I'm writing some tests
for it now and so far so good. If I run into any problems, I'll let you
know.
Ross
On Tuesday, May 22, 2012 11:09:31 AM UTC-4, Richard
All I needed was actually add{{=response.flash or ' '}} in my view and
it worked
but thanx for the hint
On Monday, September 24, 2012 3:46:20 PM UTC+2, Hassan Alnatour wrote:
Dear Yebach ,
just add this in the default/school in the controller :
if request.vars.school == 'database':
Hello everyone! I'm going back to web2py after one year developing with
other technologies and saw a lot of good changes! Congrats Massimo and the
dev team!
So, I would like to ask a question: I have a full HTML form, rendered by an
action and processed by other action. There is a way to
Not sure how relevant it is but some time ago I made this:
https://github.com/mdipierro/workflow
It is not web2py specific and it is designed for file-based workflow. It
can be used with web2py in the sense that it can run web2py background
tasks.
It could be improved by reading the state
Please try the nightly build and let us know if the problem is still there.
Massimo
On Monday, 24 September 2012 07:49:26 UTC-5, VP wrote:
As indicated in the title, I'm using 2.0.9, which is latest as of now.
On Sunday, September 23, 2012 4:41:15 PM UTC-5, Massimo Di Pierro wrote:
What
You are more than welcome Yebach ;)
regards,
On Monday, September 24, 2012 5:55:20 PM UTC+3, Yebach wrote:
All I needed was actually add{{=response.flash or ' '}} in my view and
it worked
but thanx for the hint
On Monday, September 24, 2012 3:46:20 PM UTC+2, Hassan Alnatour wrote:
I tried but couldn't reproduce the problem in a new app in 2.0.9
Going back to 2.0.8 also didn't work. I may have remembered the wrong version
that worked after applying many updates.
Appreciate any hints on how I may make it work?
It seems that dal date is not accepting the format and
hi
it works
thank you
andrej
On Sunday, September 23, 2012 12:18:32 AM UTC+2, Massimo Di Pierro wrote:
Looks like postgres is picky and wants in groupby all the selected fields
in distinct. This should work:
rows = db(data.id==tag.record_id)\
(tag.name.belongs(tags)).select(
On the processing action you can use
db.table.validate_and_insert(**fields), if validated the record will be
inserted, otherwise it will return the error message, if you do not want to
insert the values, so you can use table._validate method
db.table._validate(**fields) will doo the same but
thanks again, Bruno. You're always saving me, LoL.
Em segunda-feira, 24 de setembro de 2012 13h09min22s UTC-3, rochacbruno
escreveu:
On the processing action you can use
db.table.validate_and_insert(**fields), if validated the record will be
inserted, otherwise it will return the error
I finally figured out... I just needed to change the name of the field and
it worked...
My guess is, the field was somehow made datetime instead of date... and
changing the field name 'reset' this behavior.
On Monday, September 24, 2012 11:52:43 PM UTC+8, lyn2py wrote:
I tried but couldn't
can you show us some of your code. This may be a concurrency issues. I
cannot thing anything we change that would affect the behavior.
On Sunday, 23 September 2012 22:43:28 UTC-5, Yarin wrote:
After upgrading to web2py 2.0, we can no longer use the DAL or mysql
adapters to make MySQL stored
It may be if you want to always clean everything in the session (auth info
etc.)
On Monday, 24 September 2012 03:04:24 UTC-5, Yebach wrote:
If I put session.clear() into the controler of the default page it works
Is that I good solution? It is true that a user has to log in again but it
What do you mean by If I reverse the string, it shows what I expect.?
On Monday, 24 September 2012 07:36:27 UTC-5, Tim Richardson wrote:
In web2py 2.0.9 source I'm printing a variable which is a string including
the substring timestamp1
which gets rendered in the debugger as x (that is,
I do not know but some action is returning a type 'type' object instead
of a string or a dict or an iterator.
On Sunday, 23 September 2012 16:25:40 UTC-5, mweissen wrote:
I have got the following error message.
This message appeard a short time after I had sent something using the
mail.send
Can you please try the nightly build? I think this problem may be related
to a nasty issue with URL that was fixed last week. In fact I cannot
reproduce the problem with trunk, using your code.
Massimo
On Wednesday, 19 September 2012 18:33:16 UTC-5, JoeCodeswell wrote:
I have gone one more
I apologize I have overlooked this patch. I tried apply it now but does not
apply. Would you mind rewriting the patch against latest trunk and posting
the patch on google code? thanks.
Massimo
On Tuesday, 17 April 2012 03:57:04 UTC-5, nikos wrote:
Hello there follow web2py users,
First of
Please do not submit patches as attachments to forum messages. They may get
lots. Instead, always make sure they apply to latest trunk and upload them
as attachment to a google code issue. I process them first.
Massimo
--
Hello all!
Please help me.
I'm write:
model
db.define_table(
'document_body',
Field('name'),
Field('number'),
Field('created', 'datetime', default=request.now),
Field('start_date', 'date'),
Field('end_date', 'date'),
Field('activity', 'boolean', default=True),
)
So I'm reasonably experienced with python and grew up web developing with
PHP. I wanted to move all my web development over to python and web2py
seemed like the ideal way to get started. There's one thing I really don't
like however and is giving me a lot of trouble actually learning the
Hi Guys,
I'm having no luck trying to set up web2py to run behind apache2 on SLES
10. Here is my configuration file which is
/etc/apache2/vhosts.d/yast2_vhosts.conf
/user/web2py is where web2py source is. and I set its ownership to
wwwrun:users as apache2 runs as wwwrun user.
WSGIPythonHome
New to web2py, so learning by looking at an app and taking it apart. I
pulled down the latest Instant Press and when accessing users, I'm getting
the error:
type 'exceptions.AttributeError' 'Row' object has no attribute
'registration_key'
I have not seen other references to this, so assume
Hi all,
I'm pretty new to web2py, so please go easy ;-)
I'm looking for a plugin to help with the display of database tables.
Specifically, it needs to support very large tables, so pagination,
searching, etc. needs to be done on the server side.
I first looked at PowerGrid
db should be defined in your models/db.py
db= DAL()
Models are executed in alphabetical order. It will not be there for you if
you deleted db.py or name your model so that it is executed before db.py.
Massimo
On Monday, 24 September 2012 05:26:26 UTC-5, Роман Акимов wrote:
Hello all!
:-)
Did you try?
# in controller
query = db.server # or more complex filter
grid = SQLFORM.grid(query)
# in view
{{=grid}}
It will do pagination, searching, etc. If you are logged in, it will also
allow create/edit/update. There is a also a SQLFORM.smartgrid.
On Monday, 24
I just wanted to share my latest web2py application
http://SiteLab.cohttp://SiteLab.co/?w2p_nw.
In short, SiteLab helps small ecommerce websites load quickly and
available at all hours of the day. Studies have shown that potential
customers expect a site to load in less than 2 seconds and
Are you serious or just pulling my chain??
It's completely possible that it will load slowly for your if you're
outside of the US since my servers currently only reside there. If I can
get enough customers elsewhere, I'll create some more servers around the
world.
Jim
On Monday, September
i think i can do
equipment = db().select.as_dict()
df = DataFrame(equipment)
but how to display pandas DataFrame object in web2py view?
or how to convert in to something i can display in view?
Did you look at to_html?
Formatting DataFrame as HTML
http://wesmckinney.com/blog/?p=356
me neither (regarding web2py changes), however, I found this
*Compatibility note:* It appears that the mere act of executing the CALL
statement produces an empty result set, which appears after any result sets
which might be generated by the stored procedure. Thus, you will always
need to use
db.py:
db.define_table('mytable',Field('myfield','string'))
sproc:
DELIMITER //
CREATE PROCEDURE TestSproc()
BEGIN
SELECT COUNT(*) FROM mytable;
END //
DELIMITER;
tests.py
NOTE: Tests 1-3 will fail every time in wsgi/linux environments.
From the web2py command line, they will work once,
The problem is still there with nightly build.
On Monday, September 24, 2012 10:18:38 AM UTC-5, Massimo Di Pierro wrote:
Please try the nightly build and let us know if the problem is still there.
Massimo
On Monday, 24 September 2012 07:49:26 UTC-5, VP wrote:
As indicated in the title,
Can you reproduce this from the shell and/or inside a controller?
On Sunday, 23 September 2012 16:41:15 UTC-5, Massimo Di Pierro wrote:
What version are you using?
This is what I get:
db=DAL()
product = db.define_table('product', Field('cost1'), Field('cost2'),
Field('total', compute =
Hi!
In routes_in works well:
('/(?Paddrindex$|fun1$','/myapp/default/\gaddr'),
('/[\w._-]*','/myapp/default/show_page'),
('/myapp/default/(?!index$|fun1$)[\w._-]*','/myapp/default/show_page'),
Function show_page renders page on the basis of path_info.
so:
mydomain.com/index -
9 seconds... in colombia
--
A message like this could be used on top of the mail list with other
instructions such as coding conventions, when a patch is likely to be
accepted (minimum requirements, good patches against bad patches), etc
On Monday, September 24, 2012 2:30:48 PM UTC-3, Massimo Di Pierro wrote:
Please do
On Tuesday, September 25, 2012 3:12:58 AM UTC+10, Massimo Di Pierro wrote:
What do you mean by If I reverse the string, it shows what I expect.?
I reversed the string teststring[::-1] just to make sure that it really did
still contain timestamp
--
Nice job!
From chicago it takes 700ms to load the main html page and images. It than
takes more than 2 seconds to load this image from google-analyitics:
http://www.google-analytics.com/__utm.gif
Massimo
On Monday, 24 September 2012 13:00:40 UTC-5, JimK wrote:
I just wanted to share my
Please do not submit patches as attachments to forum messages. They may get
lots. Instead, always make sure they apply to latest trunk and upload them
as attachment to a google code issue. I process them first.
Also. If you submit a pull request on GitHub, I do not get notified so I
may notice
design in web2py handles twitter bootstrap (
http://twitter.github.com/bootstrap/)
it is easy to quickly layout websites
--
It's really quick to load the HTML from Chicago because I'm using
Rackspace's Chicago hub -- it better be fast! :)
There's not much I can do about the analytics pixel but since it's at the
bottom, it won't block user's from using the website.
As for the site loading slowly in South America, I
Inside a controller.
On Monday, September 24, 2012 3:05:05 PM UTC-5, Massimo Di Pierro wrote:
Can you reproduce this from the shell and/or inside a controller?
On Sunday, 23 September 2012 16:41:15 UTC-5, Massimo Di Pierro wrote:
What version are you using?
This is what I get:
Hello Vixus,
If you want to use bootstrap, than it comes with it.
If not, then deleted everything but web2py.css, jquery.js, and web2py.js
for components and grids you need those but they are small and un-intrusive.
massimo
On Sunday, 23 September 2012 10:05:46 UTC-5, Vixus wrote:
So I'm
db = DAL('sqlite://storage.sqlite')
# db = sqlite, pymongo, mysql, postgresql etc...
db.define_table( 'document_body',
Field('name', requires=IS_NOTEMPTY()),
Field('number'),
Field('created', 'datetime', default=request.now),
Field('start_date', 'date'),
Field('end_date',
Hi ,
I am a newbie and a sample view and controller with regard to the same
will help me really kick start. Else anything really helps
Thanking you,
Vivek
--
I get an error message now when I click the 'save' button. I'm using the
codemirror editor. It says:
Uncaught ReferenceError: area is not defined -- ajax_editor.js:36
It was working in 2.0.6 - all I did was download the 2.0.9 source and
overwrite everything.
Any ideas?
--
sounds like you need to add a meta property to the HEAD of your HTML:
meta content=http://www.starmakerstudios.com/song/106383654/starships;
property=og:url
of course you'll want to use your page URL where my URL is.
i believe that you can use response.meta:
Update - downloaded the nightly, same issue exists.
On Monday, September 24, 2012 4:11:33 PM UTC-7, Derek wrote:
I get an error message now when I click the 'save' button. I'm using the
codemirror editor. It says:
Uncaught ReferenceError: area is not defined -- ajax_editor.js:36
It was
Is this in your ajax_editor.js:36?
https://github.com/web2py/web2py/blob/master/applications/admin/static/js/ajax_editor.js#L36
Does not look there a variable area. Perhaps this file was not upgraded?
Massimo
On Monday, 24 September 2012 18:19:38 UTC-5, Derek wrote:
Update - downloaded the
Attention everybody:
we renamed gluon/contrib/comet_messaging.py as
gluon/contrib/websocket_messaging.py
We can do this because this is an experimental feature. Moreover you always
use it as background process which must be called outside of web2py so it
is not difficult to edit your code
Well, I checked and it was there. I cleared my cache in google chrome and I
got the new file. It's saving now. Thanks!
On Monday, September 24, 2012 4:26:23 PM UTC-7, Massimo Di Pierro wrote:
Is this in your ajax_editor.js:36?
You don't suppose the if-not-modified tag isn't working?
On Monday, September 24, 2012 4:32:28 PM UTC-7, Derek wrote:
Well, I checked and it was there. I cleared my cache in google chrome and
I got the new file. It's saving now. Thanks!
On Monday, September 24, 2012 4:26:23 PM UTC-7,
Well, this is strange. I added a new function to my existing controller...
just a simple thing...
def customerdisplay(cust):
customer = db(db.customers.customer_id == cust).select()
return dict(customer=customer)
now it doesn't show that it is exposed, and if i try to access it, I get
The CSS doesn't look ok on my iPhone. Give a check?
--
Hello web2py users :
Validating if numbers or decimals are entered on a form seem to be very
straight forward and easy enough ! whether it is a phone number or a US
postal code :
Like for example a US postal code would go like this :
requires = IS_MATCH('^\d{5}(-\d{4})?$',error_message='not a
There are some strange quirks I noticed while working extensively with
Google App Engine. These include:
1. You can not send HTML messages using mail.send() without doing some
extensive work arounds.
2. You can not send html messages from GAE from any address apart from your
Gmail address,
In respect to (1) I actually meant sending HTML messages generated using
the templating system.
On Tuesday, September 25, 2012 2:15:10 AM UTC+1, Pystar wrote:
There are some strange quirks I noticed while working extensively with
Google App Engine. These include:
1. You can not send HTML
i use this one:
Order.PC.requires =
IS_MATCH('^([A-Za-z][0-9][A-Za-z]\s*[0-9][A-Za-z][0-9])$',
error_message=T('Not a valid Postal Code')), IS_NOT_EMPTY()
you can also try some of these others that I have, but the one above works
fine...
# validate Canadian Postal Codes
# CA:
requires = IS_MATCH('^[A-Z]\d[A-Z][\- ]?\d[A-Z]\d$',error_message='not a
zip code')
On Monday, 24 September 2012 20:13:03 UTC-5, Don_X wrote:
Hello web2py users :
Validating if numbers or decimals are entered on a form seem to be very
straight forward and easy enough ! whether it is a
On Mon, Sep 24, 2012 at 6:02 PM, Tim Richardson t...@tim-richardson.net wrote:
On Tuesday, September 25, 2012 3:12:58 AM UTC+10, Massimo Di Pierro wrote:
What do you mean by If I reverse the string, it shows what I expect.?
I reversed the string teststring[::-1] just to make sure that it
Is there any way to redirect unauthorized user?
For instance if the user doesn't have the membership for a particular
group, e.g. *group1*, if the try to access a particular controller that is
decorated with the following:
*@auth.requires_membership('group1')*
I'd like to be able to redirect
Have you gone through web2py docs?
On Tuesday, 25 September 2012 03:16:06 UTC+5:30, vivek wrote:
Hi ,
I am a newbie and a sample view and controller with regard to the
same will help me really kick start. Else anything really helps
Thanking you,
Vivek
--
You can set auth.settings.on_failed_authorization to the URL where you want
to redirect.
Anthony
On Monday, September 24, 2012 10:33:31 PM UTC-4, shartha wrote:
Is there any way to redirect unauthorized user?
For instance if the user doesn't have the membership for a particular
group,
Also in respect of (2), it works, the thing is that the domain or email you
would be sending mails from should be the admin email, or an email that has
admin permission in the control panel. Its really simple.
On Tuesday, September 25, 2012 2:18:43 AM UTC+1, Pystar wrote:
In respect to (1) I
73 matches
Mail list logo