[web2py] Re: Database reference issue

2019-12-15 Thread Massimo Di Pierro
there are two issues: 1) this db(db.devtasklist.projectid == db.Project.id).select(db.Project.ProjectName) does not do anything as it. 2) this row.devtasklist.projectid is an Project object but you do not access its attributes. SOLUTION II (one extra query per record) *In views:*

[web2py] Re: database queries

2019-04-24 Thread learthurjoly
Thank you dave for those answers. I don’t have a lot of time at the moment to move forward on this as I would like, but I will take your comments into account as I move forward. I’ll keep you informed. Thank you again Arthur! Le mercredi 17 avril 2019 00:17:25 UTC+2, Dave S a écrit : > > > > O

[web2py] Re: database queries

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 5:54:54 AM UTC-7, learth...@gmail.com wrote: > > Hello, > > I'm sorry if I did not post my tests but I’m really beginner with web2py, > python... and I was a little afraid to look ridiculous.. (Sorry again but > my English is ridiculous too !!). > > First I tried w

[web2py] Re: database queries

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 5:54:54 AM UTC-7, learth...@gmail.com wrote: > > [skipping to what caught my eye first] > Then I tried to do it by referring to what I found in the web2py manual. > > That’s where I am now. This is only for the price but it’s the same for > the delay. > > > > pa

[web2py] Re: database queries

2019-04-16 Thread learthurjoly
Hello, I'm sorry if I did not post my tests but I’m really beginner with web2py, python... and I was a little afraid to look ridiculous.. (Sorry again but my English is ridiculous too !!). First I tried with Mysql trough MysqlWorkbench and I quickly success to get the minimum but only for a

[web2py] Re: database queries

2019-04-11 Thread Dave S
On Thursday, April 11, 2019 at 6:48:14 AM UTC-7, learth...@gmail.com wrote: > > Hello everybody, > Nobody can help me to solve my problem ? :( > > > Le vendredi 5 avril 2019 11:42:26 UTC+2, learth...@gmail.com a écrit : >> >> Hello everybody. >> >> I ask you because I can’t make queries in my da

[web2py] Re: database queries

2019-04-11 Thread Marcelo Huerta
El jueves, 11 de abril de 2019, 10:48:14 (UTC-3), learth...@gmail.com escribió: > > Hello everybody, > Nobody can help me to solve my problem ? :( > > If you don't show what effort have you made to try to solve the problem, basically you are asking that people on the internet do this for you, for

[web2py] Re: database queries

2019-04-11 Thread learthurjoly
Hello everybody, Nobody can help me to solve my problem ? :( Le vendredi 5 avril 2019 11:42:26 UTC+2, learth...@gmail.com a écrit : > > Hello everybody. > > I ask you because I can’t make queries in my database with the DAL as I > wish. > > Here my context. I have two tables like this: > > >

[web2py] Re: database field is added and deleted immediately afterwards

2018-09-03 Thread Yebach
I had another *.py file as backup in my model folder. I changed the extension and all is works fine. thanks for the hint On Monday, September 3, 2018 at 4:42:07 PM UTC+2, Anthony wrote: > > Is it possible you have a second definition of the table that does not > include the c_total_difference c

[web2py] Re: database field is added and deleted immediately afterwards

2018-09-03 Thread Anthony
Is it possible you have a second definition of the table that does not include the c_total_difference column? On Monday, September 3, 2018 at 7:13:26 AM UTC-4, Yebach wrote: > > Hello > > When I add a field to my db.py I get an error saying field does not exist. > If I check the sql log file ther

[web2py] Re: Database question: 60 boolean fields + string:list or all string:list?

2018-05-11 Thread Leonel Câmara
> On top of that the user will be able to add features not there, in a tag cloud format using string:list (I assume that's the best method for freeform data of this sort). So for example, you can add tags that say 420-friendly or piano There's your answer. Forget the 60 boolean fields and just

[web2py] Re: Database question: 60 boolean fields + string:list or all string:list?

2018-05-09 Thread Management Backoffice
Thank you, Anthony. I will mull over the computed field idea, which I've skirted over in my web2py reading. I don't quite understand it & think it's time to hit the books again. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: Database question: 60 boolean fields + string:list or all string:list?

2018-05-09 Thread Anthony
If performance is not likely to be an issue, two list:string fields might simplify the logic. You could even combine them into a computed field for easier searching. Anthony On Wednesday, May 9, 2018 at 2:52:49 PM UTC-4, Management Backoffice wrote: > > App has a venue listing feature. Many boo

[web2py] Re: Database administration error

2018-01-23 Thread Jim S
I'm assuming other migrations work just fine - is that correct? If that is the case then I'm thinking it is a problem with foreign keys. If not that, then I'm stumped. If it were me, I'd do the following: 1. Make a backup of the database 2. Delete the database 3. Recreate the database with

[web2py] Re: Database administration error

2018-01-23 Thread SR
I changed the signature =True in my "auth.define_tables" which created extra fields in the auth_user table and after that I am getting this error. Yes Web2py is installed in /opt directory. This is a production machine. On Monday, January 22, 2018 at 6:31:44 PM UTC-6, Jim S wrote: > > Seems like

[web2py] Re: Database administration error

2018-01-23 Thread SR
On Monday, January 22, 2018 at 5:49:30 PM UTC-6, SR wrote: > > When I try to open my Database Administration window I am getting this > error ticket: > Error ticket for "cryoem"Ticket ID > > 10.51.133.94.2018-01-22.17-44-57.ddaeb556-9bc8-46b4-8dde-99a3c6eee6e7 > (1025, "Error on rename of > '.

[web2py] Re: Database administration error

2018-01-22 Thread Jim S
Seems like you might have a permissions error. Are you running web2py as root? Looks like web2py is install in the /opt directory. Is this a production or development machine? -Jim On Monday, January 22, 2018 at 5:49:30 PM UTC-6, SR wrote: > > When I try to open my Database Administration wi

[web2py] Re: Database question, problem adding column

2017-02-07 Thread martin
I'm pretty sure I tried that as well without success... However, the problem is solved now. Something was wrong with the databases files (or I was missing something) and also I had comiled files that was recreating this field whenever I tried to remove it. My solution was perhaps not so pretty

[web2py] Re: Database question, problem adding column

2017-02-07 Thread Leonel Câmara
Using the old version without the column you need both migrate=True and fake_migrate=True to rebuild the table files. Then add the new field and fake_migrate=False. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https

[web2py] Re: Database question, problem adding column

2017-02-07 Thread martin
Thanks for your reply! I did as you said and reverted back to a version without the new field, turned fake_migrate_all on like : "db = DAL(myconf.get('db.uri'), pool_size = myconf.get('db.pool_size'), #migrate_enabled = myconf.get('db.migrate'), check_rese

[web2py] Re: Database question, problem adding column

2017-02-07 Thread Jim S
Also, I'm assuming you've also read through this: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=migrate#Other-DAL-constructor-parameters -Jim On Tuesday, February 7, 2017 at 9:14:54 AM UTC-6, Jim S wrote: > > Can you show the migrate options you've tried? >

[web2py] Re: Database question, problem adding column

2017-02-07 Thread Jim S
Can you show the migrate options you've tried? I do this all the time with MySQL and it works great. Another possibility is that it ran through migration already on a different instance of the database. If so, turn on fake_migrate_all and remove the column. That should remove it from the file

[web2py] Re: Database error: month must be in 1..12

2016-12-29 Thread Dave S
On Thursday, December 29, 2016 at 4:00:36 AM UTC-8, Nabil Ontour wrote: > > Thank you Dave, that fixed it for me, so that I can access the page again. > > The table is defined like that: > > db.define_table('income', > Field('description','string',label='Description *' > ,

[web2py] Re: Database error: month must be in 1..12

2016-12-29 Thread Nabil Ontour
Thank you Dave, that fixed it for me, so that I can access the page again. The table is defined like that: db.define_table('income', Field('description','string',label='Description *', requires=IS_NOT_EMPTY()), Field('category','reference inc_categories',la

[web2py] Re: Database error: month must be in 1..12

2016-12-28 Thread Dave S
On Wednesday, December 28, 2016 at 6:10:27 PM UTC-8, Nabil Ontour wrote: > > Hello, > > I can't access my web2py page anymore, as it is showing the following > error: > > month must be in 1..12 > > Variables > > datetime.date > val '2016-14-12' > global datetime datetime.x86_64-linux-gnu.so'>

[web2py] Re: database is locked

2015-11-27 Thread Pierre
A simple reboot and it unlocked damned computers -- 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 are subsc

[web2py] Re: database is locked

2015-11-24 Thread Niphlod
uhm. it stays locked no matter what ? sqlite locks the entire db when writing, so make sure your app is the only one accessing the db... On Tuesday, November 24, 2015 at 5:54:32 PM UTC+1, Pierre wrote: > > Hi everyone, > I tried to unlock with db.executesql('PRAGMA journal_mode=WAL')

[web2py] Re: database query parsing

2015-08-11 Thread Niphlod
when you fetch fields from different tables, as you highlighted already, you don't have a resultset holding just columns, you have a dict holding table that hold fields. i.e. single table, named "test_table" with 2 fields, "field_1" and "field_2" will return a structure like {'field_1': value1

[web2py] Re: Database migration problem

2015-06-05 Thread Niphlod
it seems that you updated also the databases folder of your production app or ... dunno. I don't see why so many peoples are running into this kind of errors (there are others intricacies but adding column ISN'T one of them). What DAL does with migration is pretty documented and understandable.

[web2py] Re: Database

2015-05-28 Thread Jose C
You can only see and use tables and fields you define in a model file, see > the web2py book for details. > Specifically the Legacy database section: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=legacy#markmin_LegacyDatabases Pay special attention to

Re: [web2py] Re: database chema recommendations needed

2015-04-25 Thread Richard Vézina
Yes, but it is in python... I would use it as a starting point and transform it into a web app... But I don't know what you are doing and what you already have... But what you were talking about seems to me as a pretty big undertake for a single man!! (but again you maybe not alone). Richard On W

[web2py] Re: database chema recommendations needed

2015-04-25 Thread Mark Graves
One more thing, if you are worried about the speed, you can always cache the results in memory. On Tuesday, April 21, 2015 at 10:05:32 AM UTC-5, John wrote: > > New to programming and web2py. Been dabbling in web design for a while, > building sites with wordpress, plugging things in. My first r

[web2py] Re: database chema recommendations needed

2015-04-25 Thread Mark Graves
Hey John, Welcome to the community. I'm not sure I understand your requirements exactly, but here is my thoughts on a schema: For the initial MVP, I usually like to keep the amount of tables to a minimum, then as I figure out the common queries I can separate them out into multiple tables. F

[web2py] Re: database chema recommendations needed

2015-04-25 Thread John
Gramps is a desktop program for building a family tree. We have a web based version that we're fine with although I'd like to tie it into the actual site sometime for joint login purposes. This other part of the site is the individual transcriptions of old records. The data you would reference/c

[web2py] Re: Database

2015-04-05 Thread Leonel Câmara
I would say postgresql is better than MySQL, not just web2py but for everything. -- 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 messag

[web2py] Re: Database

2015-04-05 Thread 黄祥
granma said : 'everything is wonthefull if you know how to appreciate it' everything has a good side n bad side, imho better is which database you familiar n comfortable with, then please use it. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: database table/class/model functions

2015-01-25 Thread Leonel Câmara
For the first question, you can create either a field that's computed or a virtual field. For the second question, yes, you can create a Field.Method('age_group', lambda row: ...)) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sour

[web2py] Re: Database Access Layer (Not to be confused with database abstraction layer)

2014-10-03 Thread Massimo Di Pierro
If you use the latest web2py there is this code on welcome/controllers/default.py @auth.requires_login() def api(): """ this is example of API with access control

Re: [web2py] Re: Database per subdomain

2014-07-29 Thread Massimo Di Pierro
Now somebody tries that with Django. ;-) On Tuesday, 29 July 2014 08:33:58 UTC-5, Ruud Schroen wrote: > > That was indeed easy. Thanks! > > > On Tue, Jul 29, 2014 at 3:31 PM, Massimo Di Pierro < > massimo.dipie...@gmail.com> wrote: > >> very easy: >> >> if request.env.host_name == 'domain1': db_ur

Re: [web2py] Re: Database per subdomain

2014-07-29 Thread Ruud Schroen
That was indeed easy. Thanks! On Tue, Jul 29, 2014 at 3:31 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > very easy: > > if request.env.host_name == 'domain1': db_uri='sqlite://domain1.db' > elif request.env.host_name == 'domain2': db_uri='sqlite://domain2.db' > else: raise HTTP(40

[web2py] Re: Database per subdomain

2014-07-29 Thread Massimo Di Pierro
very easy: if request.env.host_name == 'domain1': db_uri='sqlite://domain1.db' elif request.env.host_name == 'domain2': db_uri='sqlite://domain2.db' else: raise HTTP(404) db = DAL(db_uri) On Tuesday, 29 July 2014 07:23:03 UTC-5, Ruud Schroen wrote: > > Hi list, > > I'm working on a portal where

[web2py] Re: Database query using exclude or "Does not contain"

2014-06-27 Thread Massimo Di Pierro
~cd.value.contains(filter_value_inc, all=False) ~ = NOT On Thursday, 26 June 2014 09:52:02 UTC-5, Douglas Campbell wrote: > > Hello, > > I am trying to filter out specific values in an SQLFORM.grid but I can not > figure out how to do this in the Query. Right now I have something like: > >

[web2py] Re: Database compute fields

2014-04-14 Thread Anthony
On Monday, April 14, 2014 11:10:28 AM UTC-4, horridohobbyist wrote: > > Sonovagun, you're right! But that rather diminishes the usefulness of > 'compute', IMO. > Yes, though I suppose the alternative would add a lot of complexity (and potentially inefficiency). Maybe at least when .update_record

[web2py] Re: Database compute fields

2014-04-14 Thread horridohobbyist
Sonovagun, you're right! But that rather diminishes the usefulness of 'compute', IMO. On Monday, 14 April 2014 08:15:14 UTC-4, Anthony wrote: > > Yes, otherwise the DAL would have to do a db query to retrieve all the > records being updated and issue a separate update for each record (since >

[web2py] Re: Database compute fields

2014-04-14 Thread Anthony
Yes, otherwise the DAL would have to do a db query to retrieve all the records being updated and issue a separate update for each record (since they may not all have the same price value and therefore might require different updated values in the computed field). On Monday, April 14, 2014 7:09:

[web2py] Re: Database compute fields

2014-04-14 Thread horridohobbyist
Are you saying I have to update the price field, regardless of whether it has changed or not?? That's not very logical. On Sunday, 13 April 2014 18:39:51 UTC-4, Anthony wrote: > > I believe you have to provide the price field in your update as well. -- Resources: - http://web2py.com - http://w

[web2py] Re: database query on nested tables

2014-04-08 Thread 黄祥
now, i know the reason why, thank you so much for your explaination, niphlod. best regards, stifan On Wednesday, April 9, 2014 4:49:26 AM UTC+7, Niphlod wrote: > > > > On Tuesday, April 8, 2014 2:44:52 PM UTC+2, 黄祥 wrote: >> >> hi, >> >> consider this : >> # e.g. 1 work >> for row in db(db.prod

[web2py] Re: database query on nested tables

2014-04-08 Thread Niphlod
On Tuesday, April 8, 2014 2:44:52 PM UTC+2, 黄祥 wrote: > > hi, > > consider this : > # e.g. 1 work > for row in db(db.product).select(): > print row.rack.branch > # e.g. 2 not work > print db(db.product.rack.branch == 1).select() > > is it possible to have the example 2 work? > no, you can't. d

[web2py] Re: database query on nested tables

2014-04-08 Thread Derek
John Resig wrote a 'prettydate' that is probably what he wants... http://ejohn.org/blog/javascript-pretty-date/ On Wednesday, April 10, 2013 7:31:35 AM UTC-7, Niphlod wrote: > > I did say "see it" prettydate as it is takes a date and calculates > automatically the timedelta to "now". > >

[web2py] Re: database query on nested tables

2014-04-08 Thread Dave S
On Wednesday, April 10, 2013 7:31:35 AM UTC-7, Niphlod wrote: > > I did say "see it" prettydate as it is takes a date and calculates > automatically the timedelta to "now". > > You need to have your own prettydate to be able to pass a timedelta of > your own. > > If you've got a datetime.

[web2py] Re: database query on nested tables

2014-04-08 Thread 黄祥
hi, consider this : # e.g. 1 work for row in db(db.product).select(): print row.rack.branch # e.g. 2 not work print db(db.product.rack.branch == 1).select() is it possible to have the example 2 work? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (D

[web2py] Re: Database access without DAL but with connection pool

2014-03-20 Thread Derek
I can't point you to any, you are welcome to do tests yourself. (note: this is why i said "believe it or not") On Thursday, March 20, 2014 6:22:20 AM UTC-7, Cliff Kachinske wrote: > > Derek, the conventional wisdom is connecting to a db is expensive. > > I'm willing to be convinced, but I need so

[web2py] Re: Database access without DAL but with connection pool

2014-03-20 Thread Cliff Kachinske
Derek, the conventional wisdom is connecting to a db is expensive. I'm willing to be convinced, but I need some data. Can you point me to some? Because if your statement is true, we could eliminate some pretty hairy code in the DAL to support pooling. On Wednesday, March 19, 2014 7:44:10 PM UTC

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread Derek
I'd say the answer to 2 is 'not really'. Believe it or not, opening and dropping database connections is a fast operation. On Tuesday, March 18, 2014 11:33:04 PM UTC-7, tec...@gmail.com wrote: > > Dear Sirs, > > > I understand it's possible to use databases without DAL. > For example function in

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread LightDot
Well, if you want to do it without the DAL, there are several options that might just work without any additional code: - check if specific python libs that you'll use for the db connection already provide a similar pooling function, they might - check if the database backend natively provides su

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread tech . uz
Hello Massimo, Thank you for reply. On Wednesday, March 19, 2014 7:20:27 PM UTC+5, Massimo Di Pierro wrote: > > I am not sure about pymongo but if you use > > DAL('mongodb:') > > the dal will do pooling for you. > Ok, I will check this. Actually I don't want to use pymongo only, it could a

[web2py] Re: Database access without DAL but with connection pool

2014-03-19 Thread Massimo Di Pierro
I am not sure about pymongo but if you use DAL('mongodb:') the dal will do pooling for you. On Wednesday, 19 March 2014 01:33:04 UTC-5, tec...@gmail.com wrote: > > Dear Sirs, > > > I understand it's possible to use databases without DAL. > For example function in controller: > > def values(

[web2py] Re: database callback return an error when using bulk_insert

2014-03-17 Thread 黄祥
any idea why this happens? or there is a limitation on bulk_insert and the database callback. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Database insert of time field in web2py not working?

2013-11-15 Thread 黄祥
> > Does this need the original validator to have been defined as a list to > work? > it depend, wheter you need 1 validator or more than 1 validator, if more than 1 validator please use list of validators []. > db.table.field.requires = first_validator > use it if you only need 1 validator

[web2py] Re: Database insert of time field in web2py not working?

2013-11-15 Thread User
Does this need the original validator to have been defined as a list to work? Is there a difference between db.table.field.requires = first_validator and db.table.field.requires = [first_validator] Does your append code work in either case? If there is a difference, when you declare a field

[web2py] Re: Database insert of time field in web2py not working?

2013-11-13 Thread Niphlod
db.table.field.requires.append(what_you_need) On Wednesday, November 13, 2013 6:43:38 AM UTC+1, User wrote: > > So since a time field automatically has an IS_TIME validator how would you > specify additional validators after the db.define_table statement? > > On Tuesday, November 12, 2013 3:51:12

[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread User
So since a time field automatically has an IS_TIME validator how would you specify additional validators after the db.define_table statement? On Tuesday, November 12, 2013 3:51:12 AM UTC-5, Niphlod wrote: > > requires can be a list of validators. > > On Tuesday, November 12, 2013 9:32:27 AM U

[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread Niphlod
requires can be a list of validators. On Tuesday, November 12, 2013 9:32:27 AM UTC+1, User wrote: > > Just realized I added the following lines after my db.define_table > statement: > > db.sometable.start_time.notnull = True > db.sometable.start_time.requires = IS_NOT_EMPTY() > > > I'm th

[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread User
Just realized I added the following lines after my db.define_table statement: db.sometable.start_time.notnull = True db.sometable.start_time.requires = IS_NOT_EMPTY() I'm thinking that my assignment of IS_NOT_EMPTY() overwrote the default IS_TIME() validator associated with time fields. Doe

Re: [web2py] Re: Database models don't import when using IPython 1.0.0 with web2py 2.7 (interactive shell)

2013-10-11 Thread Massimo Di Pierro
I cannot reproduce this. On Friday, 11 October 2013 09:03:00 UTC-5, Michele Comitini wrote: > > I have same problem it must be ipython 1.0.0... > > https://code.google.com/p/web2py/issues/detail?id=1710&start=100 > > > > > 2013/10/11 Tim Richardson > > >> work for me, python 2.7.5, ipython 1.1 on

Re: [web2py] Re: Database models don't import when using IPython 1.0.0 with web2py 2.7 (interactive shell)

2013-10-11 Thread Michele Comitini
I have same problem it must be ipython 1.0.0... https://code.google.com/p/web2py/issues/detail?id=1710&start=100 2013/10/11 Tim Richardson > work for me, python 2.7.5, ipython 1.1 on OS X > > > On Friday, 11 October 2013 13:16:17 UTC+11, Mark Li wrote: >> >> I recently upgraded to the new ve

[web2py] Re: Database models don't import when using IPython 1.0.0 with web2py 2.7 (interactive shell)

2013-10-11 Thread Tim Richardson
work for me, python 2.7.5, ipython 1.1 on OS X On Friday, 11 October 2013 13:16:17 UTC+11, Mark Li wrote: > > I recently upgraded to the new version of web2py from 2.5 (on > Pythonanywhere); everything seems to work fine except for the interactive > shell. > > Using the command "python web2py.py

[web2py] Re: Database update doesn't reflect in view

2013-08-12 Thread Anthony
On Monday, August 12, 2013 4:37:08 AM UTC-4, sasogeek wrote: > how do i explicitly update the auth.user.money? > I thought that's what I did here "...{'money':auth.user.money+100}..." > No, your code updates the db.auth_user record *in the database*. auth.user is just an attribute of the auth ob

[web2py] Re: Database update doesn't reflect in view

2013-08-12 Thread sasogeek
how do i explicitly update the auth.user.money? I thought that's what I did here "...{'money':auth.user.money+100}..." On Sunday, 11 August 2013 17:54:14 UTC+1, Anthony wrote: > > Upon login, the auth.user object is stored in the session and is not > updated again until next login (i.e., updating

[web2py] Re: Database update doesn't reflect in view

2013-08-11 Thread Anthony
Upon login, the auth.user object is stored in the session and is not updated again until next login (i.e., updating the db.auth_user record does not update auth.user). So, you'll have to explicitly update auth.user.money as well. Anthony On Sunday, August 11, 2013 12:42:45 PM UTC-4, sasogeek w

[web2py] Re: Database showing wrong default value

2013-08-01 Thread Niphlod
because datetime.datetime.now() is NOT deterministic every time you call it, it replies with the current time. What do you need specifically ? On Thursday, August 1, 2013 1:56:48 PM UTC+2, Apoorve Mohan wrote: > > > Hello > > I am storing datetime.datetime.now() as default value of an attribu

Re: [web2py] Re: Database row update problem !

2013-07-02 Thread Ahmad Faiyaz
wow!! many many thanks.. :) On Tue, Jul 2, 2013 at 10:15 AM, Anthony wrote: > You left out some critical code from the original question -- your > Javascript sends each post request twice: > > function send_data(id){ > $.post("{{=URL('contest','flip_contest_status')}}", {id: id} ); >

Re: [web2py] Re: Database row update problem !

2013-07-01 Thread Anthony
You left out some critical code from the original question -- your Javascript sends each post request twice: function send_data(id){ $.post("{{=URL('contest','flip_contest_status')}}", {id: id} ); $.post("{{=URL('contest','flip_contest_status')}}", {id: id} ) .done

Re: [web2py] Re: Database row update problem !

2013-07-01 Thread Ahmad Faiyaz
here is the database definition: db.define_table('contest', Field('name', length=128 ), Field('contest_host', length=128,), Field('duration', 'time' ), Field('time_passed','time', default = 0), Field('rank_frozen','time', default = 0), Field('running',length= 10, readable=False, default = "no"), F

Re: [web2py] Re: Database row update problem !

2013-07-01 Thread Anthony
Can you show the code you are now using and describe the workflow of how the record gets updated and how you are then attempting to view the updated record? Anthony On Monday, July 1, 2013 8:37:32 PM UTC-4, Ahmad Faiyaz wrote: > weird things happening, when i check the db table with appadmin,

Re: [web2py] Re: Database row update problem !

2013-07-01 Thread Ahmad Faiyaz
weird things happening, when i check the db table with appadmin, it shows for contest.running = yes [ updated the value with sqlform.grid ] , but when i fetch the row with DAL on app, it shows contest.running = no [ which is the default ] why ? On Tue, Jul 2, 2013 at 6:18 AM, Ahmad Faiyaz wrote:

Re: [web2py] Re: Database row update problem !

2013-07-01 Thread Ahmad Faiyaz
thanks, but it sometimes work, sometimes doesn't !! what can be the problem ! On Tue, Jul 2, 2013 at 5:34 AM, Alex wrote: > from the documentation: > update_record should not be confused with > >>> row.update(name='Curt') > because for a single row, the method update updates the row object but n

[web2py] Re: Database row update problem !

2013-07-01 Thread Alex
from the documentation: update_record should not be confused with >>> row.update(name='Curt') because for a single row, the method update updates the row object but not the database record, as in the case of update_record so you should use update_record instead. or even better: db(db.contest.id =

[web2py] Re: database disk image is malformed

2013-06-27 Thread greenpoise
I grabbed SQLite Manager firefox extension, did an integrity check, restarted web2py and message was no longer there..Phew..thanks. On Wednesday, June 26, 2013 2:05:06 PM UTC-7, Niphlod wrote: > > whoopsie. If that is indeed web2py's sqlite database, follow these steps > > > http://techblog.do

[web2py] Re: database disk image is malformed

2013-06-26 Thread Niphlod
whoopsie. If that is indeed web2py's sqlite database, follow these steps http://techblog.dorogin.com/2011/05/sqliteexception-database-disk-image-is.html On Wednesday, June 26, 2013 11:01:47 PM UTC+2, Niphlod wrote: > > sure that is web2py's database ? > That message is usually outputted when yum

[web2py] Re: database disk image is malformed

2013-06-26 Thread Niphlod
sure that is web2py's database ? That message is usually outputted when yum (the package manager) database has something wrong in it. On Wednesday, June 26, 2013 10:53:25 PM UTC+2, greenpoise wrote: > > The DB still works but I can see that in my terminal. Just noticed it. Is > this normal? --

Re: [web2py] Re: database shootout

2013-05-28 Thread Ricardo Cárdenas
Just got email from a PA developer saying they're hoping to have Postgres 9.2 out next month. Good news! On Tue, May 28, 2013 at 8:23 AM, Cliff Kachinske wrote: > They [PythonAnywhere] list Psycopg2 among the installed gadgets. This > will definitely push me in their direction. -- --- You

[web2py] Re: database shootout

2013-05-28 Thread Cliff Kachinske
They list Psycopg2 among the installed gadgets. This will definitely push me in their direction. On Monday, May 27, 2013 9:08:30 PM UTC-4, Monte Milanuk wrote: > > On 05/27/2013 09:29 AM, Ricardo C�rdenas wrote: > > > > PythonAnywhere is a terrific option; I'm a bit surprised they don't >

[web2py] Re: database shootout

2013-05-27 Thread memilanuk
On 05/27/2013 09:29 AM, Ricardo Cárdenas wrote: PythonAnywhere is a terrific option; I'm a bit surprised they don't offer Postgres. Maybe someone with influence on the PythonAnywhere folks can give them a nudge? Could push many projects their way. I've been following their 'forum' for a littl

Re: [web2py] Re: database shootout

2013-05-27 Thread Alexei Vinidiktov
I can't give you any specifics right now as I haven't done any migrations in a long time but the next time I come across what I think to be a bug I'll be sure to post here. It'll be really great if we can fix those glitches. On Sun, May 26, 2013 at 8:38 PM, Massimo Di Pierro < massimo.dipie...@g

Re: [web2py] Re: database shootout

2013-05-26 Thread Massimo Di Pierro
Can you tell us more. I believe firebird does not support multiple alter tables in transaction and that is cause of some problems. Make sure you always mgrate one table at the time. On Sunday, 26 May 2013 06:24:49 UTC-5, Alexei Vinidiktov wrote: > > I use Firebird with web2py but I often have pr

Re: [web2py] Re: database shootout

2013-05-26 Thread Alexei Vinidiktov
I use Firebird with web2py but I often have problems migrating db schemas because of incorrect sql migration scripts that web2py issues. On Sat, Mar 9, 2013 at 1:04 AM, pjag wrote: > web2py works nicely with Firebird DB. Highly recommended. > > > On Thursday, March 7, 2013 3:41:18 PM UTC-5, Bl

[web2py] Re: Database Triggers

2013-05-21 Thread Niphlod
there's no functionality to write triggers . They're too much dependant (syntax-wise) on the db backend. But, web2py exposes some nice callbacks that can deal with most of the corner-cases where you'd need a database triggers http://web2py.com/books/default/chapter/29/06#before-and-after-callbac

[web2py] Re: database query on nested tables

2013-04-10 Thread Niphlod
I did say "see it" prettydate as it is takes a date and calculates automatically the timedelta to "now". You need to have your own prettydate to be able to pass a timedelta of your own. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" gro

[web2py] Re: database query on nested tables

2013-04-10 Thread 黄祥
when i tried to using prettydate it return [invalid date] e.g. *from gluon.tools import prettydate* def __onvalidation_check_out(form): if form.vars.check_in: rows = db(db.check_in.id==form.vars.check_in).select() for row in rows: form.vars.room = row.room

[web2py] Re: database query on nested tables

2013-04-10 Thread Niphlod
check prettydate http://web2py.com/books/default/chapter/29/14?search=prettydate On Wednesday, April 10, 2013 3:45:19 PM UTC+2, 黄祥 wrote: > > brilliant, very simple solution, it's work now. > thank you so much for your solution and suggestion, massimo > i've followed your hints and make it on my

[web2py] Re: database query on nested tables

2013-04-10 Thread 黄祥
brilliant, very simple solution, it's work now. thank you so much for your solution and suggestion, massimo i've followed your hints and make it on my controller : def __onvalidation_check_out(form): if form.vars.check_in: rows = db(db.check_in.id==form.vars.check_in).select() f

[web2py] Re: database query on nested tables

2013-04-10 Thread Massimo Di Pierro
PS. Anyway, I would copy the price into check_in and check_out tables. I know this is redundant but in any hotel you will have to handle discounts for each individual client (to handle complaints, friends, etc.) This will give you flexibility and make it faster. On Wednesday, 10 April 2013 08:1

[web2py] Re: database query on nested tables

2013-04-10 Thread Massimo Di Pierro
check_in = db.check_in[id] print check_in.room.category.price On Wednesday, 10 April 2013 04:38:08 UTC-5, 黄祥 wrote: > > hi folks, > > i want to get the value of table row that have 3 nested values. my goal is > to get the price value from table room_category from function check_out in > my cont

[web2py] Re: database query on nested tables

2013-04-10 Thread 黄祥
sorry the table for check out is db.define_table('check_out', Field('check_in', 'reference check_in'), Field('room'), Field('guest'), Field('description', 'text'), Field('duration'), format='%(guest)s %(room)s') i extract the room and guest value from check_in table and in

Re: [web2py] Re: database is locked

2013-04-07 Thread Martin Weissenboeck
2013/4/7 vince > from my experience if u running web2py on apache with mod_wsgi u will get > database locked more often than running web2py alone with it's buildin > webserver. web2py + apache + mod_wsgi is my configuration. ok, I will try the internal webserver. > > u should also avoid using

Re: [web2py] Re: database is locked

2013-04-07 Thread vince
from my experience if u running web2py on apache with mod_wsgi u will get database locked more often than running web2py alone with it's buildin webserver. u should also avoid using session on sqlite database. On Saturday, April 6, 2013 11:14:16 PM UTC+8, BlueShadow wrote: > > I know that I wi

Re: [web2py] Re: database is locked

2013-04-06 Thread Martin Weissenboeck
If I would change from SQlite to another system, what do you propose? 2013/4/6 BlueShadow > [(u'wal',)]thats what the db.executesql("PRAGMA journal_mode") returns. :( > I guess I have to migrate faster. > > -- > > --- > You received this message because you are subscribed to the Google Groups

Re: [web2py] Re: database is locked

2013-04-06 Thread BlueShadow
[(u'wal',)]thats what the db.executesql("PRAGMA journal_mode") returns. :( I guess I have to migrate faster. -- --- 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

Re: [web2py] Re: database is locked

2013-04-06 Thread Niphlod
this statement PRAGMA journal_mode returns the current journal mode. By default should return "delete", while if the db is in WAL mode, it returns "wal" On Saturday, April 6, 2013 5:11:16 PM UTC+2, BlueShadow wrote: > > How can I test if wal is enabled? > > On Saturday, April 6, 2013 3:54:10 P

  1   2   3   4   >