OK - hope I can make this clear - it's more of a 'how to' design question
and not really web2py specific.
Imagine a view/template with a container/div that displays a (multipage)
image gallery - this is the landing page (prepopulated with random images.
The page has a Search sidebar to allow
I have
grid =
SQLFORM.grid(query=db.lvstorage.setup_id==usedsetupid,csv=False,details=True,searchable=True)
That creates a form with the records with a add button. But when I use add I
get the next screen but the record is not added. What do I miss ?
Btw is the same setup with a query
are you able to see the form? or are you getting the not authorized
message?
you can set user_signature=False or ensure that user is logged in.
On Wed, Nov 2, 2011 at 6:50 AM, Mike Veltman mike.velt...@gmail.com wrote:
I have
grid =
are you able to see the form? or are you getting the not authorized
message?
you can set user_signature=False or ensure that user is logged in.
Thanks for the reaction. But no the form is generated perfectly. And the user
is logged in.
On Wed, Nov 2, 2011 at 6:50 AM, Mike Veltman
here is controller (sleep is for emulating long lasting action):
def akcje():
[...]
if request.vars.a == 'restart':
form=FORM(TR('Wybierz VPS',SELECT(ipvps,_name='ip',
requires=IS_IN_SET(ipvps))),
TR('',INPUT(_type='submit'),
formstyle='ul'),_id='staty')
Instead of form.accepts() you can use form.validate() and then do your
own update. Then you do not need to pass unnecessary variables to the
view and back again.
form = SQLFORM(table, id)
if form.validate():
form.vars.mysecretvariable=whatever I want
if not form.errors:
SQLFORM.grid does not actually add the records automatically. It just
calls the grid controller with args action/table.
You have to do something like:
if request.args(0) in (edit, new):
redirect(URL(edit.html, args=[request.args(1),
request.args(2)])
On Nov 2, 9:15 am, Mike Veltman
On Nov 1, 7:54 pm, Anthony abasta...@gmail.com wrote:
On Tuesday, November 1, 2011 6:20:57 AM UTC-4, Massimo Di Pierro wrote:
I am not sure I understand the proposal. You can override the format:
db.mytable._format = '%(name)s'
db.mytable._format = lambda record: SPAN(record.first_name)
oh yeah, that is working awesome. sometimes coding is better then
eating. thanx so much limedrop. have a great day. lucas
I am trying a custom AJAX like functionality.
I know, AJAX function in web2py is there.
But i need to populate values of html elements by their IDs.
Not just show the result in a 'target' DIV.
simplified code follows
[Controller]
def lod():
do some processing on request.vars.i1
I am trying a custom AJAX like functionality.
I know, AJAX function in web2py is there.
But i need to populate the values of html elements by their IDs.
Not just show the result in a 'target' DIV.
1) Upon clicking the link, controller action is performed (via a
'onclick' js handler) using value
ok, thank you for completely clarifying for me. it makes sense and it
is a matter or relative perspective. now i am straight.
one additional question, the response.download function confuses me
still. i get it that it is download to the client computer. what i
don't get is its parameters.
Hi,
I've a seemingly workable solution for this, but it's hardly elegant.
In my model, for the property_id field I have: -
,default=session.last_parent_id
,writable=False
,readable=True
...and in my controller: -
@auth.requires_login()
def property_detail_insert():
Hi,
I am a developer for Sahana Eden . I am facing the following problem :-
A variable is defined in the second file of the models of the
web2py-application ( there are more than 40 files in the models folder).
Depending on the value of that variable I wanted to stop the further
execution of
Context: Windows
Did not tried yet using the source code but using 1.98 i get the same
errors but the server never crashes...
2011/10/27 Ross Peoples ross.peop...@gmail.com
I don't think so. I access my dev machine using the IP all the time. Can
you try using the source code version instead of
Hi ,
Step1: Created table headers(cloumns) in the excel file EXACTLY
SIMILAR TO THOSE which are present in the database
Hi,
is there some problem with web2py site? I just started new project,
returned to web2py and need a book for a while in the re-beginning..:D
Michal
Hi,
I am facing the problem while importing csv file. Please find the
steps below that i am following.
Step1: Created table headers(cloumns) in the excel file EXACTLY
SIMILAR to those which are present in the database table
Step2: Inserted some dummy data as rows in the columns. All the
Hello,
I'm facing a pb with windows 7/SQLite (current)/python2.7
I'm working on local and just lunch web2py.py with python2.7
nearly 50% of my request have the folloowing issue :
Traceback (most recent call last):
File C:\Users\user11\Desktop\web2py\gluon\restricted.py, line 194, in
Looks like you've got your own Python installation and are running from
source. In that case, do you have http://sourceforge.net/projects/pywin32/
installed?
Anthony
On Wednesday, November 2, 2011 7:38:11 AM UTC-4, JmiXIII wrote:
Hello,
I'm facing a pb with windows 7/SQLite
Yes, looks like it's down: http://www.downforeveryoneorjustme.com/web2py.com
On Wednesday, November 2, 2011 6:55:41 AM UTC-4, glimmung wrote:
Hi,
I've a seemingly workable solution for this, but it's hardly elegant.
In my model, for the property_id field I have: -
,default=session.last_parent_id
,writable=False
,readable=True
...and in my
Website is back and running... YIPIIIEE
Michal
On 11/02/2011 01:01 PM, Anthony wrote:
Yes, looks like it's down: http://www.downforeveryoneorjustme.com/web2py.com
Dear Anthony,
I know, you explained me they were supposed to be identical.
In both cases, I can fill in the form the same way, but when you
submit the form and that a row in the database is added, the title
column is filled in, but not the tosomeone column.
Archibald
On 2 nov, 03:39, Anthony
Hi Anthony,
On 02/11/2011 12:06, Anthony wrote:
Does the parent_id have to persist across multiple requests? If so, then
storing in session is probably the way to go. If you don't want to have
the value appear in the form, you could either use an onvalidation
function to populate the value
On Wednesday, November 2, 2011 6:20:55 AM UTC-4, lucas wrote:
one additional question, the response.download function confuses me
still. i get it that it is download to the client computer. what i
don't get is its parameters.
response.download(request, db)
i get that it pulls the
Yep I have my own python installation and are running from source
Not I do not have pywin32 installed
But I do not remember to have it installed on my previous computer.
Anyway I'll try it thanks
On Wednesday, November 2, 2011 6:14:04 AM UTC-4, Vineet wrote:
script
function populate(){
var empid = {{URL(('lod'))}};
That's not how Ajax works -- you don't just assign a URL to a variable.
Instead, you have to explicitly make an Ajax call. If the web2py ajax()
function isn't
Hello,
I have installed pywin32 ofr python27
Seems to work a little better but if I stress my computer on a web page
(form for example), I still have the pb.
JmiXIII
You may also wish to consider using sub-folders for models.
all files in
models/a/
are executed only for actions in controllers/a.py
all files in
models/a/b/
are executed only for actions b() in controllers/a.py
this is for every a and b.
On Nov 1, 11:11 pm, Omi Chiba ochib...@gmail.com wrote:
Thank you for understanding me :)
I tried but this code will set the default value if the field exist on
the view.
I made a simple example. I don't want to show field2 so it's excluded
in view using custom form but want to store the
Hello list.
My question is this, I have a join in my query to the database, you
need to show the columns belonging to tables and routes accountcode,
here is my code:
left =
I needed to customize the behavior of gluon.contrib.populate.populate(),
so I created by version by adding ``values=None`` argument, and this
code after the ``elif field.type == 'id': continue``:
elif values is not None and values.has_key(fieldname):
if callable(values[fieldname]):
Hello,
I would like my users to be able to choose nothing, if they want to,
in a drop-down menu. The drop-down menu is generated using SQLFORM.
By default the validator does not accept that my users choose nothing.
How to change that ?
Thank you very much,
Bianca
Hi,
On 02/11/2011 13:59, DenesL wrote:
form.vars.field2 = 'BBB'
This should work to pre-populate the value of field2 with 'BBB' but it
seems to be broken in 1.99.2
I'm so glad you said that - this was one of the things I tried in
troubleshooting my Passing values to CRUD create from
You can try IS_EMPTY_OR(IS_IN_DB(...)) (also works with IS_IN_SET). You
might also want to specify a 'zero' option.
See http://web2py.com/book/default/chapter/07#Validators.
On Wednesday, November 2, 2011 10:35:26 AM UTC-4, Bianca Cadaveri wrote:
Hello,
I would like my users to be able to
thanks for replying.
I tried this--
[Controller]
def lod():
x = 'This is a val'
return $('#i2').val(x);
[/Controller]
[View]
{{extend 'layout.html'}}
input type='text' value='type a value' id='i1' name='i1' /
a href='#' onclick=ajax({{=URL('lod')}}, ['i1'], ':eval'); Load
result via AJAX
Hi,
I'm using web2py latest trunk on win7.
As soon as I applied the following changeset:
ce20196cd7b895029ed667ecff505987ee83d727 - (ce20196cd7b8) storage patch
I got errors both in shell and web requests ...
auth.settings.hmac_key = 'sha512:5fd2a4d2-d703-476c-8184-800b84e453b8'
On Wednesday, November 2, 2011 10:49:04 AM UTC-4, Vineet wrote:
thanks for replying.
I tried this--
[Controller]
def lod():
x = 'This is a val'
return $('#i2').val(x);
Note, the returned value is simply a string from the perspective of the
lod() function, so 'x' in that
You are right.
To clear any ambiguity, I did this --
return $('#i2').val('Vineet');
But still, no success.
Any other hint?
---Vineet
On Nov 2, 8:15 pm, Anthony abasta...@gmail.com wrote:
On Wednesday, November 2, 2011 10:49:04 AM UTC-4, Vineet wrote:
thanks for replying.
I tried this--
This is more like python question but
jj.J2NSD is integer and has value = 2030 (MMDD)
I want to set the value as default value of FFNSD which is 'date'
type.
Field('FFNSD', 'date'),
I think I need to import datetime and convert from integer or stiring.
Is anyone know easy way to do it
How are you making use of None values in Storage keys?
On Wednesday, November 2, 2011 10:59:01 AM UTC-4, Carlos wrote:
Hi,
I'm using web2py latest trunk on win7.
As soon as I applied the following changeset:
ce20196cd7b895029ed667ecff505987ee83d727 - (ce20196cd7b8) storage patch
I
Recently, I wrote this function for my purpose.
See if this helps you.
Assuming that argument 'dte' input format is -- 03-11-2011
[CODE]
import datetime, string
def str_to_dt(dte):
dte = str(dte)
dte = string.strip(dte)
if len(dte) == 10:
y = int(dte[6:])
m =
On Nov 2, 2011, at 7:59 AM, Carlos wrote:
I'm using web2py latest trunk on win7.
As soon as I applied the following changeset:
ce20196cd7b895029ed667ecff505987ee83d727 - (ce20196cd7b8) storage patch
I got errors both in shell and web requests ...
auth.settings.hmac_key =
Thanks for the reply
You may also wish to consider using sub-folders for models.
all files in
models/a/
are executed only for actions in controllers/a.py
Actually we wanted to execute most of the models for all the controllers
except this particular controller which needs only 2 files of
I've been asked by my colleagues to enumerate all hardware requirements for
deploying a server running web2py. My question is, how do I even begin to
calculate the requirements for the architecture, storage space, memory,
etc.? For architecture, am I basically stuck with x86? For storage, is
On Nov 2, 2011, at 8:20 AM, Anthony wrote:
How are you making use of None values in Storage keys?
I meant to ask the same thing, actually.
I *do* think it's a useful behavior of Python dicts that one can store None as
a dictionary value. I struggle sometimes with Objective-C, in which you
Hello,
I confirm that pywin32 doesn't help in this issue.
I've searched on the web but did not find any peaple facing this pb with
sqlite and windows7.
Yet I nearly bet that if i use win xp evferything is all right and i cannot
figure nobody has already faced this pb
... sic
JmiXIII
On Nov 2, 2011, at 8:20 AM, Anthony wrote:
How are you making use of None values in Storage keys?
It turns out that Settings depends on that behavior (note its last line).
Auth.__init__ sets auth.settings.hmac_key to None by default, and then sets
lock_keys. The presence of the None value (or
Hi,
I'm using Storage objects throughout my code, and compare vs None values to
perform certain specific actions.
Thanks!,
Carlos
I'm on Windows 7 with Python 2.7 32-bit and have never had this problem.
On Wednesday, November 2, 2011 11:35:43 AM UTC-4, JmiXIII wrote:
Hello,
I confirm that pywin32 doesn't help in this issue.
I've searched on the web but did not find any peaple facing this pb with
sqlite and windows7.
These files can appear ANYWHERE on the file system. I do not know in
advance, as the user can add directories for the input (and output)
data at runtime via configuration. So, I need a fully dynamic solution
that I can tweak programmatically at runtime.
Your solution (creating links under a path
On Wednesday, November 2, 2011 11:46:49 AM UTC-4, Carlos wrote:
Hi,
I'm using Storage objects throughout my code, and compare vs None values
to perform certain specific actions.
In your code, can you use the attribute access method, which will return
None when the attribute doesn't exist:
Thank you very much !
Could I also ask if it is possible to forbid one specific value for a
field ?
BC
On 2 nov, 15:45, Anthony abasta...@gmail.com wrote:
You can try IS_EMPTY_OR(IS_IN_DB(...)) (also works with IS_IN_SET). You
might also want to specify a 'zero' option.
I also have no problem.
Windows 7 64bit
Python 2.7 32 bit (64-bit version gave me problems)
Pywin 32-bit
Paolo
Hi,
Where I have a next in CRUD create/update, rather than the [id]
substring being replaced by the ID of the created/updated record, I'm
seeing %5Bid%5D.
My first question is why?, and that leads me to ask how I can refer to
the ID if I use the URL helper here rather than a simple string?
Hi Anthony,
One example is to pass an Storage object to form.accepts, containing None
values.
Carlos
On Nov 2, 2011, at 9:09 AM, Carlos wrote:
One example is to pass an Storage object to form.accepts, containing None
values.
It's a closed issue anyway, since Settings (and who knows what else) depends on
it.
I'm sure it's too late now, for compatibility reasons, but I think that deletes
In that case you have to pass a set instead of db to IS_IN_DB look in the
book it clear...
Richard
On Wed, Nov 2, 2011 at 11:55 AM, Bianca Cadaveri
biancacadav...@gmail.comwrote:
Thank you very much !
Could I also ask if it is possible to forbid one specific value for a
field ?
BC
On
May I send someone my app to check on a windows7 + python2.7 + sqlite to
check if this is an os/computer pb or linked to my app/database ?
What i cannot understand is why after 2 or more attemps it suddenly works
it really seems a randomly pb
I think it all depend of your needs (number of user, $$)...
A single virtual machine under ubuntu can easily run postgres or mysql,
apache and web2py with reasonable performance from 1 up to 50 users that
need to acces your app once in a wild... If your audience is bigger then
that you will maybe
Certainly there is s simpler way to talk to an already running
instance of rocket (mine) and tell it to serve more static files? I
could also do it via apache, if I could talk to apache and tell it to
serve from locations not listed in its config. I need to do this at
runtime, though.
On Nov 1,
Can you provide a packed .w2p web2py application?
Paolo
I'll give it a try.
On Wednesday, November 2, 2011 12:18:54 PM UTC-4, JmiXIII wrote:
May I send someone my app to check on a windows7 + python2.7 + sqlite to
check if this is an os/computer pb or linked to my app/database ?
What i cannot understand is why after 2 or more attemps it suddenly
Well, there's always this
option: https://groups.google.com/d/msg/web2py/_GohKTJhn5c/KkeQzH1xRf0J
On Wednesday, November 2, 2011 11:53:05 AM UTC-4, John Duddy wrote:
These files can appear ANYWHERE on the file system. I do not know in
advance, as the user can add directories for the input
On Wednesday, November 2, 2011 12:09:12 PM UTC-4, Carlos wrote:
Hi Anthony,
One example is to pass an Storage object to form.accepts, containing None
values.
I see -- so the keys have to actually exist.
Can you use the browser developer tools to confirm that the ajax request is
going out properly, and that the proper value is returned?
On Wednesday, November 2, 2011 11:19:09 AM UTC-4, Vineet wrote:
You are right.
To clear any ambiguity, I did this --
return $('#i2').val('Vineet');
But
On Wed, 2011-11-02 at 09:25 -0700, John Duddy wrote:
Certainly there is s simpler way to talk to an already running
instance of rocket (mine) and tell it to serve more static files? I
could also do it via apache, if I could talk to apache and tell it to
serve from locations not listed in its
Hi Jonathan,
I completely agree about deletes to be explicit in all cases.
In fact, Storage.__setattr__ should be changed to not auto-delete on None
value, but I guess it's not possible for compatibility reasons?.
Thanks again,
Carlos
On Nov 2, 2011, at 10:06 AM, Carlos wrote:
I completely agree about deletes to be explicit in all cases.
In fact, Storage.__setattr__ should be changed to not auto-delete on None
value, but I guess it's not possible for compatibility reasons?.
That's my assumption, yes.
Yes. I used Opera Dragonfly IE Developer Tools.
It doesn't show any js error.
After clicking the link also, no error.
How Where do I check the sent returned values? (in the developer
tools or in Dragonfly)
Thanks,
Vineet
On Nov 2, 9:45 pm, Anthony abasta...@gmail.com wrote:
Can you use the
The only other thing I can think of is putting that code in a module.
http://web2py.com/book/default/chapter/04?search=module#Accessing-the-API-from-Python-modules
But is there a specific reason you want to suppress model execution? Are
you running into any sort of problem?
On Wednesday, November 2, 2011 1:13:46 PM UTC-4, Vineet wrote:
Yes. I used Opera Dragonfly IE Developer Tools.
It doesn't show any js error.
After clicking the link also, no error.
How Where do I check the sent returned values? (in the developer
tools or in Dragonfly)
In IE,
Hi,
Just fixed an irksome problem and wanted to share!
I have a component, called with load. In the component is a view of a
record with an edit button, linkified using web2py's Ajax trap: -
{{=A(XML('button type=buttonEdit Landlord Registration/button'),
_href=URL(r=request,
Hello,
For hidden field I usually used p style=display :
None{{=form.custom.widget}}/p
But you can still access the value from code so it depends your needs.
JmiXIII
I did check the network tab in Opera Dragonfly.
Upon clicking the ajax link, there is no network activity.
Nothing is sent or fetched.
In Network tab = url, if I put manually '/appname/
controllername/' and click on Send Request,
In response, 'Failed to load URL'.
The URL helper, ajax function
That's cool - I'll definitely consider it. Thanks!
On Nov 2, 10:03 am, ~redShadow~ redsha...@hackzine.org wrote:
On Wed, 2011-11-02 at 09:25 -0700, John Duddy wrote:
Certainly there is s simpler way to talk to an already running
instance of rocket (mine) and tell it to serve more static
Hello,
I 'd like to use this great widget (slice 85
http://www.web2pyslices.com/slices/take_slice/85)
with a simple form FORM helper.
It works great with a SQLFORM but I need to use it (slightly modified)
in a FORM.
I saw that for this slice (http://www.web2pyslices.com/main/slices/
Hello,
is it possible to return json to the calling jQuery.ajax() function
after access was denied by decorator @auth.requires_login()?
I know there is a possibility to specify a function when authorization/
authentication failed with
auth.settings.on_failed_authentication = myFunc and
I was reading the previous post
https://groups.google.com/group/web2py/browse_thread/thread/51eed6556ba1b61f/a1f4395b7530192a?lnk=gstq=grid+edit#a1f4395b7530192a
but I cannot figure out how to do it with my grid.
In args, I want to pass the value of the field called db.PDTFF.FFDNO.
How can I do
Thanks everyone.
I'm easy person so I use the CSS to hide it just like JmixIII
mentioned.
something like this.
View
script
jQuery(function(){
jQuery('.hidden').hide();
};
/script
{{extend 'layout.html'}}
table
{{=form.custom.begin}}
Has anybody a solution for this?
Autocomplete web2py widget doesn't work in gae.
I've been searching in this group archive and I haven't found any solution.
Googling gives me some possible solutions, but they are really complex
unless you'd be a GAE expert.
One of the most attractive things of
Vineet,
Thanks for sharing.
It works like a charm !
On Nov 2, 10:27 am, Vineet vineet.deod...@gmail.com wrote:
Recently, I wrote this function for my purpose.
See if this helps you.
Assuming that argument 'dte' input format is -- 03-11-2011
[CODE]
import datetime, string
def
1. Does anyone have a Python 2.7 web2py app running on GAE?
2. Ditto, with WSGI rather than CGI?
I'm thinking that we need a new handler that's a blend of gaehandler.py and
wsgihandler.py.
On Nov 2, 2011, at 12:11 PM, Jonathan Lundell wrote:
1. Does anyone have a Python 2.7 web2py app running on GAE?
2. Ditto, with WSGI rather than CGI?
I'm thinking that we need a new handler that's a blend of gaehandler.py and
wsgihandler.py.
On second thought, would it work to app.yaml
Thank you very much !
BC
On 2 nov, 17:30, Anthony abasta...@gmail.com wrote:
Try IS_MATCH and specify a regex pattern that will exclude the item you
want to forbid.
Anthony
On Wednesday, November 2, 2011 11:55:28 AM UTC-4, Bianca Cadaveri wrote:
Thank you very much !
Could I
Not really a good solution, but you can do in the beggining of every model
file.
if request.function in ['index', 'another', 'other']:
#model code goes here
this way you can set which function will execute that model file.
On Wed, Nov 2, 2011 at 1:27 PM, anubhav aggarwal
It's not clear from the book. but will a piece of code like :
from gluon.tools import Service
service = Service()
def call():
session.forget()
return service()
@service.json
def submit(body, age, gender):
unique_id = insert_into_my_db(body, age, gender)
return
On Nov 2, 2011, at 12:35 PM, Raymond Elward wrote:
It's not clear from the book. but will a piece of code like :
from gluon.tools import Service
service = Service()
def call():
session.forget()
return service()
@service.json
def submit(body, age, gender):
unique_id =
On Wednesday, November 2, 2011 2:36:53 PM UTC-4, haggis wrote:
Hello,
is it possible to return json to the calling jQuery.ajax() function
after access was denied by decorator @auth.requires_login()?
I know there is a possibility to specify a function when authorization/
authentication
How about something like wrapping all your normal models inside a condition
block...
if not request.controller in []:
Another Thought: Based on the path listed in your Traceback, it looks like
you're running it from the desktop. Trying instead installing and running
from a root folder. Windows7 may restrict what will execute from the
Desktop folder.
I think you would pass the list of links to the images and then build
the tabletrtdimg src=%s/
On Nov 2, 3:29 am, BrendanC bren...@gmail.com wrote:
OK - hope I can make this clear - it's more of a 'how to' design question
and not really web2py specific.
Imagine a view/template with a
The URL has to be in quotes. Also, looks like the second arg to ajax()
should be the 'name' attribute of the input field, not the id (though, in
this case they are the same).
Anthony
On Wednesday, November 2, 2011 1:59:48 PM UTC-4, Vineet wrote:
I did check the network tab in Opera
You may also wish to consider using sub-folders for models
We have our own Conditional Model Loading system to handle not having to
load all models all the time.
We can't simply use the Web2Py system as we have too many inter-linkages
across models/controllers.
is there a specific reason you
VPS.net has been doing some maintenance
On Nov 2, 7:21 am, Michal Jursa mic...@jursa.cz wrote:
Website is back and running... YIPIIIEE
Michal
On 11/02/2011 01:01 PM, Anthony wrote:
Yes, looks like it's down:http://www.downforeveryoneorjustme.com/web2py.com
what is the question?
On Nov 2, 9:09 am, mmartinez alexra...@gmail.com wrote:
Hello list.
My question is this, I have a join in my query to the database, you
need to show the columns belonging to tables and routes accountcode,
here is my code:
left =
Why not have the Ajax request retrieve new HTML to replace the HTML
displaying the images? Your Ajax shouldn't be retrieving actually images,
it should just be retrieving HTML img tags with the appropriate
references to the image URLs.
On Wednesday, November 2, 2011 4:29:55 AM UTC-4, BrendanC
Can you show us your code? which web2py version?
On Nov 2, 11:07 am, Philip Kilner phil.kil...@gmail.com wrote:
Hi,
Where I have a next in CRUD create/update, rather than the [id]
substring being replaced by the ID of the created/updated record, I'm
seeing %5Bid%5D.
My first question is
As I wrote Massimo directly by accident, he answered me via mail: it's
not possible.
That's a pity. May this be possible in a future release? Otherwise
it's difficult to develope an application that works with ajax only.
In this case the only way I see to redirect a user after his session
timed
1 - 100 of 122 matches
Mail list logo