Maybe this will help:
http://www.web2pyslices.com/slice/show/1724/cascading-dropdowns-simplified ?
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On 11/7/2013 10:09 PM, Dr. Bill Y.K. Lim wrote:
Hi, I am new to Python and web2py and I am not sure
hi,
just want to know what is the different response.files.append and
response.files.insert. e.g. take from layout.html
in the older version :
{{
response.files.append(URL('static','css/web2py.css'))
response.files.append(URL('static','css/bootstrap.min.css'))
response.files.append(URL
On 7 Nov 2013, at 9:00 PM, Andrew W wrote:
> Well, I just added -D 0 when starting the scheduler and it prints to the
> console.
> Yes, we should add something, because after reading the logging sections of
> the book I was sure I had to add something to the conf file.
scheduler.py has this:
Well, I just added -D 0 when starting the scheduler and it prints to the
console.
Yes, we should add something, because after reading the logging sections of
the book I was sure I had to add something to the conf file.
On Friday, November 8, 2013 3:46:29 PM UTC+11, Jonathan Lundell wrote:
>
On 7 Nov 2013, at 7:05 PM, Andrew W wrote:
> Thanks. I've never been quite sure what to put in logging.conf for the
> scheduler debug key, based on the "logger =" statement in scheduler.py.
We should add a schedule section to the logging example file.
--
Resources:
- http://web2py.com
- htt
It is not working because you need the list of options when the form is
generated, not when it is submitted, in fact this line is executed when the
form is generated:
db.auth_user.city.requires =
IS_IN_SET(COUNTRIESANDCITIES[request.post_vars.country])
yet at this time the form is not submi
Thanks. I've never been quite sure what to put in logging.conf for the
scheduler debug key, based on the "logger =" statement in scheduler.py.
On Friday, November 8, 2013 6:59:17 AM UTC+11, Niphlod wrote:
> logging is enabled as anything else in web2py.
> just start the scheduler with
> w
On Thursday, November 7, 2013 8:24:19 PM UTC-5, Kiran Subbaraman wrote:
> Look at the
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors.
>
>
> I think the errors are not displayed as usual, the moment you start
> working with a customized form.
Note, if you u
You need to use form.custom.widget.fieldname to get the errors to display
automatically. If you create your own tags manually in HTML, then
you'll have to manually include the errors as well (the error for a given
field is in form.errors.fieldname). Maybe something like:
{{=DIV(form.errors.em
Is it possible to use a view to generate a string? In this particular
case, I want to generate a snippet of HTML & cache it away. I suppose this
could be done using straight python & helpers, but a view seems so much
more natural.
- Scott
--
Resources:
- http://web2py.com
- http://web2py.co
Look at the
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Hide-errors.
I think the errors are not displayed as usual, the moment you start
working with a customized form. You will need to handle that too.
Kiran Subbaraman
http://sub
One more thing I would like to say about this is:
I am using 4 times urllib for calling same weblinks for different
purposesWill this cause problem??? If yes how to solve this issue?
params1 = {'from':'PDB_ID', 'to':'ACC', 'format':'tab',
'query':session.pdbid.strip()}
data1 = urllib.ur
Hi All,
I have made one webserver on web2py. It runs perfectly sometime and
sometime it throws error: HTTP Error 404: Not
Found
I am not able to understand it this error. Why my application runs smoothly
sometime and sometime throws this kind of error.
Here is Traceback:
Traceback (most rec
>
> Q: I need to manipulate database contents in separate functions but if I
> place the code to a separate module it can't connect to the database.
> How can I access the database from separate module? Should I use the same
> connection string in them as used in model files (db.py)?
>
please c
SQLFORM.factory has no notion of the table.
The default naming scheme hence does "no_table" instead of "attachment".
On Thursday, November 7, 2013 11:37:25 PM UTC+1, Jim S wrote:
>
> Just fixed my problem.
>
> Instead of doing the SQLFORM.factory, I just did a SQLFORM(db.attachment)
> and set the
Thank you Cliff (and Derek), this works very well for me.
On Wednesday, November 6, 2013 11:38:28 PM UTC+1, Cliff Kachinske wrote:
>
> I can't speak for Derek, but here's how I handle this stuff.
>
> foo
>
>
> $('#to_be_updated).on('click', function(event){
> ajax('update_span', [ ], ':eval')
Hi, I am new to Python and web2py and I am not sure if my approach below is
correct - in any case I have a problem with it:
I have added 2 extra fields in db.py as follows:
from applications.myapp.modules.countriesandcities import *
auth.settings.extra_fields['auth_user']=[
Field('country'),
Hi,
I am building my login form with the form.custom.widget, because I don'
like the standard layout of the forms.
Now the problem is, I can't get the errors to display.
Here is my controller:
def login():
form=auth.login()
if form.accepts(request,session):
response.flash = 'form
Hi,
I am developing a test application with web2py to test database
performance. The idea is to see how long does it take to fetch information
from database on different loads.
So far I have tested with SQLite and I've made test databases of size ~1K
and 10K.
Now I'm trying to test a ~100K and
Just fixed my problem.
Instead of doing the SQLFORM.factory, I just did a SQLFORM(db.attachment)
and set the readable/writable attributes to false on the fields I didn't
want to see.
So, this works for me.
Sorry for the noise.
-Jim
On Thursday, November 7, 2013 4:12:54 PM UTC-6, Jim S wrote:
Just found something else interesting about this:
I created one document using a test controller I'd created with a simple
SQLFORM.grid in it. That one I can retrieve. There are 2 documents that
were created with the SQLFORM.factory as detailed below, and they don't
work.
The one that was
So I changed my reverse proxy set up to make debug a bit easier and maybe
will get some suggestions from someone now:
I have an instance of web2py running on nginx sitting behind an apache
reverse proxy so:
www.mydomain.com/linkpoints tomyserver1.otherdomain.com
i have /myapp/defau
I have a table with an upload field:
attachment = db.define_table('attachment',
Field('attachmentId', 'id', readable=False),
Field('name', length=50, label='Name', required=True),
Field('employeeId', db.employee, label='Employee'),
Field('ticketId', db.ticket, label='Ticket
Hi Richard
Thanks for the help. I keep looking. If I select the item from the
autocomplete, I just want to grab the id and all the info pertaining to
that record and put it in a session. I dont know how to do it. Do you have
a better picture of my question?
THanks again
On Wednesday, Novemb
In trunk, SQLFORM.grid and SQLTABLE now include a element that
includes a element for each column in the grid/table. Each col
element includes a "data-column" attribute with the number of the column
within the table (starting at 1). Columns that represent DAL table fields
also have id's like
oh my.
json_object *IS* an object (the name should have been pretty obvious).
if you want the value of a, just do
alert(t.a)
On Thursday, November 7, 2013 9:30:31 PM UTC+1, Gaurav singh wrote:
>
> Sorry But its not working , its displying object obect in the pop up
>
>
--
Resources:
- htt
Sorry But its not working , its displying object obect in the pop up
On Friday, 8 November 2013 01:20:30 UTC+5:30, Niphlod wrote:
>
> nope.
> from gluon.serializers import json
>
> def index():
> python_object = dict(a=1, b=2)
> return dict(json_object=json(python_object))
>
> and then y
logging is enabled as anything else in web2py.
just start the scheduler with
web2py.py -K appname -D 0
to enable the DEBUG level.
Of course logging.conf must be configured to allow DEBUG messages to be
printed in the console.
BTW: *Error cleaning up* shows up usually when the scheduler can't act
/me too. I just don't bother with timezones (if not converting them
client-side) and set all servers times to utc ^_^
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report
put in your test.html an element and render the response.view value in it,
so you'll know what actually is the response.view passed ...
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/i
nope.
from gluon.serializers import json
def index():
python_object = dict(a=1, b=2)
return dict(json_object=json(python_object))
and then you can do
var t = {{=XML(json_object)}};
alert(t);
in the view.
On Thursday, November 7, 2013 8:28:23 PM UTC+1, Gaurav singh wrote:
>
> I
I am converting a python array p to javascript array using var t=
{{=XML(response.json(p))}} but when i check it using alert(p); i get an
empty pop up box :/ , Please help me
On Saturday, 2 November 2013 19:40:34 UTC+5:30, Massimo Di Pierro wrote:
>
> What do you mean it is not? It should. Can y
I am not getting an error, it just renders the view that would normally
default to 'test.html'
On Thursday, November 7, 2013 12:21:00 PM UTC-5, Massimo Di Pierro wrote:
>
> What error do you get? This should work fine.
>
> On Thursday, 7 November 2013 10:34:39 UTC-6, David wrote:
>>
>> Hello,
it looks like the id_map will tell it which column to use to map IDs, so it
may do update or insert as appropriate. How convenient!
On Thursday, November 7, 2013 11:38:57 AM UTC-7, Derek wrote:
>
> pass it the 'restore=True' to truncate the table before inserting.
> Otherwise, it doesn't appear
pass it the 'restore=True' to truncate the table before inserting.
Otherwise, it doesn't appear that the CSV import would do an 'insert or
update'.
On Monday, November 4, 2013 8:07:44 PM UTC-7, Sarbjit wrote:
>
> I am using import csv option to insert records in the database. When I use
> the c
It's a pervasive specific error, try seeing if there are any 0x00
characters in the 'message'.
http://www.postgresql.org/message-id/481eb2fd.7060...@ikoffice.de
On Thursday, November 7, 2013 12:58:46 AM UTC-7, at wrote:
>
> Yes except datetime fields; the all inserted values seem to be ok and
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
Still digging on this.
On 07/11/13 15:02, Philip Kilner wrote:
> I'm having problems getting this working!
>
> My steps: -
> - Create new app.
> - Go to admin at /admin/default/site
> - From admin, hit the "Try the mobile interface" link.
> - Do
On 7 Nov 2013, at 9:20 AM, Massimo Di Pierro wrote:
> One can do
>
> request.now = request.utcnow
>
> For applications which are usually accessed from the same time-zip as the
> server the current server makes it easier to set dates.
I'm of course influenced by my own applications, with globa
What error do you get? This should work fine.
On Thursday, 7 November 2013 10:34:39 UTC-6, David wrote:
>
> Hello,
>
> I am trying to use a different view for mobile devices but am not having
> any luck using:
>
> response.view = 'test/test.mobile.html'
>
> in the controller as demonstrated in
One can do
request.now = request.utcnow
For applications which are usually accessed from the same time-zip as the
server the current server makes it easier to set dates.
On Thursday, 7 November 2013 10:14:03 UTC-6, Jonathan Lundell wrote:
>
> Digressing slightly: it seems to me that one would
Hello,
I am trying to use a different view for mobile devices but am not having
any luck using:
response.view = 'test/test.mobile.html'
in the controller as demonstrated in
http://www.web2py.com/init/default/examples example 4
Am I doing something wrong?
David
--
Resources:
- http://web2p
Digressing slightly: it seems to me that one would ordinarily almost always
want to use datetime.utcnow() rather that datetime.now(); likewise
request.utcnow. At least in the database.
On 7 Nov 2013, at 8:03 AM, Anthony wrote:
> On Thursday, November 7, 2013 10:06:57 AM UTC-5, Jonathan Lundel
On Thursday, November 7, 2013 10:06:57 AM UTC-5, Jonathan Lundell wrote:
> On 7 Nov 2013, at 6:00 AM, Anthony >
> wrote:
>
> Actually, my original explanation wasn't quite correct -- I made the
> corrections in the original post (same conclusion though -- #2 should be
> preferred, but they shou
On 7 Nov 2013, at 6:00 AM, Anthony wrote:
> Actually, my original explanation wasn't quite correct -- I made the
> corrections in the original post (same conclusion though -- #2 should be
> preferred, but they should both result in nearly the same value). I don't see
> how using datetime.now w
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi All,
I'm having problems getting this working!
My steps: -
- - Create new app.
- - Go to admin at /admin/default/site
- - From admin, hit the "Try the mobile interface" link.
- - Download the plugin from the link in the text on the right.
- - Go t
Actually, my original explanation wasn't quite correct -- I made the
corrections in the original post (same conclusion though -- #2 should be
preferred, but they should both result in nearly the same value). I don't
see how using datetime.now would lead to the error you are getting, but go
ahea
Thanks Anthony for the explanation.
We am using #1 and occasionally get '*insufficient data left in message*',
could it be because of datetime.now?
On Thursday, 7 November 2013 17:56:47 UTC+5, Anthony wrote:
>
> Is there any difference between following two statements:
>> #1
>> from datetime imp
Thanks Niphlod
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" g
no, unless you do a backup of your files, set fake_migrate=True and check
sql.log.
On Thursday, November 7, 2013 8:36:47 AM UTC+1, Jayadevan M wrote:
>
> OK, so I got it wrong.
> I see the actual SQLs and execution output in sql.log. The SQLs which are
> 'about to be executed' to get the instan
herbou1 is a function in my isi-controller.
Shouldn't this function be in your models?
A question for you: how did you turn on debugging for the scheduler?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://cod
that if you have multiple workers you can have them assigned a "multiple"
fraction of the work if you know that they'll process tasks faster.
i.e. you have a local worker fetching from the interwebs big chunks of
data. You observe that you're queueing tasks faster than that server can
process th
what db are you using ?
On Thursday, November 7, 2013 12:07:40 PM UTC+1, Johann Spies wrote:
>
> It was a year ago that I have tried for 4 days to get the scheduler
> working. In the end I gave up and decided to use the operating systems's
> cron to handle scheduled jobs.
>
> I am trying again
it's a known and documented behaviour
http://web2py.com/books/default/chapter/29/12/components-and-plugins?search=multipart
Basically, you can't upload a file via ajax via jquery unless some major
"refactorings"/"adoption of other libraries"/"all browsers with a common
api" will support it.
--
>
> Is there any difference between following two statements:
> #1
> from datetime import datetime
> db.my_table.insert(updated=datetime.now)
>
> and
> #2
> from datetime import datetime
> db.my_table.insert(updated=datetime.now())
>
I believe they should result in (almost) the same entry into t
Have an issue where files can't be uploaded via a SQLFORM.grid form that is
loaded/ called via ajax.
The update/ create write to the table fails.
If a file isn't selected, and other fields are updated, the write is
successful.
A non ajax called form works OK.
The error message following a fa
datetime.now is a function
datetime.now() is the result of the function
request.now is equal to datetime.now()
On Thu, Nov 7, 2013 at 12:32 PM, at wrote:
>
> Hi,
>
> Is there any difference between following two statements:
> #1
> from datetime import datetime
> db.my_table.insert(updated=date
Den onsdagen den 6:e november 2013 kl. 23:45:24 UTC+1 skrev Cliff Kachinske:
>
> Do you have __init__.py in your modules folder?
>
> On Wednesday, November 6, 2013 2:36:16 PM UTC-5, Niphlod wrote:
>>
>> posting what you're trying to import may help us to figure out the cause
>> and give a soluti
Thanks for the suggestions, gevent looks good but I am indeed using pyodbc
and this seems to be working with Apache so I'd rather stick with this for
time being. (Note I had to embedd the Python27.dll manifest into pyodbc.pyd
to get it to work with Apache).
The reason for using ajax in the first p
It was a year ago that I have tried for 4 days to get the scheduler
working. In the end I gave up and decided to use the operating systems's
cron to handle scheduled jobs.
I am trying again and so far I have no success.
Running web2py with D0 I get the message
DEBUG:web2py.scheduler.artikel#29
Hi,
Is there any difference between following two statements:
#1
from datetime import datetime
db.my_table.insert(updated=datetime.now)
and
#2
from datetime import datetime
db.my_table.insert(updated=datetime.now())
where,
db.define_table('my_table',
Field('updated', type='datetime', defau
Hello All,
I have these two tables
db.auth_user - which is the default table created for Auth
email, password, first name, last name
db.b
b0, b1, b2, b3
db.b.b0 foreign-key linked to db.auth_user.id
My requirement: Display only fields first name, last name, b2, b3. Updates
can only happen to t
Can somebody please explain to me what this sentence from the book is
trying to tell me?
"['mygroup','mygroup']. Tasks will be distributed taking into consideration
that a worker with group_names ['mygroup','mygroup'] is able to process the
double of the tasks a worker with group_names ['mygroup']
62 matches
Mail list logo