[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-05 Thread Loïc
The workaround for me was to specify adapter_args=dict(foreign_keys=False) in the DAL connection. For example : db = DAL('sqlite://storage.sqlite', pool_size=1, lazy_tables=True, migrate=True, adapter_args=dict(foreign_keys=False)) Le jeudi 5 décembre 2013 06:48:52 UTC+1, Vch H a écrit : How

[web2py] Re: user profile fields for referenced table

2013-12-05 Thread 黄祥
if you had already logged in, you can retrieve current user logged in id using : auth.user_id after that just query it. e.g. rows = db(db.auth_user.id == auth.user_id).select().first() best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Running instantpress in GAE: Internal error Ticket issued: unrecoverable

2013-12-05 Thread peibol
No, I didn't find any solution... El jueves, 5 de diciembre de 2013 07:51:07 UTC+1, PRACHI VAKHARIA escribió: *Did you find a Solution?* *If yes, what is the Solution?* Thank you. On Thursday, June 13, 2013 11:29:35 AM UTC-4, peibol wrote: Hi all: Everything is running

[web2py] SQLite Integrity error after update to 2.8.2. = Widget problem?

2013-12-05 Thread Loïc
Hello all- I have the same problem as the one explained here :https://groups.google.com/forum/?fromgroups#!topic/web2py/klspqXpha4E But as I have more specific informations, I start a new thread... *My Model (simplified) : * db.define_table('page', Field('parent', 'reference page',

[web2py] update table from sqlform

2013-12-05 Thread Yebach
Hello I am trying to update records in user profile from form I have two tables that need to be updated auth_user and organization record = db((db.auth_user.organization==db.organization.id) (db.auth_user.id == uid)).select().first() if form.process().accepted:

[web2py] did precion get implemented? decimal(7,3)

2013-12-05 Thread Ivo
hi did precision get implement? I can not seem to find it in the gluon folder. do I need to import it explicitly? -- 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

[web2py] Re: update table from sqlform

2013-12-05 Thread Yebach
Hello I am trying to update records in user profile from form I have two tables that need to be updated auth_user and organization record = db((db.auth_user.organization==db.organization.id) ( db.auth_user.id == uid)).select().first() if form.process().accepted:

[web2py] Re: Making minor changes to auth.navbar()

2013-12-05 Thread Rohan Prinja
How did you solve it? I'm facing the same problem - deciding where to place the navbar code I wrote. On Saturday, 15 December 2012 09:09:05 UTC+5:30, Lewis wrote: I solved this. On Friday, December 14, 2012 3:37:45 PM UTC-8, Lewis wrote: I understand that code and put it in my controller.

[web2py] web2py session timeout

2013-12-05 Thread Samuel Komfi
Goodday, I have an app which redirects to mini sites based on an 'event' argument in the url like so http://0.0.0.0/app/c/login?event=event1(will take you event1 themed page) The problem is when the logged in users session is timed out, the user is returned to

[web2py] Re: web2py session timeout

2013-12-05 Thread Massimo Di Pierro
No but please open a ticket, we could add the functionality. On Thursday, 5 December 2013 06:39:07 UTC-6, Samuel Komfi wrote: Goodday, I have an app which redirects to mini sites based on an 'event' argument in the url like so http://0.0.0.0/app/c/login?event=event1(will take you event1

[web2py] Re: SQLite Integrity error after update to 2.8.2. = Widget problem?

2013-12-05 Thread Massimo Di Pierro
The problem is discussed here: https://groups.google.com/forum/#!topic/web2py/klspqXpha4E On Thursday, 5 December 2013 05:04:17 UTC-6, Loïc wrote: Hello all- I have the same problem as the one explained here :https://groups.google.com/forum/?fromgroups#!topic/web2py/klspqXpha4E But as I

[web2py] Re: SQLite Integrity error after update to 2.8.2. = Widget problem?

2013-12-05 Thread Loïc
I know Massimo, but my problem seems to be located in the Widget management And that's why I started my message with *I have the same problem as the one explained here : https://groups.google.com/forum/?fromgroups#!topic/web2py/klspqXpha4E

[web2py] For web2py V2.8.2, how can I customize the default layout, changing colors and background images?

2013-12-05 Thread JoeCodeswell
Dear web2py Community, I am trying follow the book Edition 6 to customize the default layout, changing colors and background imageshttp://web2py.com/books/default/chapter/29/05/the-views#Customizing-the-default-layout . I'd like to change the navbar background and the [.header h1; .statusbar;

[web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread James Burke
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

Re: [web2py] Social Login

2013-12-05 Thread Michele Comitini
You also need this: https://pypi.python.org/pypi/oauth2 2013/12/5 Michele Comitini michele.comit...@gmail.com I have this old code that should work in db.py: auth_table = db.define_table( auth.settings.table_user_name, Field('first_name', length=128, default=),

Re: [web2py] Social Login

2013-12-05 Thread Michele Comitini
I have this old code that should work in db.py: auth_table = db.define_table( auth.settings.table_user_name, Field('first_name', length=128, default=), Field('last_name', length=128, default=), Field('username', length=128, default=, unique=True), Field('password', 'password',

[web2py] session cookie for two subdomains

2013-12-05 Thread Marin Pranjić
Hi, I have two subdomains for one app, and I need to use both. So I have to set Domain header in session cookie to the domain root (.domain.com). Where should I put that code? Not sure how exactly to do it for session cookie. Marin -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread PRACHI VAKHARIA
Dear James, First, thank you very much for the response, and taking the effort to try out the application on GAE. The *app.yaml* file I am using is configured just as you have stated. runtime: python27 threadsafe: true - url: .* script: gaehandler.wsgiapp# WSGI (Python 2.7

[web2py] The odd behavior of cacheable selects. Bug?

2013-12-05 Thread Leonel Câmara
If I have this in my DB: db = DAL('sqlite://storage.sqlite', check_reserved=[]) db.define_table('test_table', Field('value'), ) if db(db.test_table.id 0).count() == 0: db.test_table.bulk_insert([{'value': 'one'}, {'value': 'two'}, {'value': 'three'}, {'value': 'four'}, {'value':

[web2py] Re: The odd behavior of cacheable selects. Bug?

2013-12-05 Thread Niphlod
it surely counts for a bug. Would you mind opening an issue on google code so it gets tracked ? On Thursday, December 5, 2013 9:05:38 PM UTC+1, Leonel Câmara wrote: If I have this in my DB: db = DAL('sqlite://storage.sqlite', check_reserved=[]) db.define_table('test_table',

[web2py] Re: The odd behavior of cacheable selects. Bug?

2013-12-05 Thread Niphlod
BTW: in my fast trial I get the same behaviour even with cacheable=True. This may be due to the fact that cache.ram stores a pointer of the rows. If you try with cache.disk or any other cache backend, it's ok. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] How would you implement paging on a google-results-like page?

2013-12-05 Thread Jim S
Looking for advice here. Traditionally I've used SQLFORM.grid when I want to have a list where people can select what record they want to work with. That works fine for me but a new app on working on has a requirement to have it's list pages look more like a google search results page. No

[web2py] Re: For web2py V2.8.2, how can I customize the default layout, changing colors and background images?

2013-12-05 Thread Niphlod
I guess that piece of the book needs an update. There is no .header nor .statusbar in the current scaffolding app. However, given that is based on bootstrap 2.3.2, you can find a boatload of pointers in google on how to customize the color scheme . -- Resources: - http://web2py.com -

[web2py] Re: did precion get implemented? decimal(7,3)

2013-12-05 Thread Niphlod
a) what do you need ? b) what do you expect ? c) what do you see instead ? d) post a minimal app reproducing the wrong behaviour ^___^ On Thursday, December 5, 2013 2:06:49 PM UTC+1, Ivo wrote: hi did precision get implement? I can not seem to find it in the gluon folder. do I need to

[web2py] Re: The odd behavior of cacheable selects. Bug?

2013-12-05 Thread Leonel Câmara
Sure, I will open the bug later today. Quinta-feira, 5 de Dezembro de 2013 20:05:38 UTC, Leonel Câmara escreveu: If I have this in my DB: db = DAL('sqlite://storage.sqlite', check_reserved=[]) db.define_table('test_table', Field('value'), ) if db(db.test_table.id 0).count() == 0:

[web2py] Re: bulk_upload to GAE development datastore no longer works?

2013-12-05 Thread David Manns
Do you have a reference for this? I went back to 1.8.0 and problem is same. Also tried some 1.7x versions, higher versions with same result. Early 1.7x versions I think ran only on Python 2.5 and probably because of other changes in the yaml file and the --use_sqlite app parameter can't get

[web2py] Re: Failure after upgrade to 2.8.2

2013-12-05 Thread Niphlod
I guess this is a problem due to out-of-order reference definitions. it's quite a leap to require web2py to know about auth_group when it's not defined yet... Frankly, it should be treated as a bug (so, file an issue on google code) only because of backwards compatibility BTW,

[web2py] Re: compute not working on update

2013-12-05 Thread 黄祥
tested in 2.8.2 still got the problem, about compute field during updates, although the update is not related with the compute field. e.g. update the status field on rent table, when i insert the revert / compensation table using after insert callback. yet the compute i use is for total_price

[web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2013-12-05 Thread Niphlod
uhm, you're right. However, usually with different submit buttons you'd likely have one of them having a name attribute (and those are excluded from being put in the working... state) is this your case ? How are you handling different posts based on the fact that the user clicks on one

[web2py] Re: Using find on cached queries

2013-12-05 Thread Niphlod
On Wednesday, December 4, 2013 4:57:03 PM UTC+1, Anthony wrote: First, if you are using cache=..., you do not also need to set cacheable=True. Using the former, the DAL automatically handles caching for you. Setting cacheable=True is only for cases where you want to manually cache the

Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread James Burke
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 the

Re: [web2py] Re: Failure after upgrade to 2.8.2

2013-12-05 Thread Jim Steil
Thanks Niphlod. I agree the model doesn't make sense. Made sense at the time only for simplicity of defining one and only one group a user could belong to. I understand it is not the right way to do things. But, working on a rewrite of that app and will be redesigning the auth_user table to get

[web2py] Re: The procedure entry point wcspy_s could not be located in the dynamic link library msvcrt.dll

2013-12-05 Thread Niphlod
recent web2py version enforce FK integrity on SQLite (as any other relational backend does by default) to prevent users from working on the development with SQLite without realizing that there is some really faulty data in the database. Too many incurred in the problem too late to know...

Re: [web2py] Re: Failure after upgrade to 2.8.2

2013-12-05 Thread Niphlod
it's not a feature per-se but DAL has suffered a complete overhaul to accomodate for new features and some bug squashing. What used to be a commodity leading to faulty data models indeed put the developers (me and Michele Comitini) to face a really hard problem to solve to support those kinds

[web2py] Re: Using find on cached queries

2013-12-05 Thread Anthony
On Wednesday, December 4, 2013 4:57:03 PM UTC+1, Anthony wrote: First, if you are using cache=..., you do not also need to set cacheable=True. Using the former, the DAL automatically handles caching for you. Setting cacheable=True is only for cases where you want to manually cache the

[web2py] sum the query result from other table

2013-12-05 Thread 黄祥
hi, i learned from pos online store appliance about sum the session to acquire the grand_total, when i tried to do the same to query result from other table, is not work (no error appears, but the result always 0). e.g. not worked ids = request.vars.ids grand_total =

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Niphlod
check for db = DAL(migrate_enabled=False) either this prevented the creation of the table, or some another migrate-related glitch. To create scheduler's tables, you just need to do (as you did) Scheduler(db, ...) NB: (just a naming-convention advice) use from gluon.scheduler import

[web2py] Re: Using find on cached queries

2013-12-05 Thread Niphlod
peeerfect! On Thursday, December 5, 2013 10:26:12 PM UTC+1, Anthony wrote: Yes, good point. I just wanted to make it clear that cacheable=True is not *required* when using cache=, and in fact it reduces the functionality normally available when using cache=. For pure speed, cacheable=True

[web2py] Re: web2py real time apps

2013-12-05 Thread bharath
Hii massimo, Can u help me out in real app development with web2py. Like integrating socketio and sockjs with web2py. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: SQLite Integrity error after update to 2.8.2. = Widget problem?

2013-12-05 Thread Massimo Di Pierro
I understand and I do not understand why the problem arises there but your error is: class 'sqlite3.IntegrityError' foreign key constraint failed So I would exclude it is a problem with the foreign key contraints. On Thursday, 5 December 2013 09:46:59 UTC-6, Loïc wrote: I know Massimo, but

Re: [web2py] Re: bulk_upload to GAE development datastore no longer works?

2013-12-05 Thread Christian Foster Howes
ok, it must be a different error. this is the bulkupload error that i am watching: https://code.google.com/p/googleappengine/issues/detail?id=9666 there are several issues logged against the bulkuploader though:

[web2py] Re: sum the query result from other table

2013-12-05 Thread Massimo Di Pierro
Are you sure you are selecting records: print len(db(db.rent_detail.id.belongs(ids) ).select() ) On Thursday, 5 December 2013 15:46:01 UTC-6, 黄祥 wrote: hi, i learned from pos online store appliance about sum the session to acquire the grand_total, when i tried to do the same to query

[web2py] Scheduler-related database tables created on sqLite but NOT on MySQL

2013-12-05 Thread Yassen D.
Hello all, I follow a simple video-tutorial (http://vimeo.com/27478796); so I create a model scheduler.py with this content: def f(): t = time.ctime() open('/tmp/tasks', 'w').write(t + '\n') return f from gluon.scheduler import Scheduler Scheduler(db, dict(our_func=f)) After

[web2py] PostgreSQL lower case id seq values

2013-12-05 Thread Alan Etkin
(translated from a message of Martin Miranda to web2py-usuarios) ... After upgrading to web2py 2.8.2-stable+timestamp.2013.11.28.13.54.07 my app throws the following error: class 'psycopg2.ProgrammingError'(relation testSeq_id_seq does not exist LINE 1: select currval('testSeq_id_seq') ^ )

Re: [web2py] Re: Suggestions for multiple files upload in form

2013-12-05 Thread Ruud Schroen
Works like a charm! Thanks alot :) On Wed, Dec 4, 2013 at 11:55 PM, Ruud Schroen r...@formatics.nl wrote: Thanks alot! I'll check it out tommorow :) i'll let you know if it worked On Wed, Dec 4, 2013 at 9:54 PM, Paolo Caruccio paolo.carucci...@gmail.com wrote: There are several

Re: [web2py] PostgreSQL lower case id seq values

2013-12-05 Thread Michele Comitini
Test with trunk. We have done some improvements about case sensitivity. And now lastval() is used in place of curval() i.e. safer and faster. 2013/12/5 Alan Etkin spame...@gmail.com (translated from a message of Martin Miranda to web2py-usuarios) ... After upgrading to web2py

[web2py] Re: sum the query result from other table

2013-12-05 Thread 黄祥
yes, you are right, i know where is the root cause, btw, it's funny the length of db(db.rent_detail.id.belongs(ids)) is return 0, yet i still can insert the value to other table. e.g. def outstanding_rent(): grid = SQLFORM.grid(db.rent_detail.status == 'Rent', selectable = lambda ids :

Re: [web2py] session cookie for two subdomains

2013-12-05 Thread Marin Pranjić
^bump On Thu, Dec 5, 2013 at 8:22 PM, Marin Pranjić marin.pran...@gmail.comwrote: Hi, I have two subdomains for one app, and I need to use both. So I have to set Domain header in session cookie to the domain root (. domain.com). Where should I put that code? Not sure how exactly to do it

[web2py] Re: Prevent multiple submit buttons from showing Working... on submit

2013-12-05 Thread Mark Li
Hey Niphlod, The 2 submit buttons have different names, here's the resulting HTML. tr id=submit_record__row td class=w2p_fl/td td class=w2p_fw input name=save_progress type=submit value=Save Progress / input class=btn name=post_playlist type=submit value=Post Playlist /

[web2py] urllib2.URLError

2013-12-05 Thread sonu kumar
Hi All, In my application I am trying to call external weblink to map data but it always gives me class 'urllib2.URLError' urlopen error timed out error. I am using several times urllib for calling same weblinks for different mappingWill this cause problem??? params = {'from':'ID',

[web2py] Re: How would you implement paging on a google-results-like page?

2013-12-05 Thread Christian Foster Howes
can you create a module and/or a base template that you can put the boilerplate code in so you don't have to duplicate the stuffs in each individual controller and view? or can you write a generic controller that based on parameters/POST data adjusts its queries. On Thursday, December 5, 2013

[web2py] apk for web2py application

2013-12-05 Thread 黄祥
hi, i'm interested in web2py apk like on web2py slices, yet during googling i found this : http://www.appsgeyser.com/ already tested for web2py website and browser app apk. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Christian Foster Howes
also Prachi, can you visit the GAE logs and paste in the error you are getting? that might make it even quicker for us to help you sort it out. On Thursday, December 5, 2013 1:07:37 PM UTC-8, James Burke wrote: Hi Prachi When I ran the code the form appeared. I didn't try the form. Will

[web2py] Re: Running instantpress in GAE: Internal error Ticket issued: unrecoverable

2013-12-05 Thread Christian Foster Howes
i suspect that instapress needs to use a relational database and that if you use google cloud SQL you are more likely to get it to work. the traceback from the logs would be most helpful in debugging. On Thursday, December 5, 2013 2:55:36 AM UTC-8, peibol wrote: No, I didn't find any

[web2py] Out of nowhere a starnge error...

2013-12-05 Thread george3825
I was adding to my controllers and views and all of a sudden the error below, any ideas? Only occurs to logged in users. I remove extend layout from any view and this error goes away... *type 'exceptions.ValueError' need more than 1 value to unpack* *Version**web2py™ Version

[web2py] Re: sum the query result from other table

2013-12-05 Thread 黄祥
i know i can do it manually like : for id in ids: detail = db(db.rent_detail.id == id).select().first() dvd = db(db.dvd.id == detail.dvd).select().first() total_price = dvd.acquisition_price * detail.quantity grand_total += total_price but i want to make it simple like on pos appliance. any other

Re: [web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Yassen Damyanov
Niphlod, HUGE THANKS! I'll check that right now and post back. On Thu, Dec 5, 2013 at 11:53 PM, Niphlod niph...@gmail.com wrote: check for db = DAL(migrate_enabled=False) either this prevented the creation of the table, or some another migrate-related glitch. To create scheduler's

[web2py] Re: Scheduler-related database tables created on sqLite but NOT on MySQL

2013-12-05 Thread Massimo Di Pierro
Are you sure you have not set DAL(...,migrate_enabled=False)? On Thursday, 5 December 2013 16:10:34 UTC-6, Yassen D. wrote: Hello all, I follow a simple video-tutorial (http://vimeo.com/27478796); so I create a model scheduler.py with this content: def f(): t = time.ctime()

[web2py] Re: sum the query result from other table

2013-12-05 Thread Massimo Di Pierro
for id in ids: detail = db(db.rent_detail.id == id).select().first() dvd = db(db.dvd.id == detail.dvd).select().first() total_price = dvd.acquisition_price * detail.quantity grand_total += total_price can be done as follows: expr = (db.dvd.acquisition_price * db.rent_detail.quantity).sum() #

Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Massimo Di Pierro
When posting a comment the last 5 lines are usually sufficient: 'Traceback (most recent call last):\n File /base/data/home/apps/s~pv-4- vp/1.372124618390164258/gluon/main.py, line 551, in wsgibase\n session._try_store_in_db(request, response)\n File

Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Christian Foster Howes
this strikes me as an old version of web2py. GAE upgraded IDs to be longs a few months back and i know we made sure the DAL in the latest version supports that, yet this looks like such an error. :( On 12/5/13, 21:42 , Massimo Di Pierro wrote: When posting a comment the last 5 lines are

Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Massimo Di Pierro
Looking at this in more detail. This is a bug that was fixed some time ago. I believe in 2.4.2. You are using a very old version of web2py. :-( Massimo On Thursday, 5 December 2013 23:42:10 UTC-6, Massimo Di Pierro wrote: When posting a comment the last 5 lines are usually sufficient:

[web2py] Re: Spawning a thread or a process for a long-running task [urgent!]

2013-12-05 Thread Yassen D.
Niphlod, yes, that was it !! It was not in the db.py but there was a 0.py with 'settings.migrate = True' (this is not my app, I was just asked to hack there to fix an issue). An easy workaround might be to also set fake_migrations to True (fake_migrate_all=True in DAL() creation) and copy and

Re: [web2py] Re: Scheduler-related database tables created on sqLite but NOT on MySQL

2013-12-05 Thread Yassen Damyanov
Thanks, Massimo, that was it. Niphlod answered that in another thread and I just got the problem solved. Again, I would suggest showing the migration status somewhere in the application header of the db administration page, of that sounds reasonable and not hard to do. Would help to newcomers

[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-05 Thread James Burke
Hi Christian, Thanks for your help. Unfortunately no ticket is created I just get a new page with the 404 error message on it. url when uploading the file: http://gic-test.appspot.com/admin/file/new/file url after uploading the file: http://gic-test.appspot.com/admin/file/new/file# I've

[web2py] Re: sum the query result from other table

2013-12-05 Thread 黄祥
i've tried it but returned an error : expr = (db.dvd.acquisition_price * db.rent_detail.quantity).sum() # you can build any expression! grand_total = db(db.rent_detail.id.belongs(ids))(db.dvd.id == db.rent_detail.dvd).select(expr).first()[expr] *Traceback :* table.grand_total.represent =