I'm trying to go through two lists using a form but I could make the
form move "forward" and "backward" through the list.
The tables are essentially the same except for the language used.
Could someone give me a nudge to the right direction? :)
Here's my code:
db.define_table('questionnaire',
Tests:
http://web2pyslices.com/main/slices/take_slice/99 - simple pdf report -
Yamandu
http://web2pyslices.com/main/slices/take_slice/93 - Auto tooltip - Yamandu
Ovidio Marinho Falcao Neto
ovidio...@gmail.com
88269088
Paraiba-Brasil
Hello,
I got problem with reading from uploaded xls just after forms.accept.
Code looks like this:
program.py
---
db.define_table('files',
SQLField('file', 'upload'),
SQLField('filename')
)
default.py
def upload():
# first form - working
# form = FORM('Upload file: ',
# I
Hi I'm new to web2py. I've made great progress in a few days with my
project.
SUMMARY: for every view I call, I get default.py as the controller.
Even if I specify app/view/view or app/namediffernt/view I still get
default.py as the controller. I appreciate any ideas or pointers on
what to try. th
SQLFORM automatically uploads the db.files.file to a file in uploads/
that means the input stream is empty after the load.
Do you want this to happen or just want it to pass to load_to_db?
Here are some options and one may be the one that you want:
Instead of:
form = SQLFORM(db.files, fields
Hi,
Since I am still learning Web2py i used to search for knowledge here and
there.. I found quite interesting question on stackoverflow that for my
understanding is not answered yet..
The question:
http://stackoverflow.com/questions/4979392/web2py-and-db-transactions
As I understand the probl
On Mar 25, 2011, at 9:15 PM, james c. wrote:
>
> Hi I'm new to web2py. I've made great progress in a few days with my
> project.
>
> SUMMARY: for every view I call, I get default.py as the controller.
> Even if I specify app/view/view or app/namediffernt/view I still get
> default.py as the contr
On 26 Mar, 15:34, Massimo Di Pierro
wrote:
> SQLFORM automatically uploads the db.files.file to a file in uploads/
> that means the input stream is empty after the load.
That would make a sense. Didn't think about it actually that input
stream might be emptied after saving file.
> Do you want th
Hi James,
It sounds like you might be thinking of how a PHP app might work, where your
URL points to a particular .php file, and that file is then processed to
generate the returned web page. web2py does not work that way. To get a
better understanding of how web2py does it, I recommend lookin
hi,
the tags widget in plugin_wiki are supposed to make posible to list pages
with same tag between same tables? that seems yet not posible, at least for
me, but I don't know if I missing something or not understanding well how
plugin_wiki_tag works. can you give an advice for this?
thanks in adv
Yes and no.
You can post the code there, if that's fine.
Yes, you can't upload a plugin as a zip, w2p or anything such.
It'll be a good idea to upload the code to github or bitbucket and link to
the repo in web2pyclices along with some examples on how to put your plugin
to any use.
Hope, this h
I followed the steps here but got a 502 Bad Gateway error from nginx.
On Mar 17, 5:25 am, minux wrote:
> pbreit, please ignore my last post. Actually I could make nginx+uwsgi
> up and running by reading carefully your posts above. I have sum up
> the instructions here:
>
> http://stackoverflow.c
Ok, let me double check the steps. I think that's an issue with nginx finding
uWSGI or uWSGI finding web2py. You might dig through the nginx or uWSGI logs.
Are your static files getting served ok? Is it a clean install of 10.04 or did
the server already exist?
I think there is some confusion here about how it all comes together. I'd
suggest following closely the overview chapter in the web2py book and make sure
to get a good grasp for how all the files work together when a URL is requested.
Basically, http://127.0.0.1:8000/myapp/default/index will loo
What about my solution ?
On Sat, Mar 26, 2011 at 7:41 PM, VP wrote:
> I followed the steps here but got a 502 Bad Gateway error from nginx.
>
>
> On Mar 17, 5:25 am, minux wrote:
> > pbreit, please ignore my last post. Actually I could make nginx+uwsgi
> > up and running by reading carefully yo
I tried minux's solution above.
By the way, I have Debian squeeze and I run web2py as my own user (not
as www-data). It seems I couldn't get uwsgi to start.
I have web2py + uWSGI + Cherokee
When I upload file, server is locking for all users.
Does somebody khow how to fix it?
I hope this helps.
http://groups.google.com/group/web2py/browse_thread/thread/62bece6a8c3b7524/e3289b402455758d
On Mar 26, 7:52 pm, LightOfMooN wrote:
> I have web2py + uWSGI + Cherokee
>
> When I upload file, server is locking for all users.
> Does somebody khow how to fix it?
>> location /static {
>> root /var/web2py/applications/init/;
>> }
Slowly, i'm getting it to work. Current problem: can't serve static
files (e.g. style css files). Is this configuration above correct?
I tried to point to my app static folder and didn't work either.
Thx, 4 helps.
But so if 4 users go to page with image, or upload some file, all will
be crashed again.
Is it a good to have 1000?
Sounds bad
> I have web2py + uWSGI + Cherokee
>
> When I upload file, server is locking for all users.
> Does somebody khow how to fix it?
>
You have to increase the number of workers (or threads).
Cherokee is a streaming server so it will pass POST data to uWSGI as
soon as they arrive leaving it blocked f
Just testing
set 10
but on the 4nd upload server locked
On 27 мар, 00:22, LightOfMooN wrote:
> Thx, 4 helps.
> But so if 4 users go to page with image, or upload some file, all will
> be crashed again.
> Is it a good to have 1000?
> Sounds bad
I'm not sure if carrying a transaction across multiple requests is possible,
mainly because you can't be assured of getting the same connection to the
database across requests.
Looking through the code, it does appear to be possible to override the
default commit behavior at the end of a succes
Yes, this is a replacement.
Trivial differences - just replaced MySQLdb references to
gluon.contrib.pymysql, removed the comment up top about depending on
MySQLdb, and added ".." to the python path so that it can find gluon.contrib
even if the web2py directory isn't in your system pythonpath.
I like your number 4, with a tweak:
"*CODE LESS, ACCOMPLISH MOR*E"
I think I found a difference in the behavior of Rows slices versus
regular list slices:
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from gluon.dal import Rows
>>> l=range(
It appears that Python's __getslice__(self, a, b) overload has a surprising
behavior. From
http://docs.python.org/reference/datamodel.html#object.__getslice__:
"If negative indexes are used in the slice, the length of the sequence is
added to that index."
So when you evaluate rows[-20:], Pytho
I was under the impression that you could pass your own dictionary to
form.accepts but in the code below it neither accepts correct values
nor returns any errors with incorrect ones. Am I mistaken about being
able to do this or am I doing something wrong with my approach?
Thanks for any help.
fie
Hi all,
I'm trying to get a result for this query:
select vendor.id, vendor.Name,
(select count(*) from sales_order where [Status] = 1 and vendor.id =
sales_order.VendorID),
(select count(*) from sales_order where [Status] = 2 and vendor.id =
sales_order.VendorID),
(select count(*) from sales_ord
I think requires_login() -- and possilbly requires() -- assumes that
the login page is in the default/user. Should this URL be
auth.settings.login_url ?
I don't have authentication in default/user, so I have to redirect to
the appropriate place if a user tries to access a page that requires
login
There's a checkbox to turn the marketplace off. "Receive insight from
the actual people who conceived Cherokee and are the core committers
of such technology." From Enterprise Support Services, Octality I
imagine the ideas and money go both ways. Guessing of course.
On Mar 10, 11:17 am, pbreit
Hi-
I reported an issue on the Google projects issues list (#150) on Jan
6, and I am wondering how to find out if/when the issue might be
addressed. I believe the issue is pretty simple (an esception occurs
when a record is inserted into a table with a legacy primary key,
which I unfortunately ha
Internal error
Ticket issued: admin disabled because unable to access password file
Doing: http://web2pyslices.com/main/slices/take_slice/110
Using ISP IP.
On Mar 26, 12:27 am, pbreit wrote:
> The uWSGI is required as far as I know. It's an alternative to fastcgi.
> Cherokee is fully aware of
Can you please send me a patch as an attachment?
On Mar 26, 3:13 pm, Kevin Ivarsen wrote:
> It appears that Python's __getslice__(self, a, b) overload has a surprising
> behavior.
> Fromhttp://docs.python.org/reference/datamodel.html#object.__getslice__:
>
> "If negative indexes are used in the
use
if form.accepts(formvars,dbio=False,formname-None)
else iit expects a formname key in the formvars.
On Mar 26, 3:36 pm, Lennon wrote:
> I was under the impression that you could pass your own dictionary to
> form.accepts but in the code below it neither accepts correct values
> nor returns
You an have a nested select in place of a field.
I think you want:
count = db.sales_order.id.count()
query = db.sales_order.VendorID == db.vendor.id
rows1 = db(query)
(db.sales_order.Status==1).select(db.vendor.id,db.vendor.Name,count)
rows2 = db(query)
(db.sales_order.Status==2).select(db.vendor.
yes and not. Plugin wiki simply allows to tag objects, ids but
(tablename, record_id). plugin_wiki does not keep track of which pages
contain which widgets. If you tag the page, instead of the objects
they contain, than you get pages by tags. Anywa, you just gave me a
suggestion for improvement
Yup, that fixed it. Thanks!
On Mar 26, 5:26 pm, Massimo Di Pierro
wrote:
> use
>
> if form.accepts(formvars,dbio=False,formname-None)
>
> else iit expects a formname key in the formvars.
>
> On Mar 26, 3:36 pm, Lennon wrote:
>
>
>
>
>
>
>
> > I was under the impression that you could pass your
Alright, I will set something up for sharing code with you guys...
Thanks...
On Sat, Mar 26, 2011 at 1:35 PM, Arun K.Rajeevan wrote:
> Yes and no.
> You can post the code there, if that's fine.
>
> Yes, you can't upload a plugin as a zip, w2p or anything such.
> It'll be a good idea to upload th
Hi
I follow this guide
http://stackoverflow.com/questions/5335153/how-to-deply-web2py-using-nginx
I have ubuntu 10.4 + nginx + web2py, installed in var
And the result is 502 Bad Gateway.
Any suggestions?
2011/3/26 Massimo Di Pierro
> yes and not. Plugin wiki simply allows to tag objects, ids but
> (tablename, record_id). plugin_wiki does not keep track of which pages
> contain which widgets. If you tag the page, instead of the objects
> they contain, than you get pages by tags. Anywa, you just ga
I have Ubuntu 10.04 and web2py in var
I try to run it as a daemon
such as in http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon
but seems, that when I type "sudo /etc/init.d/web2py start", it's
nothing happens.
No errors and no web2py daemon run
Make sure uwsgi has the correct path. Look at /etc/init.d/uswgi
There's a path to uwsgi. The latest uwsgi sets the path to /usr/bin/
uwgsi but it might have been installed in /usr/local/bin/uwsgi
On Mar 26, 5:04 pm, LightOfMooN wrote:
> Hi
> I follow this
> guidehttp://stackoverflow.com/que
When using SQLFORM, I'd like to get the default/computed values of
fields not included in the form. Can I do this without making another
query? Can I get, say, the autogen'd id of the new record? For
example:
form = SQLFORM(db.job_post, submit_button='Post Job',
formstyle='table2cols',
fie
We have troubles in GAE and web2py integration in our graduation
project
We tried many tutorials in the web and we fails so I hope you can help
us with step by step advice
Ahmed Sharkawy
4th year engineering faculty
The new record id will be in form.vars.id after the accepts.
On Mar 26, 7:46 pm, Brian Will wrote:
> When using SQLFORM, I'd like to get the default/computed values of
> fields not included in the form. Can I do this without making another
> query? Can I get, say, the autogen'd id of the new rec
Note that __getslice__ is used in:
dal.py (3 times), html.py and languages.py
On Mar 26, 5:25 pm, Massimo Di Pierro
wrote:
> Can you please send me a patch as an attachment?
Hi all
I am learning the ropes so to speak and am using a remote mysql as a
db
I have sorted out the tables from legacy db to be generated by web2py
along with the auth tables
I need to know what the quick way is to reset the db - as i learn and
make mistakes
in previous times I would just drop a
I'm sure someone here can help you, but you'll have to provide more detail
regarding what you've done so far and exactly what errors or problems you
are seeing.
On Saturday, March 26, 2011 7:10:55 PM UTC-4, Shark wrote:
>
> We have troubles in GAE and web2py integration in our graduation
> pro
Drop the database and create it.
Remove all files in /databases
That way web2py loses the old state of the database and recreates all
tables.
If you only want to reset a table, drop that table and remove responding
file under databases
Kenneth
Hi all
I am learning the ropes so to speak
Check the sections in the book about Migrations (
http://web2py.com/book/default/chapter/06#Migrations) and "Fixing Broken
Migrations" (
http://web2py.com/book/default/chapter/06#Fixing-Broken-Migrations). web2py
stores migration information for each table in files in the 'databases'
folder (so
Thank you both
the migrate was set to false on the table I was on
excellent
I had tried deleting stuff in /databases but was not sure on the file
name which should go
sorting the migrate has fixed the immediate annoyance
much appreciated and great response time
thank you
On Mar 27, 12:47 am, Ant
Thanks, that's a start, but how now do I get 'uuid' which I've set as
a default field in the model. Is there a way I can manually set the
value in the controller before invoking form.accepts? Simplest I can
think of is:
value = computevalue()
db.table.field.default = lambda: value # effectively
Found my own answer: I can create an onvalidation function for the
form that only runs when the form is accepted but before the new
record is made. The problem this then introduces is how to set the
enclosing variable from the function without use of nonlocal. Guess I
can just create a dict for the
I don't know about running web2py using uwsgi;
However;
When I run web2py with nginx I use the fastcgi module;
I configure nginx like described in the stackoverflow article;
except I use fastcgi;
In nginx config I have
location / {
include fascgi_params;
fastcgi_pass unix:/tmp/fcgi.s
Same test with nginx (4 workers).
It's actually about 3ms/request slower than with the Apache set up.
On the other hand, nginx uses about 200-300MB fewer in RAM. During
the stress test, it also opens much fewer files.
I think I will use nginx for a while to see if it is as stable as
Apache.
=
That is what I have in /etc/init.d/uwsgi:
PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/uwsgi
OWNER=uwsgi
Should I modify it to:
PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/local/bin
DAEMON=/usr/local/bin/uwsgi
OWNER=www-data
?
On 27 мар, 05:55, VP wrote:
> Make sure uwsgi has t
> Thx, 4 helps.
> But so if 4 users go to page with image, or upload some file, all will
> be crashed again.
> Is it a good to have 1000?
> Sounds bad
>
This is a normal deploy problem (not related to uWSGI). This is why
async/evented is so loved this days :) If your machine can tolerate 1000
pro
Thx, but what is the best solution for now to deploy web2py with more
than 3k users online, which can upload and download files?
On 27 мар, 11:46, "Roberto De Ioris" wrote:
> > Thx, 4 helps.
> > But so if 4 users go to page with image, or upload some file, all will
> > be crashed again.
> > Is it
59 matches
Mail list logo