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
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)
-
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
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',
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:
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
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:
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.
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
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
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
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
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;
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
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=),
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',
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
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
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':
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',
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)
-
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
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
-
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
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:
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
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,
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
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
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
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
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
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...
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
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
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 =
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
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
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)
-
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
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:
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
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
(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') ^ )
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
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
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 :
^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
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 /
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',
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
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)
-
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
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
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
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
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
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()
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() #
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
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
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:
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
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
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
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 =
66 matches
Mail list logo