Thank you Brendan. 5 years later this is still an issue.
I am using the pyDAL library with the bottle framework. It is very nasty to
try and access the count value in JavaScript buried under, e.g.
_extra.count(tagref.tag)
If you just want to get rid of the _extra part, you can simple use
for
Hi,
I was trying to parse the contents of a single gzipped file, but kept
getting an empty file.
@auth.allows_jwt()
@request.restful()
def log():
def POST(*args,**vars):
with gzip.GzipFile(fileobj=request.vars.file.file, mode='rb') as f:
test = f.readlines()
I'm having some trouble uploading/accessing a file on Google App Engine
(GAE).
This is the code used to store the file:
@request.restful()
def workspace():
def POST(*args,**vars):
workspace_id = db.workspace.insert(repository=request.vars.
repository,
I recently upgraded an application on Pythonanywhere.com to: Version
2.12.3-stable+timestamp.2015.08.19.00.18.03
Part of the application uses jQuery to post files to a web2py REST API.
After the upgrade I noticed that I kept getting this unhelpful error 500
message:
PythonAnywhere: something
Thank you Massimo.
Also I just noticed the subject line variable line 1255:
bulk_invite_subject='Invitation to join%(site)s’,
Should be:
bulk_invite_subject='Invitation to join %(site)s’,
And if I may suggest exposing bulk_register_enabled in the welcome app
models/dp.py file to alert
Thanks Selman. I have already begun work to put a version up on github.
Hopefully I'll have something up tonight.
On 27 Oct 2015 1:27 PM, "Selman Kocael" <selciu...@gmail.com> wrote:
> it's nice.
>
> 2015-10-26 21:49 GMT+02:00 James Burke <james.burke1...@gmail.com&
I've posted the source code of my CMS on github:
https://github.com/peregrinius/web2py-liscio
I migrated it onto the latest version of web2py, but there is a change on
the new version which means a menu items with children is no longer
clickable link. I guess this is for the benefit of
Ok I've done some testing and found a couple of typos, including,
tools.py - line 3283:
if not self.setting.bulk_register_enabled:
should be
if not self.settings.bulk_register_enabled:
This results in an exception preventing the feature from working.
I tried submitting a pull request
I created a CMS a few years ago now in web2py... It is fairly basic
compared to Carlos one.
I have a test website for a client on GAE
http://badevday-test.appspot.com/
to access the backend
http://badevday-test.appspot.com/admin
login: user-gr...@web2py.com
password: passw0rd
It doesn't
I've just uploaded a simple app to GAE using the bitbucket mirror.
Seems odd that it is looking for pydal in an applications modules...
I get the same error with versions:
Version 2.12.3 & Version 2.9.12
But I don't get the error deploying from GAE Launcher
Unable to store in FILE:
Thank you for your reply Leonel.
Is that a setting in Google Developers Console? I think I remember seeing
it somewhere but can't recall where!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
.
On Wednesday, 20 May 2015 03:12:24 UTC-5, James Burke wrote:
Hi,
I'm looking for a peer review of some code I put together for email
inviting users to join an application. I couldn't find anything suitable
looking around, hopefully I didn't overlook anything!
The idea is, you enter in email
to be tested and maintained
by the developers indefinitely). Instead, maybe this could be a plugin.
Anthony
On Thursday, May 28, 2015 at 1:19:07 AM UTC-4, Massimo Di Pierro wrote:
think this is an excellent idea. Please submit a pull request.
On Wednesday, 20 May 2015 03:12:24 UTC-5, James Burke
Will do. Thank you for your feedback.
On Thursday, May 28, 2015 at 5:19:07 PM UTC+12, Massimo Di Pierro wrote:
think this is an excellent idea. Please submit a pull request.
On Wednesday, 20 May 2015 03:12:24 UTC-5, James Burke wrote:
Hi,
I'm looking for a peer review of some code I put
Hi,
I'm looking for a peer review of some code I put together for email
inviting users to join an application. I couldn't find anything suitable
looking around, hopefully I didn't overlook anything!
The idea is, you enter in email addresses into a form, click submit and it
will send an email
Is there a way to sort the query below by the number of search items found
in each result?
def GET(*args,**vars):
search = [x for x in request.vars['search'].split(' ') if len(x)
3]
result = []
if search:
query = db.question.heading.contains(search,
Final solution was this:
_tables.py
def store_file(file, filename=None, path=None):
path = path #applications/init/uploads
if not os.path.exists(path):
os.makedirs(path)
pathfilename = os.path.join(path, filename)
dest_file = open(pathfilename, 'wb')
try:
Thank you Leonel, great idea.
Although I'll need to use oncreate/onupdate since I'm using a smartgrid
Cheers,
-James
On Tuesday, December 2, 2014 10:28:49 PM UTC+13, Leonel Câmara wrote:
There are lots of ways to do this, the easiest is probably to just define
the uploadfolder for the
the upload folder as function of something that happens after.
Please explain to us in english of the folder should depend on the upload
and perhaps we can suggest a way to do it.
On Saturday, 29 November 2014 14:08:20 UTC-6, James Burke wrote:
How do you create a dynamic uploadfolder
suggest a way to do it.
On Saturday, 29 November 2014 14:08:20 UTC-6, James Burke wrote:
How do you create a dynamic uploadfolder for an upload Field?
I tried using:
uploadfolder= lambda r: db.repository(r.repository_id).directory
but i get the error message, I guess it doesn't have the same
How do you create a dynamic uploadfolder for an upload Field?
I tried using:
uploadfolder= lambda r: db.repository(r.repository_id).directory
but i get the error message, I guess it doesn't have the same functionality
as compute:
cannot concatenate 'str' and 'function' objects
I'm also using
Ok I tried:
@cache.action(time_expire=1200, cache_model=cache.memcache, quick='SVL')
def fast_download():
import time, os
import contenttype as c
# very basic security:
if not request.args(0).startswith(file.file):
return download()
file_id = request.args(-1)
I'm exploring options.
I want to be able to cache my images. Client side, server side it doesn't
matter.
What is the best method to go about this?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Version 2.7.4-stable+timestamp.2013.10.14.15.16.29 recent enough?
It's after your original post.
On Tuesday, January 28, 2014 2:49:52 AM UTC+13, Niphlod wrote:
probably you're not running a recent web2py release.
On Saturday, January 25, 2014 9:37:12 PM UTC+1, James Burke wrote:
def
I tried using the above code, but results in the follow error message:
cache.client(time_expire=604800, quick='SVL')(lambda: 0)()
AttributeError: 'Cache' object has no attribute 'client'
Am I missing something?
Cheers
-James
On Monday, April 15, 2013 1:21:18 AM UTC+12, Niphlod wrote:
, would it be possible to somehow incorporate that
into what I have? Could you also explain why you used += instead of
append? Maybe I could figure out something from that.
Thanks
On Tuesday, January 21, 2014 12:11:59 AM UTC-6, James Burke wrote:
Hi,
I managed to get one working a little
You could simply declare it for testing purposes.
Set it to false.
--
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
Thanks for the solution Quint, I think I've got it:
_db.py - model
if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
db = DAL('sqlite://storage.sqlite', pool_size=1, migrate=True)
#,check_reserved=['all']
else:
## connect to Google
Hi,
I managed to get one working a little while ago doing this. This has been
adapted for your situation, may require some tweaking:
_tables.py - model
db.define_table('store_catelog')
db.define_table('store_catelog',
Field('title', 'string'),
Field('description', 'text'),
Hi,
I'm having difficulty setting up cache on GAE.
@cache(request.env.path_info, time_expire=60*60, cache_model=cache.ram)
def index():
index = db(db.page.sequence==0).select(db.page.title, db.page.body, db.
page.side, cacheable=True).first()
return dict(index=index)
Using the
I found a cache.memcache example on this page:
http://web2py.com/book/default/chapter/13#Memcache
from gluon.contrib.gae_memcache import MemcacheClient
from gluon.contrib.memdb import MEMDB
cache.memcache = MemcacheClient(request)
cache.ram = cache.disk = cache.memcache
Hi Prachi,
Your code works fine for me, uploading to GAE.
It may be that your app.yaml file is configured incorrectly. Do you have it
setup to use python 2.5 or 2.7?
# use this line for Python 2.5
#
#runtime: python
# use these lines for Python 2.7
# upload app with: appcfg.py update web2py
Hi Prachi
When I ran the code the form appeared.
I didn't try the form. Will do so when I get home
James Burke
On 6/12/2013, at 8:28 am, PRACHI VAKHARIA prachivakha...@gmail.com wrote:
Dear James,
First, thank you very much for the response, and taking the effort to try out
share the log/stack trace from when that happens? does the form
post to the same function that generated it?
i have not tried upload in grid()wonder if there is something there
that doesn't quite work on app engine?
On Tuesday, December 3, 2013 10:49:47 AM UTC-8, James Burke wrote:
Hi
Nothing looks obvious at first glance...
if the ticket issued is unrecoverable then it can be that GAE hasn't
created the indexes for your datastore table yet. It may be just a case of
waiting a few minutes and refreshing the page.
--
Resources:
- http://web2py.com
- http://web2py.com/book
Hi,
Uploading files into my table on GAE, when I hit submit I'm presented with
a 404 NOT FOUND error message.
Works fine using Rocket, but not in GAE SDK or when uploaded to GAE.
_tables.py - in models
db.define_table('file',
Field('name', unique=True, compute=lambda r:
For problem no1, you could try using required=True instead of
requires=IS_NOT_EMPTY()
For your second problem you can define the auth_user table yourself (from
web2py book):
Another way to do this, although not really recommended, consists of
defining your auth tables yourself. If a table is
That fixed it, thanks Anthony!
On Sunday, November 24, 2013 2:32:24 AM UTC+13, Anthony wrote:
When you upgrade, you also have to upgrade the web2py.js file (and
possibly the web2py_ajax.html and appadmin files as well). Those files are
in the app folder but are part of the framework.
Hi,
I've just upgraded to the latest release of web2py
2.7.4-stable+timestamp.2013.10.14.15.16.29 .
Using a modified version of the Manage Users and Members slice found here:
http://www.web2pyslices.com/slice/show/1542/manage-users-and-memebership-in-the-same-form
My LOAD helper now only
Hi,
I'd like to have my links to child tables in the smartgrid displayed as
buttons (like view/edit/delete) rather than links. I'd also like to add
icons.
Is there an specific way to do this, or do I need to create them using
links instead?
Cheers,
-James
--
Resources:
- http://web2py.com
Thanks Dave.
Unfortunately they didn't use the term 'buttonification' in their thread. =)
--
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
Perhaps my question isn't very well defined.
When defining a linked table in a smartgrid like so:
linked_tables = dict(supply=['file'])
results in:
a data-w2p_disable_with=default href=
/init/supply/index/supply/file.supply/64spanFiles/span/a
I want it to be like this (how the view/edit/del
?
On Saturday, August 3, 2013 9:07:45 PM UTC-7, James Burke wrote:
Hi,
My site seems to be working fine, but when I go onto Google Webmaster
Tools there are crawler errors.
So I run the Fetch as Google tool and get *Unreachable page*. Which
produces the following ticket:
Traceback (most recent call
Hi,
My site seems to be working fine, but when I go onto Google Webmaster Tools
there are crawler errors.
So I run the Fetch as Google tool and get *Unreachable page*. Which
produces the following ticket:
Traceback (most recent call last):
File
Playing around with it again, seems to be working now.
No idea why it wasn't showing up before.
On Sunday, July 28, 2013 12:34:02 PM UTC+12, James Burke wrote:
Ok i got the updated code.
No error anymore, but the linked tables don't appear either when
linked_tables is a dict.
-James
Thanks for looking into this. I'm not exactly sure what 'Trunk' is. =)
On Friday, July 26, 2013 8:03:32 PM UTC+12, Massimo Di Pierro wrote:
There is a bug in SQLFORM.grid. I just pushed a fix to trunk. Please check
it.
On Thursday, 25 July 2013 20:10:52 UTC-5, James Burke wrote:
Hi,
I
one include the fix you want to test.
Massimo
On Saturday, 27 July 2013 01:27:13 UTC-5, James Burke wrote:
Thanks for looking into this. I'm not exactly sure what 'Trunk' is. =)
On Friday, July 26, 2013 8:03:32 PM UTC+12, Massimo Di Pierro wrote:
There is a bug in SQLFORM.grid. I just
:48:39 UTC-5, James Burke wrote:
Thank you for clarifying.
I've taken the latest version off github and I'm still having issues.
Works if linked_tables is a list, but not as a dict.
# db model
db.define_table('supply',
Field('test'),
format='%(test)s')
db.define_table('job
Ok i got the updated code.
No error anymore, but the linked tables don't appear either when
linked_tables is a dict.
-James
--
---
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,
Hi,
I just migrated my code from 2.4.6 to 2.5.1, I've encountered a problem
trying to use a dict in my smartgrid
with the following code:
def test():
form = SQLFORM.smartgrid(db.supply,
fields=dict(supply=[db.supply.id]),linked_tables
=dict(supply=['job','file']))
return
Hi,
Is it possible to stop the menu from collapsing into a button when the
window width is resized smaller?
Or do I have to start from scratch.
Cheers
James
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group
Good to know. =)
--
---
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
Hello again,
What does the autodelete function use to locate files? I seem to have
broken mine.
Cheers,
-James
On Thursday, April 11, 2013 12:01:11 PM UTC+12, James Burke wrote:
Here's what I came up with. Perhaps not such a great solution, because it
pigeon holes my download function
Thanks Anthony, although thinking about it... it might be easier just to
use a date field with a date picker.
--
---
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
Hi,
In the edit/add page for smartgrid, I have a reference field displaying
Months which are sorted alphabetically (by default). How can I sort them by
id instead?
Cheers,
-James
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To
id is passed as an argument when I
client on the files link.
On Tuesday, April 9, 2013 2:34:35 PM UTC+12, James Burke wrote:
Thanks for your swift response.
I kind of understand that, but how do you get the value rather than the
field name?
db.define_table('file',
Field('client
Hi Anthony,
I've tried the solution you've posted below:
Field('file', 'upload',
custom_store=lambda file, filename, path: store_file(file, filename,path
, db.table.new_filename),
...)
But when my additional parameter gets sent to store_file it sends
'table.new_filename'
def
. If you
want to include an actual filename string, then that's what you have to
pass to the function.
Anthony
On Monday, April 8, 2013 9:34:45 PM UTC-4, James Burke wrote:
Hi Anthony,
I've tried the solution you've posted below:
Field('file', 'upload',
custom_store=lambda file
when I
client on the files link.
On Tuesday, April 9, 2013 2:34:35 PM UTC+12, James Burke wrote:
Thanks for your swift response.
I kind of understand that, but how do you get the value rather than the
field name?
db.define_table('file',
Field('client', 'reference client'),
Field('type
Thanks so much for this code, it's really helpful.
@BlueShadow - I keep my auth functions in a separate controller i.e.
admin.py and can simply exclude this function from the list like so:
if 'admin.py' in ctls: ctls.remove('admin.py')
If you have functions in default.py that you wish to
Found exactly what I was after here:
http://stackoverflow.com/questions/8008213/web2py-upload-with-original-filename/8185933#8185933
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails
I'm having trouble working this one out. I've tried using the example in
the book with no success.
Model:
db.define_table('file',
Field('client', 'reference client'),
Field('file', type='upload', autodelete=True),
Field('filename', 'string'),
format='%(file)s')
Controller:
def
I was experiencing the same problem, adding db.commit() after my insert
statements fixed it.
--
63 matches
Mail list logo