In a controller I have the following menu:
response.site_submenu = []
if session.vcardsettings:
response.site_submenu.append(
['Logo',request.function=='uploadLogo',URL('uploadLogo')],
['Tagline',request.function=='tagline',URL('tagline')],
did you know about extend ?
mylist = []
mylist.append(1)
mylist
[1]
mylist.append(2,3)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: append() takes exactly one argument (2 given)
mylist.extend(2,3)
Traceback (most recent call last):
File stdin, line 1, in
Thanks a lot.
I don't know the css, HTML5 and lack of web languages and tools makes me
hard to understand.
Today I met the programmer and from him I took some advices.
But for him it is very easy and ..
Thanks ... Anthony and marco mansilla...
Now, I am a starter in web2py after a few
Hi Massimo,
I am going to make a web application in which, requires to upload more than
100 Mb file at a time, please give us the details in web2py is it possible ?
On Sunday, June 17, 2012 4:58:11 AM UTC+5:30, Massimo Di Pierro wrote:
web2py does not load the uploaded file in Ram (unless the
Okay, finally got around to testing it.
Not getting any pipes.
The right of my navbar is one long string all of the same colour:
Welcome username Logout
I can do it without DB.
But I still have the other issues to solve to make it standalone
application.
* I do not want login/logout
* User should start standalone exuctable.
+ It should not ask for admin password
+ Server should close when app is not opened anymore
/T
Den onsdagen den 20:e
Alec,
Thanks to you!
You have found a bug either in the book or in the authentication code.
web2py changed behavior.
I have to check if a compatibility breach happened somewhere or if that
code was using some undocumented feature.
mic
Il giorno mercoledì 20 giugno 2012 02:33:36 UTC+2, Alec
web2py was tested with up to 2G upload and download. It always worked for
me. Some users have experience some problem using rocket we have been
investigating. Wort case scenario you can use a different web server.
Moreover the upload is definitively not stored in Ram (unless your app
does).
Glad I could be of help... I'll be following the book pretty closely
so be sure to check your email [or the github issues queue] for
further errata :P
On Wed, Jun 20, 2012 at 10:02 PM, Michele Comitini
michele.comit...@gmail.com wrote:
Alec,
Thanks to you!
You have found a bug either in the
On Wednesday, 20 June 2012 06:56:43 UTC-5, glomde wrote:
I can do it without DB.
But I still have the other issues to solve to make it standalone
application.
* I do not want login/logout
comment anything with auth
* User should start standalone exuctable.
unzip the windows
Can you please open a ticket?
On Wednesday, 20 June 2012 07:02:28 UTC-5, Michele Comitini wrote:
Alec,
Thanks to you!
You have found a bug either in the book or in the authentication code.
web2py changed behavior.
I have to check if a compatibility breach happened somewhere or if that
I opened an issue here:
https://github.com/mdipierro/web2py-recipes-source/issues/2
mic
2012/6/20 Massimo Di Pierro massimo.dipie...@gmail.com:
Can you please open a ticket?
On Wednesday, 20 June 2012 07:02:28 UTC-5, Michele Comitini wrote:
Alec,
Thanks to you!
You have found a bug
When I was starting with python web2py, the video series made by
codeschool.org really jump started it all for me ... beside reading the
book !
I suggest to read the first 5 chapters of the book to get familiar with
the basic concepts before watching the videos .. and after watching the
I think that it can be considered as the example code was using an
undocumented feature. I.e. the registration_id was not necessary at the
time.
So it's the example that must be modified.
This the affecting change in web2py tools.py.
-if 'registration_id' in table_user.fields() and \
Hello,
In the model, in the file db.py I used the auth_user table that comes by
default with web2py and I enriched it a bit the following way :
db.define_table('auth_user',
Field('first_name', type='string',
label=T('First Name')),
A league will most definitely needs its own database instead of a table ...
while a team can have its own table within that league database !!! ... but
can a database be created on the fly within the app upon registration ??
On Wednesday, 20 June 2012 10:02:27 UTC-4, Don_X wrote:
Hello,
In
I have an error with mysql (about reference):
*1452, u'Cannot add or update a child row*
The table is created with
*db.define_table('navbar',
Field(title, string),
Field(url, string, requires=IS_EMPTY_OR(IS_URL())),
Field(c, label=Controller),
Field(f, label=Function),
I want to import from a csv file, but I want to use the imported data in
only one of my database tables, not all of them, which is how I have seen
the examples online. Here is my code, which does not work:
Model
---
db.define_table(
'upload',
Field('name'),
Why don't use the appadmin export and import ?
Richard
On Wed, Jun 20, 2012 at 9:55 AM, joe joepeacock...@gmail.com wrote:
I want to import from a csv file, but I want to use the imported data in
only one of my database tables, not all of them, which is how I have seen
the examples online.
You are correct. I am still sort of new to python and i didn't realize that
.thumbnail was a PIL method. However after i fixed that issue it still
isn't working at all. Does anyone have a simple script to do thumbnails?
Maybe one that doesn't involve compute.
Brandon
On Tuesday, June 19,
book say this.
db.person.import_from_csv_file(open('test.csv', 'r'))
why do you use a different syntax ?
BTW: you'd need to delete the table first, or you'll append to existent
records in the database the ones in the csv file.
On Wednesday, June 20, 2012 3:55:26 PM UTC+2, joe wrote:
I
The error is when trying to create the table for the first time or
migrating ?
That 1452 is quite a famous error: when you establish a FK (to the same
table or to another) if there is only one discordant data, the error pops
up.
So, if your table has some records in it, and you're migrating
The project I will be working on requires all users to import from
spreadsheets, so thats not really possible.
On Wednesday, June 20, 2012 9:49:57 AM UTC-5, Richard wrote:
Why don't use the appadmin export and import ?
Richard
On Wed, Jun 20, 2012 at 9:55 AM, joe wrote:
I want to import
You'll almost certainly want separate tables each for teams, clubs and
leagues. Then you probably do one of these two choices:
db.define_table('team', Field('name'), Field('members', 'list:reference
auth_user'))
OR
db.define_table('team', Field('name'))
db.define_table('team_member',
I've been able to develop a very simple test-case that highlights my
problem. The error is type 'exceptions.KeyError' 'group':
The idea is groups have events, events can only be created by owner of
a group, and owner of a group has to be an authenticated user.
[[Models]]
db.define_table(
Hi All,
I use web2py to create a admin interface for an older project with an
existing database in MySQL.
So I extracted the DAL info with an script.
--extracted from current mysql db --
user_db.define_table('users',
Field('user_id', 'id'),
Field('login_name', 'string'),
db.define_table(
'event',
Field('name', requires=IS_NOT_EMPTY()),
Field('description'),
Field('image', requires=IS_IMAGE()), # might expand this to a list
Field('datetime', requires=[IS_NOT_EMPTY(), IS_DATETIME()]),
Field('location'),
Field('group_id',
Alec,
please double check that in views/layout.html exists this code (note the
pipe in separators):
div id=navbar{{='auth' in globals() and auth.navbar(separators=(' ',' |
','')) or ''}}/div
You should find it at line 90 in last trunk.
Il giorno mercoledì 20 giugno 2012 12:59:56 UTC+2,
I changed the web2py ajax.html date format and also used the IS_DATE
constraint to get the date in dd-mm- format. When I submit the data via
sqlform, everything is ok.but When I added an extra date element in the
sqlform and tried to insert it in a table using
Mine seems to work OK with current trunk:
db.item.image_thumb.compute = lambda r: resize_image(r['image'], (150,130),
'thumb')
def resize_image(image, size, path, rotate=0):
if image:
try:
img = Image.open('%sstatic/uploads/%s' % (request.folder,
image))
img
Hey everyone, I'm sort of new to web2py, and I'm running a program that
takes submitted form information and displays it as a JSON file using
JSONP. Instead of displaying the JSON in the browser, it just downloads the
.json file to my computer. What am I doing incorrectly?
Here is the code
I'm having the same problem:
https://groups.google.com/d/msg/web2py/hCsxVaDLfT4/K6UMbG5p5uAJ
On Mon, Jun 18, 2012 at 9:30 AM, Michael Toomim too...@gmail.com wrote:
I just got bit by the reserved-word problem:
https://groups.google.com/d/msg/web2py/aSPtD_mGXdM/c7et_2l_54wJ
I am trying to
ypu can try:
devices = db().select(db.contacts.ALL).as_list()
It occurs to me you might try this
Field('group'),
On Wednesday, June 20, 2012 2:03:48 PM UTC-4, acidjunk wrote:
Hi All,
I use web2py to create a admin interface for an older project with an
existing database in MySQL.
So I extracted the DAL info with an script.
--extracted
Howdy,
I'm trying to put together a quick proof of concept to use this framework
for porting our desktop application to the web.
I ran into an issue where unique fields don't follow our rules. In our
database the 'nickname' field is unique and JOE is the same as joe.
I did a quick search and
Hi, I'm new to this group and this is my first question. I was wondering if
it was possible to access a database table from controllers and update it
automatically without having to go to /appadmin and manually typing in the
data? I just made a crawler and I want the links and titles of pages
Using the following code web2py generated all possible patterns for all my
tables for GET and POST methods:
@request.restful()
def api():
response.view = 'generic.'+request.extension
def GET(*args,**vars):
patterns = 'auto'
parser = db.parse_as_rest(patterns,args,vars)
@Andrew
Yes. We could change the file, currently named bootswatch.css, to
automatize bootstrap carousel in web2py, but next time, when we will found
an incompatibility between bootstrap.min.css and web2py.css, we will have
to update again bootswatch.css. I don't think that it's good thing - in
Why do you say this: A league will most definitely needs its own database
instead of a table ?
I ask because it's probably not true.
On Wednesday, June 20, 2012 10:12:13 AM UTC-4, Don_X wrote:
A league will most definitely needs its own database instead of a table
... while a team can have
For example here is a function in a controller which adds a few records to
mytable. I guess you already know how to define tables.
def myfunction():
...
db.mytable.insert(user_id=4,court_id=5,perm='C',days=10)
db.mytable.insert(user_id=4,court_id=5,perm='V',days=365)
In addition to what Anthony has said, please save yourself a whole heap of
future problems by avoiding SQL reserved words. Having a table name GROUP
is going to bite you! Look at the 'reserved words' section of the book in
the DAL chapter and do something like this to help you avoid future
On Tue, Jun 19, 2012 at 1:33 PM, Anthony abasta...@gmail.com wrote:
I'm not sure it's feasible or desirable for the DAL to try to normalize
every last behavior across all database backends. What exactly would you
have the DAL do differently in this case?
Actually what I'm looking for is in the
I'm looking for The Book to tell me what to expect.
If it doesn't tell me, then I don't know if the current behaviour
(once I discover it) will be carried forward to future versions of
Web2py as part of the backwards compatibility promise, or, if the
current behaviour is just a quirk of
On Tue, Jun 19, 2012 at 3:31 PM, Niphlod niph...@gmail.com wrote:
Yep, I don't know exactly the defaults, but I happen to see some major
differences against various systems with standard python distribution.
Ugh, at least, for the most part, it still all 'just works'. :-/
Moreover, it's just
On Wed, Jun 20, 2012 at 5:53 PM, Anthony abasta...@gmail.com wrote:
Can you explain how whether SQLite autocommits or not matters in this case?
The DAL documentation recommends doing a db.commit() in scripts and
background tasks like this precisely because it doesn't want to assume any
pbreit,
I just used your script and my first time thumbnails are working again.
However the are still not computing on update. Do your thumbnails compute
when updating?
Brandon
On Wednesday, June 20, 2012 1:58:12 PM UTC-6, pbreit wrote:
Mine seems to work OK with current trunk:
Oh, my bad. You're right, looks like not updating. Will dig in more. Sorry
about that.
Hi,
I run web2py from source on windows 7. Machine has a real IP.
But I am unable to access it even in the same machine when I use the real
IP as the server IP. I need to access the site from other computers.
Nothing shows up in the screen.
I am not sure there is a fire wall blocking that.
python web2py.py -a password -i 0.0.0.0 -p 8000
*Bruno Cezar Rocha*
http://www.CursoDePython.com.br
[image: Facebook] http://facebook.com/rochacbruno [image:
Twitter]http://twitter.com/rochacbruno [image:
LinkedIn] http://linkedin.com/in/rochacbruno [image:
about.me]http://about.me/rochacbruno
You're forgetting another layer. DAL leverages on DBAPI implementation
of sql drivers.
Actually, there is no begin transaction on python.
Usually you instantiate a cursor, do operations, try to commit, if
exception is raised you rollback.
You can do all kind of tests for your background
i suspect that in your case PUT and DELETE would look a lot like POST. not
sure the exact code for your use case, but i know it's possible to have PUT
and DELETE methods.
On Wednesday, June 20, 2012 9:30:26 AM UTC-7, Osama Hussain wrote:
Using the following code web2py generated all possible
I'm running version 1.91.6 installed from binary for localhost testing. I'm
attempting to add some modules to hold utility functions used by other
controllers but I consistently get an import error.
Suggestions?
Thanks in advance
--
Check if you have an empty __init__.py file under all your root folders.
On Wed, Jun 20, 2012 at 8:19 PM, wdtatenh wdt...@comcast.net wrote:
I'm running version 1.91.6 installed from binary for localhost testing.
I'm attempting to add some modules to hold utility functions used by other
You can do
@request.restful()
def api():
response.view = 'generic.'+request.extension
def GET(*args,**vars):
patterns = 'auto'
parser = db.parse_as_rest(patterns,args,vars)
if parser.status == 200:
return dict(content=parser.response)
else:
How would it be to receive a file upload thought the restful api?
On Wed, Jun 20, 2012 at 8:39 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
You can do
@request.restful()
def api():
response.view = 'generic.'+request.extension
def GET(*args,**vars):
patterns =
Sooo Have I misunderstood the SQLite locking description?
I believe so. The shared lock does not last forever -- only as long as it
takes to execute the select. Once the data have been read, the shared lock
(for that particular select) is released.
Anthony
--
How is the web2py JSONP action being called? What does the client do once
the response is received?
On Wednesday, June 20, 2012 4:13:38 PM UTC-4, Jack315 wrote:
Hey everyone, I'm sort of new to web2py, and I'm running a program that
takes submitted form information and displays it as a JSON
Instead of a table within the main database of this webapp !! simply
because, a SRA or a league wants control and rights ...a league will want
more admin features over their own information .. more than clubs do ! ...
In short ... this is a webapp for Canada, somekind of a Full Soccer Sports
One database sounds much easier.
It's probably easier to have users sign up first and then figure out what
type of user they are. Although it wouldn't be that hard to first determine
what type of user they are and then use a custom registration form
The code I posted would not work... It depends on how it is uploaded.
if you have the code
curl -X POST \
-H Content-Type: text/plain \
-T 'hello.txt' \
http://127.0.0.1:8000/app/default/upload1/hello.txt
I think you can do
def upload():
table = db.tablename
record =
That's how browsers handle the application/jsonp MIME type. If you want to
see it in your browser, try changing the Content-Type to:
response.headers['Content-Type'] = 'text/plain'
Not sure if the JSONP consumer will process it correctly, though.
--
If i am not the only one not having i think it's possible it may be a
web2py bug. I bet it is only a bug in update fields as i have seem some
other complaints online. I have filed a bug ticket. Hopefully it is fixed
soon. I am only a beginner programmer so i still am learning debugging and
how
Unfortunately I still haven't gotten it to work.
Now getting an error saying: type 'exceptions.AttributeError'
'NoneType' object has no attribute 'startswith'
[[Models]]
db.define_table(
'group_of_events',
Field('name', requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db,
Confirmed.
That pipe code is definitely there (just under the a class=brand
href=#web2pytrade;nbsp;/a line).
On Thu, Jun 21, 2012 at 5:00 AM, Paolo Caruccio
paolo.carucci...@gmail.com wrote:
Alec,
please double check that in views/layout.html exists this code (note the
pipe in separators):
On Wed, Jun 20, 2012 at 6:37 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
web2py was tested with up to 2G upload and download. It always worked for
me. Some users have experience some problem using rocket we have been
investigating. Wort case scenario you can use a different web
Unfortunately I still haven't gotten it to work.
Now getting an error saying: type 'exceptions.AttributeError'
'NoneType' object has no attribute 'startswith'
Traceback? What line is causing that error?
--
Thanks a LOT! I know we should avoid auto pattern generation but having
this functionality makes it super easy to rapidly develop a back end so
that I could focus on my front end and have a prototype shipped in time,
guess I made the right choice to choose web2py :)
On Thursday, June 21, 2012
Not a big deal still at this point but wanted to point out:
http://www.noobslab.com/2012/06/ubuntu-1210-quantal-quetzal-alpha-1-is.html
Python 2 will not be in Ubuntu by default anymore.
BR,
Jason
--
did you know about extend?
No. I'll give extend a try, thanks for answering my question.
Annet.
--
69 matches
Mail list logo