[web2py] Re: Problem with form.process().accepted ?

2013-04-08 Thread Anthony
Is it possible that your browser isn't accepting cookies, or that you are somehow clearing the session? Without cookies, the session won't work, and by default, SQLFORM uses the session to store the _formkey token to protect against CSRF attacks. To see if that's the problem, you can try: if

Re: [web2py] Re: REF: Trying out matplotlib

2013-04-08 Thread Teddy Nyambe
Massimo, maybe to bring this issue to a close for me and others who may be interested in using matplotlib in the shortest future, since you have successfully used matplotlib could you post just a few lines of called addressing challenges: 1. Installation of Matplotlib On the Mac os x i did sudo

[web2py] running a script without the opening lines

2013-04-08 Thread guruyaya
I have some script I'm running via linux cron, using web2py panel, like so web2py.py -S app -M -R application/app/scripts/myscript.py When It starts, it shows these lines: No handlers could be found for logger web2py web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2013 Version

Re: [web2py] Re: .sum() and .count() in grid?

2013-04-08 Thread Johann Spies
I can use SQLTABLE for this and then have to write some code for pagination and search options - all which are already in the SQLFORM.grid available. In this case addition, deletion and editing will be avoided. Regards Johann On 4 April 2013 15:17, Niphlod niph...@gmail.com wrote: I'm

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Marian
Thank you Niphlod for the slice. :) But sadly it's not working for me. The problem is somehow my application and not nssm. If I define a scheduler in the welcome app it works. In my app even a blank scheduler function fails. In scheduler.py I found a check on WEB2PY_PATH, so I set it but without

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Domagoj Kovač
Hi, i tried moving companies outside of db.py. In db.py i have: auth.settings.extra_fields['auth_user'] = [Field('deleted', 'boolean', default=False), Field('company_id', 'reference companies', requires=IS_IN_DB(db, (db, 'companies.id',

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Niphlod
If a scheduler in the welcome app works, I'm quite sure (90%, give or take) that the problem lies in your app code the point is: your scheduler doesn't work as a service cause as soon as it's started it dies or because while running all task fail ? On Monday, April 8, 2013 9:28:30 AM

[web2py] Re: Problem with form.process().accepted ?

2013-04-08 Thread Nguyen Minh Tuan
Thank you! That's the problem. On Monday, April 8, 2013 1:06:29 PM UTC+7, Anthony wrote: Is it possible that your browser isn't accepting cookies, or that you are somehow clearing the session? Without cookies, the session won't work, and by default, SQLFORM uses the session to store the

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Niphlod
too many db. requires=IS_IN_DB(db, (db, 'companies.id', '%(name)s')) needs to be requires=IS_IN_DB(db, 'companies.id', '%(name)s') On Monday, April 8, 2013 9:39:15 AM UTC+2, Domagoj Kovač wrote: Hi, i tried moving companies outside of db.py. In db.py i have:

[web2py] Re: Building Query object based on Rows avoiding 'belongs'

2013-04-08 Thread Marcin Jaworski
Hi, Thank you for quick reply. I have used the patch to retrieve the rows I needed (for target query object). Let's say I have retrieved list of 90 rows identified by id numbers [n,n+1,...n90]. My first idea was to combine the results of subsequent 'belongs' queries to build target query

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Marian
I think you are right, it has something to do with the application itself. It dies directly on startup with exit code 1. The scheduler works when it is started in command line, so I think there is a problem with the environment or something like that. On Monday, April 8, 2013 9:41:38 AM

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Domagoj Kovač
I see it now. Thanks man! I have a different problem now, now i don't get any errors immediately but when i go on users/create i get an error saying: type 'exceptions.AttributeError' 'DAL' object has no attribute 'companies' obviously companies model is not loaded, i am thinking on switching to

[web2py] Re: Server-Sent Events

2013-04-08 Thread Niphlod
You said that the commet-thing is no longer existing, as websockets where already included in web2py.js, which as I remember correctly is referenced in the main application layout. But what about SSE? I mean, sure, it's just an HTTP request, at start, but there is a different model for

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Niphlod
uhm. if you want that field to be a reference to the values on the table, the table must be defined, so I don't see how a SQLFORM.factory could help you with that. You simply have a conditional model that for your app logic doesn't need to be conditional . On Monday, April 8, 2013 10:20:56 AM

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Niphlod
are you playing with signals by any chance ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit

Re: [web2py] Re: scheduler sincronization

2013-04-08 Thread paolo.vall...@gmail.com
Hi Niphlod, sorry for the delay I had time only on the weekend to run few tests. On my pc, I run it for hours using postgres. The maximum delay found in starting a new task was 17s. Paolo 2013/4/4 paolo.vall...@gmail.com paolo.vall...@gmail.com Unfortunately I can't install any dbms on that

Re: [web2py] Re: track_changes bug or feature?

2013-04-08 Thread Daniel Gonzalez Zaballos
Thanks! I said it because restarting the server with every little change in a development environment, is a little weird. I'll change some imports to make them inside methods. 2013/4/6 Massimo Di Pierro massimo.dipie...@gmail.com This is intended. classone is importend once and it imports

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Marian
I don't use signals, but I found the problem... I linked my application via hardlink into the web2py applications folder so I can work with aptana studio and don't have to mess around with deploying everytime I change something. I guess I need another way to separate web2py and the

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Domagoj Kovač
Is there any way to load models manually? On Monday, April 8, 2013 10:23:55 AM UTC+2, Niphlod wrote: uhm. if you want that field to be a reference to the values on the table, the table must be defined, so I don't see how a SQLFORM.factory could help you with that. You simply have a

Re: [web2py] Re: .sum() and .count() in grid?

2013-04-08 Thread Johann Spies
Thanks for the explanation of using views Niphod. I have used Postgresql's select into... in the past for similar situations, but using views seems to be a better option. Regards Johann On 6 April 2013 00:04, Niphlod niph...@gmail.com wrote: often referred as materialized views for the ones

[web2py] Re: nssm scheduler seems to be a nobrainer...

2013-04-08 Thread Marian
Hardlinking the whole applications folder into web2py seems to work... On Monday, April 8, 2013 10:36:40 AM UTC+2, Marian wrote: I don't use signals, but I found the problem... I linked my application via hardlink into the web2py applications folder so I can work with aptana studio and

Re: [web2py] Re: scheduler sincronization

2013-04-08 Thread Niphlod
ok, so to recap, the problem lies only with sqlite. I'm not saying it's not an issue I'll continue looking into, I'm just glad that at least with a db that has no concurrency issues (like postgres) the code runs fine. I'll be back on testing it with sqlite this evening: I'm not that confident

[web2py] SQLFORM.factory does not update record with upload field

2013-04-08 Thread António Ramos
Hello my db.py db.define_table('tab1', Field('f1'), Field('f2','upload',uploadfolder=os.path.join(request.folder,'uploads')) ) db.tab1.f2.requires=IS_NOT_EMPTY() my controller def tab1(): if request.args(0): print editing record

[web2py] Re: auth.settings.extra_fields

2013-04-08 Thread Domagoj Kovač
I added companies definition in db.py. It will be ok for now. Thanks. On Monday, April 8, 2013 11:05:22 AM UTC+2, Domagoj Kovač wrote: Is there any way to load models manually? On Monday, April 8, 2013 10:23:55 AM UTC+2, Niphlod wrote: uhm. if you want that field to be a reference to the

[web2py] Re: Multi-tenany and url routing

2013-04-08 Thread Domagoj Kovač
For now i will try a bit different approach. I will have myapp/company_name_value/login when user logs in i will set a cookie with company_name_value and session.company_id. When user is logged out, i will use cookie value for redirection to proper login page. My initial idea was to handle

[web2py] Re: cookies related

2013-04-08 Thread dave Zeng
Hi, Anthony, Thanks very much, It's helpful for the 1st. for my 2nd question, setting cookies on browser client could complete the task, but need to load another javascript plugin, so i am trying to address it in Web2py. Simply speaking, it's a student site, when student practises,

[web2py] Re: web2py with ExtJS - advice required on restructing

2013-04-08 Thread at
Thank you Alan .. will give it a try definately. May be I'll be the first to download this plugin? :) Regards On Monday, 8 April 2013 00:15:12 UTC+5, Alan Etkin wrote: You are right we cant get web2py form helpers but can you authentication, session management, jsonifying etc. We already

[web2py] Re: web2py with ExtJS - advice required on restructing

2013-04-08 Thread Alan Etkin
Thank you Alan .. will give it a try definately. May be I'll be the first to download this plugin? :) Possibly. Note: I recently added some fixes that might not be included in the dowloadable plugin. Anyway, you can copy-paste the hg repository files in your application. To download

Re: [web2py] Re: web2py 2.4.2 is OUT

2013-04-08 Thread Marco Túlio Cícero de M . Porto
worked for me 2013/4/8 Luc Chase l...@lucchase.com + and - definitely don't work on (2, 4, 6, 'stable', datetime.datetime(2013, 4, 6, 17, 37, 38)) -- Luc. On Sunday, 10 March 2013 14:31:04 UTC, Massimo Di Pierro wrote: This should now be fixed. Can you check? On Tuesday, 5 March

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
Nope, or maybe I expressed myself badly: that implementations started named as comet messaging but turned to websocket messaging at the first iteration. web2py.js has an usable implementation for it and gluon/contrib/websocket_messaging.py is 200 lines of which 70 are comments, it's

[web2py] Re: Upgrading to 2.4.2. breaks virtual field

2013-04-08 Thread Kenneth
Nobody has any pointers how to fix this? I'm using powertable plugin in my app and if possible don't want to replace it right now. Kenneth Den lördagen den 9:e mars 2013 kl. 21:11:20 UTC+2 skrev Kenneth: Hi, anybody have any ideas where to start solving this? Traceback 1. 2. 3.

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
Oh, and I forgot the most important aspect: How can an active submission-action of user A, *locate *the correct session that holds the correct SSE-connection of user B? And how can it use that SSE-action *with *that session of user B? -- --- You received this message because you are

Re: [web2py] Re: Upgrading to 2.4.2. breaks virtual field

2013-04-08 Thread Marco Túlio Cícero de M . Porto
you're still using 2.4.2 or upgraded to 2.4.6? There were some changes, including bug fixes from one to another... 2013/4/8 Kenneth kenneth.t.lundst...@gmail.com Nobody has any pointers how to fix this? I'm using powertable plugin in my app and if possible don't want to replace it right now.

[web2py] Re: Difference in headers upload/download vs static file, also in auth.wiki

2013-04-08 Thread Alan Etkin
While debugging why the audio tag behaves differently (at least in Mac Chrome) depending on specifying (1) a static link to a soundfile or (2) using the auth.wiki syntax 2/sound.mp3 I notice quite a few differences in the headers. I have a similar problem with web2py trunk Version

[web2py] Re: Server-Sent Events

2013-04-08 Thread Niphlod
As I said, I've already gone over the websocket_messaging.py file - it has dealings with WebSockets - NOT SSE (!) - and via Tornado, NOT web2py... We all got that. it's an external process, but it's implemented already, it just works, has a simple yet powerful routing algo and its secure.

[web2py] How to - using DAL for Between

2013-04-08 Thread Rahul
Hi All, I am working on a query in SQLite - Where I can search on some data for last 7 days - SQLite raw sql query is as follows: query = db.executesql(SELECT ticket_no, description FROM issues where date_today between datetime ('now', '-6 days') AND datetime ('now', 'localtime')) I

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Niphlod
from datetime import timedelta now = request.now six_days_back = now - timedelta(days=6) db( (db.issues.date_today = six_days_back) (db.issues.date_today = request.now) ).select(whateverfieldyouneed) On Monday, April 8, 2013 3:07:57 PM UTC+2, Rahul wrote: Hi All, I am working

[web2py] SQLFORM.grid search widget omits decimal fields. Any reason for this?

2013-04-08 Thread Cliff Kachinske
Is there any reason why the default search widget does not include decimal field types? In sqlhtml.py v 2.4.2, decimal field types are omitted from the search options dictionary, lines 1619, 1629. Likewise in lines 1637 -1731 there is no value_input defined for decimal field types. Is there

[web2py] Re: SQLFORM.grid search widget omits decimal fields. Any reason for this?

2013-04-08 Thread Massimo Di Pierro
Please open a ticket about this. It is an oversight and easy to fix. On Monday, 8 April 2013 08:43:40 UTC-5, Cliff Kachinske wrote: Is there any reason why the default search widget does not include decimal field types? In sqlhtml.py v 2.4.2, decimal field types are omitted from the search

[web2py] Re: Building Query object based on Rows avoiding 'belongs'

2013-04-08 Thread Marcin Jaworski
Hi All! Finally I ended up with ugly solution, namely sqlhtml.py customization (redefinition of rows), where rows to show in grid are defined based on query object. Thank you for your help and kind egards, Marcin Jaworski W dniu poniedziałek, 8 kwietnia 2013 10:12:24 UTC+2 użytkownik

[web2py] Re: web2py 2.4.6 is OUT

2013-04-08 Thread Marian
Thank you for this great framework! On Saturday, April 6, 2013 11:36:15 PM UTC+2, Massimo Di Pierro wrote: ## 2.4.6 - better tests - new ANY_OF and IS_IPV6 validators - new custom save option - many small bug fixes The bug fixes are worth the upgrade. Nothing should break. -- ---

[web2py] representing nested subqueries results in one page (grid)

2013-04-08 Thread Jurgis Pralgauskis
Hi, can this be accomplished with some grid? http://i.stack.imgur.com/Eirfv.png [image: http://i.stack.imgur.com/Eirfv.png] I thougth over a bit: a) with grid - I can construct sequence of joins-- just the parents (Author/Book/Story..) would be repeated for each line (and then might be

[web2py] Re: representing nested subqueries results in one page (grid)

2013-04-08 Thread Jurgis Pralgauskis
I figured out a way with grid (recursively loads all the children stack) ps.: probably there is a better way to find out which tables are referencing you children_queries= { db.grandparent: lambda row: db.parent.parent==row.id, db.parent: lambda row: db.child.parent==row.id,

[web2py] Re: representing nested subqueries results in one page (grid)

2013-04-08 Thread Jurgis Pralgauskis
and still would like to be able to load it more interactivelly with smartgird. now if I try smartgrid SQLFORM https://jurgis.pythonanywhere.com/examples/global/vars/SQLFORM.smartgrid(db.grandparent, linked_tables=['parent', 'child'], links=[dict(header='children', body=lambda row:

[web2py] Re: SQLFORM.grid search widget omits decimal fields. Any reason for this?

2013-04-08 Thread Cliff Kachinske
Done. Issue 1436. On Monday, April 8, 2013 10:00:01 AM UTC-4, Massimo Di Pierro wrote: Please open a ticket about this. It is an oversight and easy to fix. On Monday, 8 April 2013 08:43:40 UTC-5, Cliff Kachinske wrote: Is there any reason why the default search widget does not include

[web2py] Re: SQLFORM.grid search widget omits decimal fields. Any reason for this?

2013-04-08 Thread Cliff Kachinske
I can provide a patch. Should I do the diff against trunk or stable or nightly build? On Monday, April 8, 2013 10:40:04 AM UTC-4, Cliff Kachinske wrote: Done. Issue 1436. On Monday, April 8, 2013 10:00:01 AM UTC-4, Massimo Di Pierro wrote: Please open a ticket about this. It is an

[web2py] Re: representing nested subqueries results in one page (grid)

2013-04-08 Thread Cliff Kachinske
grid and smartgrid are not the best way to achieve what you are trying to do. On Monday, April 8, 2013 10:34:20 AM UTC-4, Jurgis Pralgauskis wrote: and still would like to be able to load it more interactivelly with smartgird. now if I try smartgrid SQLFORM

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
Look, I appreciate you're trying to help-out, but it seems you are answering the questions you know the answers to, instead of the questions I ask. It's OK to say that you don't know the answer. You are not alone in this user-group, perhaps someone else does. We all got that. it's an external

Re: [web2py] Re: Upgrading to 2.4.2. breaks virtual field

2013-04-08 Thread Kenneth Lundström
Hello, have tested 2.4.2., 2.4.5 and today 2.4.6 and still receiving the same error. Kenneth you're still using 2.4.2 or upgraded to 2.4.6? There were some changes, including bug fixes from one to another... 2013/4/8 Kenneth kenneth.t.lundst...@gmail.com

[web2py] Re: SQLFORM.grid search widget omits decimal fields. Any reason for this?

2013-04-08 Thread Massimo Di Pierro
Always trunk. Please. On Monday, 8 April 2013 10:25:13 UTC-5, Cliff Kachinske wrote: I can provide a patch. Should I do the diff against trunk or stable or nightly build? On Monday, April 8, 2013 10:40:04 AM UTC-4, Cliff Kachinske wrote: Done. Issue 1436. On Monday, April 8, 2013

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
The reason this capability is useless, is that it limits the usage of SSE connection way too much... There is no reason I would have to stick my entire code for dealing with updates to a section of my app, within a single action... It makes no sense at all... If I have an action that updates

[web2py] Re: PAM + Kerberos + LDAP Problem

2013-04-08 Thread Massimo Di Pierro
I have no idea but I would sugget adding some debug statements in ldap_auth.py and see why it fails for some users. There are many configuration options in ldap therefore it probably is a settings issue. Can you try authenticate them from python-ldap from python shell? Can you try identify

[web2py] Re: auth.user.id in restful api

2013-04-08 Thread Massimo Di Pierro
Does this help: patterns = [ /friends[person], /{person.name}/:field, ... (/dogs[pet],

[web2py] Re: Server-Sent Events

2013-04-08 Thread Niphlod
On Monday, April 8, 2013 5:48:31 PM UTC+2, Arnon Marcus wrote: Look, I appreciate you're trying to help-out, but it seems you are answering the questions you know the answers to, instead of the questions I ask. It's OK to say that you don't know the answer. You are not alone in this

[web2py] Re: contribute in indonesian language translate

2013-04-08 Thread Massimo Di Pierro
Thank you. This is now in trunk. Mind that the translation files contain some string from your app that do not belong to the welcome app. Perhaps they should be removed. On Sunday, 7 April 2013 23:30:13 UTC-5, 黄祥 wrote: yes, me too, i can't find it. although when i checked the log it said

[web2py] Replicated Databases and fail over

2013-04-08 Thread Srinath
Hi, We have been trying to get this thing right. REF: http://web2py.com/books/default/chapter/29/06 There is a note about Replicated databases in the given link. The first argument of DAL(...) can be a list of URIs. In this case web2py tries to connect to each of them. In this case the DAL

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Derek
Of course, you could omit the db.issues.date_today = request.now if you know for a fact there are no time travelers opening tickets in the future. ;) On Monday, April 8, 2013 6:27:18 AM UTC-7, Niphlod wrote: from datetime import timedelta now = request.now six_days_back = now -

[web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Derek
try putting it in [brackets] or quotes. On Sunday, April 7, 2013 7:32:03 PM UTC-7, Martin Barnard wrote: Continuing on my Oracle adventures, I have found a table which I need to access, which has an integer field called '*drop*'. For *obvious*reasons, it is disallowed. Is there any way to

Re: [web2py] Re: pre populated SQLFORM.FACTORY does not submit because of upload field

2013-04-08 Thread Massimo Di Pierro
It took me a while to isolate the problem. Here is a simple code to reproduce it: def index(): db.define_table('thing',Field('image','upload',requires=IS_NOT_EMPTY())) db.thing.image.default = 'xxx.png' form = SQLFORM.factory(db.thing,upload=URL('download')).process() return

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
oh my SSE are unidirectional, so of course the example shows you just the server -- client part and not the client--server one. you can do the client-- server part as usual with an ajax post. (I would appreciate you refrain from using expressions with condescending implications such

[web2py] Re: list:string type field is empty value on edit page

2013-04-08 Thread Massimo Di Pierro
db.define_table('gender', Field('gender', 'list:string'), format='%(gender)s') db.gender.gender.requires=IS_IN_SET(['Male', 'Female']) should be db.define_table('gender', Field('gender', 'list:string'), format='%(gender)s') db.gender.gender.requires=IS_IN_SET(['Male',

[web2py] Re: UnicodeEncodeError on GAE

2013-04-08 Thread Massimo Di Pierro
Can you please give me more details and a simple example to reproduce it? Is this on GAE only? Still a problem with 2.4.6? On Monday, 8 April 2013 00:57:17 UTC-5, Spring wrote: Encountered the same issue, removing 'str()' and it worked. Thanks 在 2012年2月16日星期四UTC+8下午10时59分28秒,sherdim写道: I

[web2py] Re: SQLFORM.factory does not update record with upload field

2013-04-08 Thread Massimo Di Pierro
The workflow is ambiguous. You are not editing a record therefore it is not clear whether an empty submission means you want to keep or remove the default. It thinks you want to remove it. If you want to keep it, still, it is not a proper default for the input (since it is no a fieldstorage to

[web2py] help debugging this

2013-04-08 Thread Massimo Di Pierro
I cannot think of any change that would cause this: https://code.google.com/p/web2py/issues/detail?start=100id=1435 *What steps will reproduce the problem?* 1. Openshift - start account, install web2py using the github stem, once installed, upgrade - fails 2. dotcloud - start account, install

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Rahul
Thanks Niphlod, :-) This code works with webgrid component. But I get an error when I try to use it with SQLForm.grid. Something like below - --- Ticket ID 127.0.0.1.2013-04-08.22-09-49.ef6e6a56-089a-4c50-87fa-2099255002de type 'exceptions.AttributeError' 'Rows'

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
That's what I'm talking about... :) http://vimeo.com/41410528 And this is from 2011... When will web2py support 0MQ ??? Ach... Can web2py subscribe to Redis publishing? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Massimo Di Pierro
what's the code? You are passing rows/records where you are supposed to pass a query. On Monday, 8 April 2013 13:46:03 UTC-5, Rahul wrote: Thanks Niphlod, :-) This code works with webgrid component. But I get an error when I try to use it with SQLForm.grid. Something like below -

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
Tried. Didn't work. On 8 April 2013 19:57, Derek sp1d...@gmail.com wrote: try putting it in [brackets] or quotes. On Sunday, April 7, 2013 7:32:03 PM UTC-7, Martin Barnard wrote: Continuing on my Oracle adventures, I have found a table which I need to access, which has an integer field

[web2py] Re: Server-Sent Events

2013-04-08 Thread Niphlod
On Monday, April 8, 2013 7:11:57 PM UTC+2, Arnon Marcus wrote: oh my SSE are unidirectional, so of course the example shows you just the server -- client part and not the client--server one. you can do the client-- server part as usual with an ajax post. (I would appreciate you

[web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Massimo Di Pierro
You can simply set DAL(..., check_reserved=None) the problem is, will Oracle accept the SQL generated by DAL? You need to try. I do not know. On Sunday, 7 April 2013 21:32:03 UTC-5, Martin Barnard wrote: Continuing on my Oracle adventures, I have found a table which I need to access, which

[web2py] How can I grab the parent ID from this record?

2013-04-08 Thread Alex Glaros
I want to grab the ID of parent file SharedService during a search. What is the best way to get it? Can it be obtained using factory or sqlform? ## - ## Here's the model:

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
I had already done that. The error generated is in the Field class and is matching against REGEX_PYTHON_KEYWORDS, here: File /home/www-data/web2py/gluon/dal.py, line 9139, in __init__ raise SyntaxError('Field: invalid field name: %s' % fieldname) SyntaxError: Field: invalid field name: drop

[web2py] How to merge two tables

2013-04-08 Thread David S
I have three tables, db.table1 db.table2 and db.table3. They are identical except for the information stored in each. table3 is blank and after running some code should contain the combination of the values in table1 and table2. An example (uuid is generated by web2py_uuid()): db.table1:

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
After tinkering with dal.py separating out the check, the issue is with * hasattr*(Table,fieldname). I'm assuming that self.drop exists as part of the object creation. A possible solution would be to have a legacy flag on a field so that internally it could map to the right field, but externally

[web2py] Re: How to merge two tables

2013-04-08 Thread Cliff Kachinske
db(db.table1.col1 == db.table2.col1).select( db.table1.col2, db.table1.col3, db.table1.col4, db.table1.col5, db.table2.col6, db.table2.col7 ) What's the purpose of the uuid? If they are identical between corresponding rows of the two tables, it defeats the purpose of uuid. uuid

[web2py] Re: can't open the admin edit function for the view of my default controller.

2013-04-08 Thread BlueShadow
the new version 2.4.6 fixed it thanks guys On Saturday, March 30, 2013 1:28:32 PM UTC+1, BlueShadow wrote: /admin/edit/MyApp/views/default/index.html?id=views__default__index__html this URL gives me a 404 error. the file is on my server and I can edit them with vim for example. All other

[web2py] Re: spoiler (show hidden content without reloading the page)

2013-04-08 Thread BlueShadow
I did something similar to the code Niphlod suggested. thanks for the ideas -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to

[web2py] Re: /admin/design/MyApp very slow over 12 seconds

2013-04-08 Thread BlueShadow
the new version 2.4.6 is great it dropped the time to about 2-3 seconds On Monday, April 1, 2013 9:50:32 PM UTC+2, BlueShadow wrote: Thats exactly what I'm saying. main site about 2sec admin/design/MyApp about 12 sec On Monday, April 1, 2013 9:39:00 PM UTC+2, Derek wrote: So you're saying

[web2py] Re: Server-Sent Events

2013-04-08 Thread Arnon Marcus
I think a picture is worth more than a thousand words... ;) Thanks for clearing it out - I get it now. It is still disappointing that the only way to do that is by polling... It's not solving the problem, just moving it around. It's fundamentally (in terms of execution-model), not different

[web2py] Re: Server-Sent Events

2013-04-08 Thread Paolo Caruccio
When I wrote the small app SSE_clock I was searching a replacement for a long polling javascript code that I was using in order to push db's table update notifications to clients. I abandoned the project by lack of browser's support. Anyway, the application is a simple translation from php to

[web2py] Re: representing nested subqueries results in one page (grid)

2013-04-08 Thread Jurgis Pralgauskis
grid and smartgrid are not the best way to achieve what you are trying to do. Well, this is really a tree structure, but grid gives me rough easy way to achieve this :) http://galvosukykla.lt/failai//tmp/nested_tables_grid.png For my app this kind of view is OK for workflow... ***

[web2py] Re: Tree view, Rendering

2013-04-08 Thread Jurgis Pralgauskis
I stumbled upon this post as I am having a bit similar issue but I try to represent stuf with nested-grid (if can call so) https://groups.google.com/forum/?fromgroups=#!topic/web2py/fmyLPCsaoIo maybe You'll have suggestions from your experience (better post in my thread, Thanks : ) 2012 m.

[web2py] Re: Server-Sent Events

2013-04-08 Thread Niphlod
ok, we are getting closer! ^__^ Thanks for clearing it out - I get it now. It is still disappointing that the only way to do that is by polling... It's not solving the problem, just moving it around. It's fundamentally (in terms of execution-model), not different than using long-polling in

[web2py] How to implement PostgreSQL ts_rank function for full text search?

2013-04-08 Thread Lisandro
I've succesfully implemented postgresql fulltext search (or at least a basic implementation). In the model I have: from gluon.dal import SQLCustomType tsv = SQLCustomType(type='text', native='tsvector') db.define_table('anuncios', Field('titulo', 'string'), Field('tsv', tsv)) Then I manually

Re: [web2py] Re: pre populated SQLFORM.FACTORY does not submit because of upload field

2013-04-08 Thread António Ramos
Thank you Massimo for your patience. I change factory to just sqlform and it works even with default values to upload fields. Thank you António 2013/4/8 Massimo Di Pierro massimo.dipie...@gmail.com It took me a while to isolate the problem. Here is a simple code to reproduce it: def

Re: [web2py] running a script without the opening lines

2013-04-08 Thread Ricardo Pedroso
On Mon, Apr 8, 2013 at 7:57 AM, guruyaya guruy...@gmail.com wrote: I have some script I'm running via linux cron, using web2py panel, like so web2py.py -S app -M -R application/app/scripts/myscript.py When It starts, it shows these lines: No handlers could be found for logger web2py web2py

[web2py] Re: calling custom_store and custom_retrieve using parameters

2013-04-08 Thread James Burke
Hi Anthony, I've tried the solution you've posted below: Field('file', 'upload', custom_store=lambda file, filename, path: store_file(file, filename,path , db.table.new_filename), ...) But when my additional parameter gets sent to store_file it sends 'table.new_filename' def

[web2py] Re: Code changes not honored (by web2py?)

2013-04-08 Thread vince
i am running web2py 2.4.6 on apache with mod_wsgi, track_changes seems to always work for the first modify after i restart apache. 2nd changes and so on to the module will not always trigger module reload. On Monday, December 10, 2012 6:55:06 AM UTC+8, Massimo Di Pierro wrote: This has come

[web2py] Re: calling custom_store and custom_retrieve using parameters

2013-04-08 Thread Anthony
The fourth argument passed to store_file() is db.table.new_filename, which is a DAL Field object. Your code is treating it as a string, and table.new_filename is the string representation of a Field object. If you want to include an actual filename string, then that's what you have to pass to

[web2py] Re: calling custom_store and custom_retrieve using parameters

2013-04-08 Thread James Burke
Thanks for your swift response. I kind of understand that, but how do you get the value rather than the field name? db.define_table('file', Field('client', 'reference client'), Field('type', requires=IS_IN_SET(['Clipper','Workbench', 'Terramatch', 'Supply']), default='Workbench'),

[web2py] CSV import design advice

2013-04-08 Thread David
Hello, I am working on an app where leads can be generated from several different sources via CSV files. These sources conatian information that will ultimately end up in the same model. I am looking for some advice on getting the information into the model. Should I: 1 - Write a function for

[web2py] Re: calling custom_store and custom_retrieve using parameters

2013-04-08 Thread James Burke
Came up with a workaround. def store_file(file, filename=None, path=None): try: client_id = int(request.args[2]) client_dir = db(db.client.id == client_id).select(db.client. client_dir_name).first().client_dir_name except: client_dir = 'Default' path = applications/init/uploads/%s %

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Rahul
def bug_new_tickets_created(): db.issues.id.readable=False query = db((db.issues.date_today=('now', '-6 days')) (db.issues.workspace==user_workspace)).select() fields = (db.issues.ticket_no, db.issues.description,) headers = {'issues.ticket_no': 'Ticket #' ,

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Rahul
Hi Massimo, Here is the code I used for SQLForm.grid(). Also db.executesql() does not work with SQLForm.gird I guess due to some data incompatibilites... def new_tickets_created(): db.issues.id.readable=False query = db((db.issues.date_today = sevendays)

[web2py] Re: How to - using DAL for Between

2013-04-08 Thread Annet
Hi Rahul, Of course, you could omit the db.issues.date_today = request.now if you know for a fact there are no time travelers opening tickets in the future. :-) What Derek means, if db.issues.date_today is the date the issues was created, than you can leave db.issues.date_today = today out,