Looks like it is comparing them as strings. As others noted, need to see
code.
--
Thanks Jaap and Cliff.
It was helpful.
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
--
Yes, it really acts like str. I'm using the nightly build 1.99.7 dev. Could
it be because of dev?
here's all of the db definition:
db.define_table('company',
Field('title', label='Pavadinimas', unique=True),
Field('CEO', label='Generalinis dir.'),
Field('code', 'integer',
Are you using SQLite? Did you initially forget to define workers as an
integer field, enter some data, and then convert it to an integer field?
What happens if you start with a fresh db?
Anthony
On Tuesday, July 17, 2012 3:55:35 AM UTC-4, Aurelijus Useckas wrote:
Yes, it really acts like
Hi,
We are creating our frontend using angular.js and the API layer is in
web2py. The web2py documentation says -
web2py prevents CSRF as well as accidental double submission of forms by
assigning a one-time random token to each form.
So how will that work in the instance of a pure JS
On Wed, 13 Jun 2012 02:23:35 -0700 (PDT)
Andrew awillima...@gmail.com wrote:
I have started doing some trials with both instantpress and movuca,
and I would have to say that it is not a question of which is better,
each has a different focus and I've enjoyed using both (I'm still
learning and
I understand the proposed procedure is as follows:
1. change db table field to writable
2. make the form as needed
3. change back db table field to not writable
Suppose there are two concurrent users now, A and B, and they execute the
above procedure.
The concurrent scheduling is done by the
I understand the proposed procedure is as follows:
1. change db table field to writable
2. make the form as needed
3. change back db table field to not writable
First, I don't think this is the proposal. The proposal was to manipulate
the form object itself after the form is created, but
On Tuesday, July 17, 2012 5:29:51 PM UTC+8, Anthony wrote:
I understand the proposed procedure is as follows:
1. change db table field to writable
2. make the form as needed
3. change back db table field to not writable
First, I don't think this is the proposal. The proposal was to
I have some code that works as follows
@cache('key', 60, cache_model=cache.ram)
@cache('key', 60, cache_model=cache.disk)
def f()
do stuff
return dict()
I do the dual cache thing since the ram cache is not shared between
processes that get spawned by Apache.
The recent changes to
Sorry, I was referring to
db.table.field.writable = False # change the field to writable false
Second, even something like the above wouldn't be a problem for
concurrent users, as the above would all happen within a single request and
therefore only apply to that one request.
On Tue, Jul 17, 2012 at 6:15 PM, Anthony abasta...@gmail.com wrote:
Sorry, I was referring to
db.table.field.writable = False # change the field to writable false
Second, even something like the above wouldn't be a problem for
concurrent users, as the above would all happen within a single
I've tried to erase all fields, but still with no success :( yep, SQLite
On Tuesday, July 17, 2012 11:15:02 AM UTC+3, Anthony wrote:
Are you using SQLite? Did you initially forget to define workers as an
integer field, enter some data, and then convert it to an integer field?
What happens
Note, SQLite cannot drop fields -- see
http://web2py.com/books/default/chapter/29/6#Fixing-broken-migrations. How
about if you create a fresh database (i.e., delete everything from the
databases folder and start from scratch)?
On Tuesday, July 17, 2012 6:27:52 AM UTC-4, Aurelijus Useckas
Hi Massimo,
Thanks for your (quick) answer! I've created an issue for this:
http://code.google.com/p/web2py/issues/detail?id=900
I'll try to implement the modern approach and the 'requires work-around'
Remco
On Tuesday, July 17, 2012 4:03:20 AM UTC+2, Massimo Di Pierro wrote:
For the time
When I go through the exercise of re-tooling this site I will catalog what
I did wrong and what I had to do get it right based on the input provided
and perhaps it will be some benefit to others who won't make the same
mistakes I made. :)
--
Thanks for the response! Actually, the problem was fixed by updating
mod_wsgi from 2.8 to 3.3 (the latest version). I'm using Ubuntu, BTW.
Thanks
On Sunday, July 8, 2012 4:55:51 PM UTC-7, Ovidio Marinho wrote:
have you ever tried
#sudo /etc/init.d/apache2 stop
#sudo /etc/init.d/apache2
I had to to do something similar a couple of years ago (between
several waste water plants and the control center) and ended using a
similar approach to what nick name said:
- In the control center I used mysql
- In the waste water plants I used a sqlite database per day
(initializating the
Hello,
I have added a CANCEL button to my SQLFORM.
Form submission prevents the correct working of it.
I have tried to avoid form submission with this code :
def new_guest_contact():
form = SQLFORM.factory(...)
I know this thread is a little old, but I really agree getting web2py going
on a servlet container would be awesome.
I followed Andrew's excellent example from the previous post, BUT i worked
around the root url redirect issue by simply renaming the web2py folder to
'ROOT' (which, by
Maybe this could be enough??
{{=A(T('cancel'),_href=javascript:void(history.go(-1)))}}
It will bring you back to the precedent page, in my use case, I direct the
user on a crud.read page where the user can edit the record (crud.update).
Then if don't want make change anymore there is a cancel
I would set a Dropbox shared folder on both machines (there is a server
dropbox.py for linux)
So create a script which copies the .sqlite in to Dropbox folder.
On city machine a scheduled task read records on sqlite and import new
records directly to mysql.
You are going to need a 'signal'
Thanks for your solution Richard !
I am still looking for a solution with a button component...
Mathias
2012/7/17 Richard Vézina ml.richard.vez...@gmail.com:
Maybe this could be enough??
{{=A(T('cancel'),_href=javascript:void(history.go(-1)))}}
It will bring you back to the precedent page,
Yeah that is what I was just sharing. My site was slow I have over 200
models now.
My setup is:
models/controller/action/db.py - In here it includes a function
define_tables(db, tables = [], migrate=False, fake_migrate=False)
The define_tables is a function that I put somewhere else out side of
Hello guys, still need help with this... thanks.
On Tuesday, July 17, 2012 8:25:03 AM UTC+8, lyn2py wrote:
I tried and it said, command not found. I did:
sudo ./setup-web2py-ubuntu.sh
Or how should the command be?
Thanks for the help!
On Tuesday, July 17, 2012 2:11:33 AM UTC+8, rdodev
The fact that you don't have sudo installed tells me you might have chosen
the wrong instance type. I'd say stop that instance (unless you have
critical data or code on that box) and start a new micro 64-bit micro
instance with 64-bit Ubuntu. Once you are in the instance via ssh, run:
sudo
Here's a slice with .gitignore files for app-level and site-level repos:
http://www.web2pyslices.com/slice/show/1532/gitignore
On Friday, April 27, 2012 2:08:18 PM UTC-4, mrtn wrote:
Hi,
I'm using Git (Github) to manage my app development in Web2py. I noticed
that each time when I make a
rdodev,
sudo is installed. I know that because
sudo apt-get update
works.
The instance is, in fact, a micro, 64-bit Ubuntu!
I ran both
sudo setup-web2py-ubuntu.sh
and
sudo ./setup-web2py-ubuntu.sh
The error that came up is:
sudo: setup-web2py-ubuntu.sh: command not found
no password
First, let's check the file is in the same directory you are currently at:
type 'ls -al' (w/o quotes) see if the script is in the list.
Second, type 'sudo chmod +x scrip_name.sh' (again, no quotes)
Third, try 'sudo ./script_name.sh'
On Tuesday, July 17, 2012 10:43:32 AM UTC-4, lyn2py wrote:
On 17 Jul 2012, at 7:43 AM, lyn2py wrote:
rdodev,
sudo is installed. I know that because
sudo apt-get update
works.
The instance is, in fact, a micro, 64-bit Ubuntu!
I ran both
sudo setup-web2py-ubuntu.sh
and
sudo ./setup-web2py-ubuntu.sh
The error that came up is:
sudo:
I found a good solution for me :
form[0][-1][1].append(TAG.INPUT(_value='Cancel',_type=button,_onclick=window.location='%s';%URL(r=request,f='new_contact')))
Mathias
2012/7/17 Mathias Van Daele mathias.v.da...@gmail.com:
Thanks for your solution Richard !
I am still looking for a solution
Thank you it works!
The different thing I did was
sudo chmod +x setup-web2py-ubuntu.sh
instead of
chmod +x setup-web2py-ubuntu.sh
(which were the instructions at
http://www.scribd.com/doc/26436821/Howto-deploy-Web2py-on-amazon-Ec2 )
Although, when I did
ls -al
both directories looked the
Do you use rocket (the built-in web server) or apache?
On Monday, 16 July 2012 23:42:49 UTC-5, Amit wrote:
Hi,
I have one timer thread which has to start once when web sever starts very
first time and stop when web server stops, means it should be running
continuously irrespective of how
Cool. Glad to help.
On Tuesday, July 17, 2012 11:10:43 AM UTC-4, lyn2py wrote:
Thank you it works!
The different thing I did was
sudo chmod +x setup-web2py-ubuntu.sh
instead of
chmod +x setup-web2py-ubuntu.sh
(which were the instructions at
You are welcome.
On Tuesday, July 17, 2012 2:48:35 AM UTC-4, Johann Spies wrote:
Thanks Jaap and Cliff.
It was helpful.
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
--
Can you please run a test for me?
In dal.py there are these lines:
def adapt(self,obj):
return psycopg2_adapt(obj).getquoted()
can you plase replace them with
def adapt(self,obj):
if self.driver == self.drivers.get('pg8000'):
obj = str(obj).replace('%','%%')
Is this report to be printed? If so, just generate a pdf.
On Saturday, July 14, 2012 4:06:33 PM UTC-4, thinkwell wrote:
Hello everyone,
I'm experimenting with pyfpdf with HTML formatting, but it's not going so
well. Is a bit buggy. For example, this code generates a KeyError: 'width'.
CRSF only works if you use SQLFORM. Do you? Then it depends on how to use
it. The workflow is the following
1) visit the page
{{=SQLFORM().process()}} generate the html for and injects some hidden
fields in it
2) you submit the form
{{=SQLFORM().process()}} check the hidden fields and
Sorry. Should not be fixed in trunk. Thanks for reporting this problem.
On Tuesday, 17 July 2012 05:14:48 UTC-5, marius.v.niekerk wrote:
I have some code that works as follows
@cache('key', 60, cache_model=cache.ram)
@cache('key', 60, cache_model=cache.disk)
def f()
do stuff
Doesn't
db.table.field.writable = False
db.table.field.default = 'whatever'
do what you want?
On Thursday, 16 June 2011 13:05:34 UTC-5, JayShaffstall wrote:
I have a situation where I need to adjust an SQLFORM field to be
non-editable. I can do that with .writable = False, but that seems
Hello Anthony in order to do what you propose here, I mean passing
javascript code from the controller to the view by mean of return
dict(var=js), I think the only way I have to execute the passed js code is
to use eval in the view like this :
script type=text/javascript
eval({{=var}});
/script
Maybe Massimo's ideia can work for you.
But don't be afraid to count on custom forms. They give us much more power.
On 07/17/2012 12:37 PM, Massimo Di Pierro wrote:
Doesn't
db.table.field.writable = False
db.table.field.default = 'whatever'
do what you want?
On Thursday, 16 June 2011
instructions: download the archive from
https://github.com/niphlod/w2p_scheduler_tests/zipball/master. the zip
contains a folder (now it is named niphlod-w2p_scheduler_tests-903ee75).
Decompress that folder under applications and rename it to
w2p_scheduler_tests.
That should be enough
On
Another issue O.O
Now that the whole script has installed, and I followed through with the
rest of the commands
sudo -u www-data bash
cd /home/www-data/web2py
python -c from gluon.main import save_password; save_password('hello',443)
Accessed via the public DNS, but the site does not appear.
I don't think there are any SQLFORMs. It's all custom Ajax calls. I'm guessing
your JavaScript library (angular, in this case) needs to take care of it?
--
I'd be surprised if model processing is your biggest problem. Have you reviewed
all your queries for optimization opportunities? Cache, cache and more cache?
Indexes?
--
You need to use the url like this
img src='+URL('static', 'images', args='poweredby.png', host=True,
scheme=True)+'/
--
Going back to your first example code you gave above,
Javascript in the view nothing really changed I just don't have the
indicator gif
script
jQuery(document).ready(function(){
jQuery('.EDit').editable({{=URL('update')}},{
style: 'display:inline',
indicator:
LOL well the before and after performance improvements from moving the
models has proven it to be a major problem. So yes models are definitely a
problem primarily because they are redefined every call and with a high
traffic site that means a lot of redefinitions.
On Tue, Jul 17, 2012 at 9:12
Just think about it loading a page that queries from one table, and models
that define 200 tables. For that single query 200 tables must be define
with the default web2py setup. This isn't rocket science to know it will be
wasting a lot of resources and slow down performance every extra function
I had to use XML() to avoid $quot; in the view, like this :
# In controller
conditional_field_trigger_selected_event_js
= '$(select[name=FIELDOFINTERESS]).change(function() {var val =
$(this).children(:selected).attr(value);$(this).trigger($(this).attr(id)
+ __selected, [val]);});'
...
return
to add to massimo's response, i have added some HTML5'ness to my
registration widget:
reg_form = auth.register()
reg_form.custom.widget.email['_required'] = True
reg_form.custom.widget.stage_name['_required'] = True
reg_form.custom.widget.stage_name['_pattern'] =
This is a jython bug. Does this error make sense to you?
translate() takes 2 arguments (2 given)
On Tuesday, 17 July 2012 07:50:14 UTC-5, Duncan wrote:
I know this thread is a little old, but I really agree getting web2py
going on a servlet container would be awesome.
I followed
In trunk:
form.add_button(Cancel,URL(r=request,f='new_contact'))
On Tuesday, 17 July 2012 10:00:59 UTC-5, Mathias wrote:
I found a good solution for me :
form[0][-1][1].append(TAG.INPUT(_value='Cancel',_type=button,_onclick=window.location='%s';%URL(r=request,f='new_contact')))
I remind the readers we have conditional models:
models/db.py (runs for every action)
models/default/db.py runs (runs only for actions in controllers/default.py)
models/default/index/db.py runs (runs only for action index() in
controllers/default.py)
This speeds things a lot.
On Tuesday, 17
The conditional models are good, but the problem is the fact that they are
not reusable, when you need the same table on multiple controllers, or you
have to define it globally, or you have to repeat the definition on every
sub model.
I think having a module with functions or classes to define
Sorry for the noise, I struggled with quot; for long time and didn't
realise that I wasn't need eval() anymore...
I don't need js var and eva(); at all as long as I have XML()
# In view
{{if request.args(0)=='SOMETHING':}}
script type=text/javascript
Was it a 404, timeout error or what?
On Tuesday, July 17, 2012 11:49:14 AM UTC-4, lyn2py wrote:
Another issue O.O
Now that the whole script has installed, and I followed through with the
rest of the commands
sudo -u www-data bash
cd /home/www-data/web2py
python -c from gluon.main
There is an old proposal from Mariano to address that we should revisit
that. Yet I find that if a model is needed by multiple controllers, it can
be defined at top-level. It is in general a good design to group actions in
controllers depending on which models they need.
On Tuesday, 17 July
On Mon, Jul 16, 2012 at 5:08 PM, thinkwell thinkwelldesi...@gmail.com wrote:
Well, me again. I decided that I wanted to use points as measurements
instead of percentages, so now it barfs with an AttributeError.
from gluon.contrib.pyfpdf import FPDF, HTMLMixin
from gluon.html import *
I'll take a look.
Maybe it is related to paramstyle o similar setting.
Can you fill a bug issue, just in case I forget about this..
https://code.google.com/p/pg8000/issues/entry
Best regards,
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
On Tue, Jul 17, 2012
to help with your search consider posting here
http://experts4solutions.com/ if you haven't already.
On Monday, July 16, 2012 4:23:41 PM UTC-7, Pepe C wrote:
Hi,
We have a set of applications on web2py and we are looking for an expert
that can help us to operate and develop them. This is
Massimo my suggest was conditionals, Bruno the way I handle mine there is
no repeating of model definitions.
db_tables.py
# define all tables in a function this file should be out side of the
models directory
def define_tables(db, tables=[], migrate=False, fake_migrate=True)
models/global.py -
Hi,
How can i hide columns in the create form generated by sqlform.grid ?
Thanks
Ashraf
--
if request.function == 'new':
db.mytable.myfield.readable = False
db.mytable.myfield2.readable = False
db.mytable.myfield3.readable = False
On Tue, Jul 17, 2012 at 5:16 PM, Ashraf Mansour ad...@aqar-riyadh.comwrote:
Hi,
How can i hide columns in the create form generated by
Excellent reply. Yes, learning web2py will help you learn the concepts of
MVC, SQL, OWASP, Javascript, HTML, JSON, CSS, Python. It's really nice to
put those on your resumee.
On Sunday, July 15, 2012 2:45:19 AM UTC-7, mart wrote:
in my experience brand names do not sell as much as bare bone
raw maple syrup, well, it flows out of the tree easily enough, and buckets
of it seem almost like water, it's not very viscous. Only when you heat it
and cook it for a while does it become the thick maple syrup you see on
your kitchen table.
On Monday, July 16, 2012 5:14:22 PM UTC-7, wdtatenh
Connection Timeout error.
On Wednesday, July 18, 2012 1:59:15 AM UTC+8, rdodev wrote:
Was it a 404, timeout error or what?
On Tuesday, July 17, 2012 11:49:14 AM UTC-4, lyn2py wrote:
Another issue O.O
Now that the whole script has installed, and I followed through with the
rest of the
I added the statements
if request.function == 'new':
db.mytable.myfield.readable = False
db.mytable.myfield2.readable = False
db.mytable.myfield3.readable = False
before constructing the grid, but the fields are still in the add (create)
form of the grid.
I am definging default
Is there a way I can add an import excel (saved as csv) option in the
appadmin that can update multiple data tables (one of them an
intermediate/relational table)?
for example the excel file (saved as csv):
*ID | title |category|*
1 | one |
In my function page2(): I return a dictionary to be accessed by the page2
HTML view. In the page2 function I have some other dictionaries. What I
want to do to be able to use the non-returned dictionaries in the HTML code
to show some items. This is a sample of what I want: Hope it's clear
def
replace
return dict(ReturnedDict = OtherDict)
with
return locals()
On Tuesday, 17 July 2012 16:40:00 UTC-5, adohertyd wrote:
In my function page2(): I return a dictionary to be accessed by the page2
HTML view. In the page2 function I have some other dictionaries. What I
want to do to be
Just curious:
There is a special reason to not simply return the needed dicts?
Em Ter 17 Jul 2012 18:40:00 BRT, adohertyd escreveu:
In my function page2(): I return a dictionary to be accessed by the
page2 HTML view. In the page2 function I have some other dictionaries.
What I want to do to be
I need all of them!
On Tuesday, 17 July 2012 22:47:02 UTC+1, Lucas R. Martins wrote:
Just curious:
There is a special reason to not simply return the needed dicts?
Em Ter 17 Jul 2012 18:40:00 BRT, adohertyd escreveu:
In my function page2(): I return a dictionary to be accessed by the
Simple as that :) thanks Massimo Web2py is fantastic
On Tuesday, 17 July 2012 22:45:48 UTC+1, Massimo Di Pierro wrote:
replace
return dict(ReturnedDict = OtherDict)
with
return locals()
On Tuesday, 17 July 2012 16:40:00 UTC-5, adohertyd wrote:
In my function page2(): I return a
I would like to know how I would add an import csv (from excel) option to
appadmin that would update multiple database tables (one of them a
relational/intermediate table).
For example, the CSV file would look like this (in excel)
ID | posttitle |category
Thanks Brent,
Appreciate that, but the main issue is that the controller does not called
from jQuery. i.e. from this line
jQuery('.EDit').editable({{=URL('update')}},{
There no post vars.
(have also used a brute force updates to confirm that it doesn't fire)
If we can only find out why.
I don't think there are any SQLFORMs. It's all custom Ajax calls. I'm
guessing your JavaScript library (angular, in this case) needs to take care
of it?
Presumably you could still use SQLFORM to generate the _formkey value, send
it to the client, and have the client send it back with the
You should probably make it a reference field. By default, if you don't
specify any requires, you'll automatically get an IS_IN_DB validator as
well as a represent attribute that displays whatever is specifying by the
format attribute of the referenced table. However, if you specify your
own
Thanks, Massimo,
I'm happy to say that I now have a *working*** web2py install in Tomcat*!
The 'translate' issue was a bit of a cryptic one, but thanks to a previous
post by Sergio, I realised that the issue was in a redundant cookie check
in the Jython Cookie.py file. I just comment out the
It is possible. Yet there is some overhead because SQLFROM is built on top
of helpers. It will create a representation of the form even if it unused.
It may work to create a SQLFORM light that only does what you need. It can
be done in a few lines of code. Let me think about it
On Tuesday,
I would be very much interested in a web2py war file! We can distribute it
directly from the web2py.com
On Tuesday, 17 July 2012 19:03:40 UTC-5, Duncan wrote:
Thanks, Massimo,
I'm happy to say that I now have a *working*** web2py install in Tomcat*!
The 'translate' issue was a bit of a
Ok it works now!
Thanks rdodev!
On Wednesday, July 18, 2012 4:55:38 AM UTC+8, lyn2py wrote:
Connection Timeout error.
On Wednesday, July 18, 2012 1:59:15 AM UTC+8, rdodev wrote:
Was it a 404, timeout error or what?
On Tuesday, July 17, 2012 11:49:14 AM UTC-4, lyn2py wrote:
Another
I am also unable to import a CSV file using the list:reference format
(exporting then importing with no changes still doesn't work). I get the
error message :
Unable to parse CSV file
'nonetype'object has no attribute '__getitem__'
On Tuesday, July 17, 2012 2:44:58 PM UTC-7, Mark Li
Hi guys,
After reading the docs, searching through old posts, and scouring the net,
I'm hoping someone can enlighten me regarding x509 auth:
1- How to retrieve the subject contained in the x509 certificate (serialNumber,
commonName, etc). Any example code?
2- Does the current implementation of
for development purpose I am using Rocket but will deploy the application
to ubuntu machine where web server will be apache, so please provide me
solution for both.
On Tue, Jul 17, 2012 at 8:41 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
Do you use rocket (the built-in web server)
I may be able to a lot some hours from my teams if you would like the
work. It all depends on how much you want to pay for the developer.
Ours are some of the best in Finland and we are experienced in working
with many kinds of platforms including web2py.
If you want to discuss more I am
Yes it will be only ajax calls and I will not be using SQLFORM.
I am presuming this is the mechanism you use for preventing CSRF attacks -
1) Generate a unique value for every form that is sent to clientside.
2) Assign this value to _formkey, and also store it in the session.
3) When the user
For logout, I could not find logout_onaccept.
There is though: auth.settings.logout_onlogout
I am using v 1.99.7.
--
I am presuming this is the mechanism you use for preventing CSRF attacks -
1) Generate a unique value for every form that is sent to clientside.
2) Assign this value to _formkey, and also store it in the session.
Yes, but _formkey is stored along with the _formname, so it is associated
Great Job with packaging up the app and the documentation/instructions.
Very impressive.
I'll now start testing / familiarising myself with the scheduler
--
91 matches
Mail list logo