Hi
I was working on the a controller function where the end result was the row
id following a
def insert_record()
id= db[f].insert(**data) operaton
return id
As it turns out, this works without a hitch on my mac running python 2.7.10
and Web2py Version
.
Any suggestions on how to debug/troubleshoot this would be most appreciated!
Calvin
--
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
I have an error handler within web2py that provides the error trace.
One hypothesis offered was that nginx is closing the socket as uwsgi is
taking too long to serve data. I've increased the keepalive_timeout
parameter from 60 to 600 but this does not help. Where else could the
problem be?
Or why not http://html2pdfrocket.com instead? It's free.
On Tuesday, 21 April 2015 03:52:10 UTC+8, Ovidio Marinho wrote:
Has anyone tried to use it with web2py?
http://www.princexml.com/doc/9.0/python/
[image: http://itjp.net.br] http://itjp.net.br
Hi
When I access the wiki function with an impersonated account, the
impersonated account automatically gets added to the wiki_editor group at
least for the duration of the account being impersonated. Is this the
desired behaviour?
Thanks
Calvin
--
Resources:
- http://web2py.com
- http
' object has no attribute 'Table'
This used to work before (Version
2.9.6-stable+timestamp.2014.09.02.10.10.07)
Would this functionality be removed moving forward or is this an unintended
omission?
Thanks
Calvin
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation
to internationalize this?
On Friday, 22 August 2014 10:33:28 UTC-5, Calvin wrote:
Hi Massimo
Here's an example:
T.M(hello ``you``:custom, extra=dict(custom=lambda x: SPAN(x, _style=
font-size:0.8em)))
which throws
*** TypeError: M() got an unexpected keyword argument 'extra'
Calvin
Hi Massimo
Here's an example:
T.M(hello ``you``:custom, extra=dict(custom=lambda x: SPAN(x, _style=
font-size:0.8em)))
which throws
*** TypeError: M() got an unexpected keyword argument 'extra'
Calvin
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http
Hi
I am wondering if it is possible to customise the render function within a
``code`` segment with T.M(). I have tried adding the extra keyword as
documented in the Markmin documentation but this is generating out a
keyword not recognised error.
Thanks in advance!
Calvin
--
Resources
I am so glad I am not taking intro to programming ever again. I hate string
manipulation!
Massimo - you might want to resend this to your actual students
Calvin
On 4 March 2014 14:20, Massimo Di Pierro massimo.dipie...@gmail.com wrote:
During lab today you will begin writing the solutions
Hi,
http://web2py.com/books/default/chapter/29/13/deployment-recipes
this page offers different deployment recipes for hosting like
PythonAnywhere. If your host (i am unfamiliar with go-daddy) provides you
root/shell access to a linux box, you shouldn't have any trouble. I am
Running my web2py
Also, relatedly, I was trying to restart apache from within a web2py app.
That was giving me errors, so I'm doing something else. Is there a way to
do this?
you can do it from the shell. Look up your relevant distro information
on init scripts.
usually it's something like
sudo service
Look at the scheduler documentation. I have mine called this way from
my db.py. This calls a few different tasks, adding file size and also
calling a task called unzip / untar which are functions i have written
to handle zipping and unzipping. Hopefully this explains it somewhat
def
Hi
I am looking for a way to expand all referenced fields and have read about
the as_trees() method for selecting rows. I do not quite understand the
parent field requirement, but say we have the following
tables/relationships, was looking for a nested dict output which could be
JSONified as
(
'World')).xml(),
time_expire=100))
{{=myoutput}}
On Monday, January 27, 2014 10:06:59 AM UTC-5, Calvin wrote:
Thanks Leonel-I tried this without any success. It still rendering
incorrectly but this time consistently before and after caching.
On Tuesday, 21 January
filled. Perplexed!
On Wednesday, 29 January 2014 14:12:05 UTC+8, Anthony wrote:
On Wednesday, January 29, 2014 12:19:54 AM UTC-5, Calvin wrote:
Thanks Anthony. It still appears to be returning the string result rather
than the HTML object - even for the first time the function is called
Thanks Leonel-I tried this without any success. It still rendering
incorrectly but this time consistently before and after caching.
On Tuesday, 21 January 2014 03:34:39 UTC+8, Leonel Câmara wrote:
You can use {{=XML(output, sanitize=False)}} to get the correct rendering
--
Resources:
-
web2p in the background for wsgi so that it's
not so slow?
Calvin
--
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
I've been having trouble with centOS getting a 503 Service unavailable
using Apache's httpd. If anyone else is seeing this same problem, I
found that this solved my problem:
adding this to my main httpd.conf:
WSGISocketPrefix /var/run/wsgi
--
Resources:
- http://web2py.com
-
A ghetto way: just open a file and use regular write commands
On Jan 26, 2014 1:30 PM, horridohobbyist horrido.hobb...@gmail.com
wrote:
I'm looking for a simple way to print out statements in Python. I
understand the 'print' function outputs to the console on the server side,
but once web2py
recreate it:
SMALL = lambda x, **kwargs: TAG.small(x, **kwargs)
cache.disk('Hello', lambda: CAT(P('Hello'), SMALL('World')), time_expire=100
)
Any ideas?
Calvin
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https
Thanks Leonel! That works.
I ended up doing it as follows:
SMALL = lambda x, **kwargs: XML(TAG.small(x, **kwargs).xml())
cache.disk('Hello', lambda: CAT(P('Hello'), SMALL('World')), time_expire=100
)
However, with such an approach, the retrieved cache value is a string
rather than an XML
elance.com?
On 11 January 2014 23:04, Simon Ashley gregs...@gregsier.com.au wrote:
Often thought that it would be good to push this to another level. We have
projects from time to time that would be good to outsource, if people were
interested. Something like a project post board, with
Brando,
Thanks for working this out!
it would be good to make a web2py slice or add it to the documentation/ examples
Calvin
On 8 January 2014 14:35, Brando bhe...@trustcc.com wrote:
This works, added the requires statement for form validation:
def submit():
import datetime
form
I just wrote my own way to do it yesterday which worked great. I would
love it to go upstream.
It's just a standard file upload with the multiple attribute.
here's the entire thing: it spits out a form.
my db looks like this:
db.define_table('uploads',
Field('username', 'string'),
or not, i have that weird is in
then len() 0 but i don't think it's the best.
Whoever is a maintainer/developer of web2py - could we integrate this
somehow?
Calvin
On 8 January 2014 10:40, Brando bhe...@trustcc.com wrote:
Calvin, you are awesome. I will try this on my end and report back
it to the local
disk?
On Wednesday, January 8, 2014 7:18:28 AM UTC-8, Calvin Morrison wrote:
I just wrote my own way to do it yesterday which worked great. I would
love it to go upstream.
It's just a standard file upload with the multiple attribute.
here's the entire thing: it spits out
Yes I am getting that same problem here.
Like I said, I don't really know how to properly test if the variable has
been set.
Any input from more wise web2pyers would be great
Calvin
On 8 January 2014 14:03, Brando bhe...@trustcc.com wrote:
Calvin, I'm getting this error when I select only 1
that'd be a Jquery thing.
jQuery(input#fileid).change(function () {
alert(jQuery(this).val())
});
On 8 January 2014 14:36, Brando bhe...@trustcc.com wrote:
Question, how could I make it so I don't have to click the submit button.
How could i make it to where they choose the files and
great thanks!
On 7 January 2014 15:18, Anthony abasta...@gmail.com wrote:
1. Where should I put my custom widget logic?
Right now i have it grossely stored in my db.py
You can always put it in a module file and import it.
2. Can i pass more information to my widget other than field,
Happy New year Massimo and all the contributors who have made web2py so awesome!
--
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
Hi!
I have a field called Job Type, and another field database that
depends on the type. If the user selects Train for Job Type, they
don't need to enter a database (a integer id), but i don't know how to
make validators do this for me.
Right now I have this:
db.jobs.db.requires =
Here is my solution!
if hasattr(request.vars['up_file'],filename):
form.vars.filename = request.vars['up_file'].filename
if form.process().accepted:
redirect(URL('data', 'index'))
elif form.errors:
response.flash = form has errors
On 28 December 2013 17:08, Calvin Morrison
=[IS_NOT_EMPTY(),
IS_UPLOAD_FILENAME(extension=ext_regex)]),
You can submit a form that does not upload a file into up_file?
On Thursday, 26 December 2013 13:21:35 UTC-6, Calvin Morrison wrote:
I'm following the documentation trying to figure out how to correctly
save a filename to my uploads
('up_file', 'upload', uploadseparate=True, requires =[IS_NOT_EMPTY(),
IS_UPLOAD_FILENAME(extension=ext_regex)]),
You can submit a form that does not upload a file into up_file?
On Thursday, 26 December 2013 13:21:35 UTC-6, Calvin Morrison wrote:
I'm following the documentation trying to figure
I'm following the documentation trying to figure out how to correctly save
a filename to my uploads database.
Basically i have the same code as the website shows in it's examples
def submit():
import datetime
form = SQLFORM(db.uploads, fields=['up_file', notes], deletable=True)
I'm using web2py 2.7.4-stable+timestamp.2013.11.25.15.21.21 but it doesn't
appear that the patch for this is in yet.
However, instead of doing the removal of the Wiki link with jQuery on the
client, which is susceptible to being hacked by a savvy user, the following
may be more secure:
To
Thanks for the clarification but in any case, I thought it was Google
acting up!
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I would like to suggest a generic query which could allow queries within
the DAL framework for functions supported by the database but not web2py's
DAL by feeding in the raw query as would be expected in SQL native to a
particular database. While DAL hides alot of subtle differences in
:25 UTC+8, Massimo Di Pierro wrote:
Can you show an example of how you plan to use something like this. I
believe there is already a method
db(Expression(db, ... raw query ...)).select()
perhaps I do not understand.
On Tuesday, 25 June 2013 22:36:45 UTC-5, Calvin wrote:
I think it would
Not sure why it says my previous reply has been deleted but here it is
again:
Hi Massimo
I am not familiar with the method you suggested but when I tried it, I got
the following error:
print db(Expression(db,business_view.loc
ST_MakeEnvelope(42.179139323652443, 141.20906066894531,
Thanks Anthony and Massimo. It all works now!
On Thursday, 27 June 2013 00:42:26 UTC+8, Anthony wrote:
from gluon.dal import Expression
Anthony
On Wednesday, June 26, 2013 11:53:34 AM UTC-4, Calvin wrote:
Not sure why it says my previous reply has been deleted but here it is
again:
Hi
I think it would be nice to specify custom operators that can be used with
the DAL as I believe this would allow for operators that are currently yet
to be supported with a built-in DAL operator...
From dal.py, I am thinking this should be relatively easy to implement, and
code would be along
Just wondering if a cache decorator would work here?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options,
Just wondering if a cache decorator would work here?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options,
Just wondering if a cache decorator would work here?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options,
before the call to SQLFORM.smartgrid, add
db.tablename.linkfield.readable=False
On Monday, 27 May 2013 23:57:31 UTC+8, Ricardo Cárdenas wrote:
Hi,
My model contains a URL field, and I'm displaying the model in a
SQLFORM.smartgrid. I don't want to show the whole URL, but I do want the
Check the file permissions for the static folder to see if it's own by uwsgi
(if you're using that... or whichever wsgi)?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it,
Check the file permissions for the static folder to see if it's own by uwsgi
(if you're using that... or whichever wsgi)?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it,
I've not verified the code but something along the lines of:
script
var rec =
JSON.parse('{{=json.dumps(db(db.xyz.id0).select().as_list())}}');
/script
You could then write some javascript to populate block 2 using the rec
object created...
On Sunday, 19 May 2013 11:32:40 UTC+8, Lio wrote:
I was searching for the above functionality and found a solution using
Flask and StringIO as below (short code snippet attached for convenience).
Is there a way to do the same with web2py?
http://flask.pocoo.org/snippets/32/
#!/usr/bin/env python
# Thanks to Dan Jacob for a part of the code
Thanks Anthony.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options, visit
How about doing your own widget:
import re
def natural_key(string_):
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_)]
items = db(db.item_type.id 0).select()
sorted_items= items.sort(key=natural_key(items.name))
db.item.item_type.widget = lambda f, v:
in SQLFORM.grid is by
design?
Many thanks
Calvin
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options
If of interest to anyone, eventually, I made my own autocomplete based on
Bootstrap Typeahead:
def bs_typeahead(f, v, **kwargs):
options = {'_data-provide':'textahead'}
options.update(kwargs)
return CAT(
INPUT(_type=text, _class=string, _id=%s_%s_ac % (f._tablename,f
.name),
I have been using the autocomplete widget which makes is really convenient.
However, there are times where I would like to customise what is shown in
the SELECT say with a custom expression rather than being limited to each
OPTION being the value of the field in the row.
It appears that the
?
On Wednesday, February 27, 2013 1:59:38 AM UTC-5, Calvin wrote:
I am encountering a strange observation in that when accessing the Rows
object for a given table, the object returns all the fields except for
those that are of the reference type. I am using the HEAD version... Is
this a bug
I am encountering a strange observation in that when accessing the Rows
object for a given table, the object returns all the fields except for
those that are of the reference type. I am using the HEAD version... Is
this a bug?
--
---
You received this message because you are subscribed to
the countries form is
shown, I am wondering if there is a way to add a filter to the options
widget?
On Wednesday, 2 January 2013 20:13:46 UTC+8, viniciusban wrote:
Ajax will help you.
You need to load countries HTML OPTION's when continent changes.
On Wed, Jan 2, 2013 at 3:26 AM, Calvin
variable
and use the widget method of the base class?
Massimo
On Sunday, 30 December 2012 12:01:06 UTC-6, Calvin wrote:
Hi Massimo
Here is a patch which updates the date, time and datetime widget. If this
approach is acceptable, I am happy to provide a patch for the other types
as well
Say I have a look-up tables as follows:
db.define_table('continent',
Field('name')
)
db.define_table('country',
Field('name'),
Field('in_continent', db.continent, requi)
)
Now, if I then have a table as defined:
I would then like to have an SQLFORM in which field country presents a
Hi Massimo
Here is a patch which updates the date, time and datetime widget. If this
approach is acceptable, I am happy to provide a patch for the other types
as well.
Calvin
On Sunday, 30 December 2012 00:50:59 UTC+8, Massimo Di Pierro wrote:
I think this would be a good idea but somebody
WHATWG (*Web Hypertext Application Technology Working
Grouphttp://www.whatwg.org/
) list a wide range of input types in *
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attribute
Could we update SQLFORM.widgets so that a whole
I would like to get the translation function T() working within a module in
web2py but I am not sure how one would go abouts importing the necessary
modules to do that. Could someone enlighten me on this?
Many thanks in advance!
Calvin
--
further clues?
many thanks
Calvin
-
On Thursday, 27 September 2012 18:14:49 UTC+8, Manuele wrote:
Il 27/09/2012 05:02, Calvin ha scritto:
Hi
I am a big fan of Web2py and would like to use the DAL for capturing
location specific information. I use MySQL as a back-end
. For
instance, how could I get the DAL to define a field as a WKT point?
Many thanks
Calvin
--
(_width=c['width'])
if c['class']!=:
attrcol.update(_class=c['class'])
row.append(TH(c['label'],**attrcol))
components.append(THEAD(TR(*row)))
+else:
+ headers={}
Cheers
Calvin
67 matches
Mail list logo