[web2py] Re: How to identify the active .table files

2013-08-18 Thread at
Thank you Niphlod. If connection string is same, can we generate .table files in one server and then use them in other server? Actually we've two web2py servers (active & pasive) pointing to single database server and we need to sync the database folder on both servers when db model is modifie

[web2py] Re: Date search on sqlform.grid not working

2013-08-18 Thread Massimo Di Pierro
Good point. The search is performed in the database format which is ISO (Y/m/d). The grid is not smart enough to apply local settings (custom data formats) to the search field. You may want to open a ticket about this and we'll see what we can do. On Saturday, 17 August 2013 12:43:23 UTC-5, Leo

[web2py] Re: urlify - no char mapping

2013-08-18 Thread Massimo Di Pierro
Look ate the source code of urlify: https://github.com/web2py/web2py/blob/master/gluon/validators.py#L2525 If you can suggest improvements I will happy to include them. I guess the problem is here: https://github.com/web2py/web2py/blob/master/gluon/validators.py#L2534 Massimo On Friday, 16 Aug

[web2py] Re: Send and save as draft email forms

2013-08-18 Thread Massimo Di Pierro
Why should web2py include mail storage? It looks more like an app to me than a core feature. On Saturday, 17 August 2013 07:54:37 UTC-5, Alan Etkin wrote: > > I have opened an issue requesting the mail storage feature. > > https://groups.google.com/d/msg/web2py/WrFGJhGI8ds/q8SvGEuZwZUJ > -- --

[web2py] Re: MOD_WSGI and web2py doesn't allow url below root

2013-08-18 Thread Massimo Di Pierro
I would use Apache. Mostly because it is a little faster. On Saturday, 17 August 2013 16:48:38 UTC-5, jonten wrote: > > Hi Massimo, > > I am just curious to know if it is better to modify BASE in routes.py than > using the config below in Apache vhost config instead of WSGIScriptAlias? > Or if

[web2py] Re: MOD_WSGI and web2py doesn't allow url below root

2013-08-18 Thread Massimo Di Pierro
P.S. Also I would make a distinction on whether the mapping is done to remove a BASE (use apache) for aesthetic reasons (also use Apache) or for functional reasons (use routes.py). By functional reasons I man that the app would break without the mapping. If the app would break than the mapping

[web2py] Re: db.mytable.myfield.contains() gives an error Query Not Supported: parser stack overflow

2013-08-18 Thread Massimo Di Pierro
I think by this: x = ['a', 'b', 'c', ...] queries.append(db.mytable.myfield.contains(x)) you mean: x = ['a', 'b', 'c', ...] queries.append(db.mytable.myfield.belongs(x)) You cannot pass a list to contains. That may part of the problem. there may be other problems. Can you show more code or expl

[web2py] Unexpected redirect to login?_next

2013-08-18 Thread Annet
I have a custom registration process. Registration forms are stored in the database, and retrieved in a function called cmsadmin/register http://127.0.0.1:8000/mock/cmsadmin/register This functions lists the registrations forms and a link to the individual form. http://127.0.0.1:8000/mock/c

[web2py] Re: urlify - no char mapping

2013-08-18 Thread Niphlod
indeed, "our" urlify doesn't work with "ideograms" (sorry, I'm totally no expert in oriental languages). The original posted solution takes care of "translating" 派森是好物 to pai-sen-shi-hao-wu we can add the feature looking at other similar projects, but we need someone that has a solid knowledg

[web2py] Re: How to identify the active .table files

2013-08-18 Thread Niphlod
> > > If connection string is same, can we generate .table files in one server > and then use them in other server? > > of course > Actually we've two web2py servers (active & pasive) pointing to single > database server and we need to sync the database folder on both servers > when db model

[web2py] Re: urlify - no char mapping

2013-08-18 Thread lesssugar
Docs site specifies *IS_SLUG.urlify.__dict__ *and *IS_SLUG.urlify.func_dict. *However, I'm not sure how to work with dictionary here. Can I e.g. do something like this: IS_SLUG.urlify(string_to_convert, mapping_dictionary) and simply tell the function which set of key-value pairs it should use?

Re: [web2py] Re: sharing my d3.js experiments with web2py community

2013-08-18 Thread David Lypka
OK I ran your updated samples. Many thanks - I will try to use some of these techniques. On Sat, Aug 17, 2013 at 10:41 PM, greaneym wrote: > > Dave, > > I put an updated set of d3.js examples on my github page. Try > the web2py-1.app.d3anim.w2p which contains more examples, including > "overl

Re: [web2py] Re: Load content from a text file

2013-08-18 Thread Jim Gregory
I'm not an expert in web2py, but this one approach I think should work for your application. If others have better ways of doing it, please share them: def readfile(): ''' returns the file to be read ''' response.view = '/path/to/file_to_be_read.txt' return locals() def write

[web2py] Re: urlify - no char mapping

2013-08-18 Thread Niphlod
ATM there are no dict mappings available for the function included in web2py. You can use the function directly with IS_SLUG()('whatever_string') in which case you have a tuple returned with (result, error) or directly with IS_SLUG().urlify('whatever_string') which returns only the result as a

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread step
Indeed. While I was waiting for replies I realized my question (and thinking) was somewhat flawed. What I want to achieve is an SQLFORM.factory of two tables, t1 and t2, where t2 is placed after t1.this_field instead of after t1.last_field, visually (all s) t1.field ... t1.this_field t2.field ..

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread Niphlod
I think you'd have to rethink the whole process. SQLFORM.factory will work only if the "original" fields are the same then the "posted" ones. If you're planning to switch tables in the meantime, the form.process() will likely NOT work the way you'd expect. If you don't want to code your html fo

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread step
Brilliantly simple, I should have thought of it. Meanwhile I coded a jQuery version and it's simple indeed, but your solution is better. Thanks. On Sunday, August 18, 2013 3:01:17 PM UTC+2, Niphlod wrote: > > I think you'd have to rethink the whole process. SQLFORM.factory will work > only if th

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread step
I'm having trouble finding the right fields= format for SQLFORM.factory. When fields= is a list of gluon field objects, SQLFORM.factory bails out with 'Field' object has no attribute 'find' File "E:\web2py-trunk\web2py\gluon\sqlhtml.py", line 1001, in __init__ if fieldname.find('.') >= 0:

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread step
My bad, your answer works perfectly (tested). I hadn't noticed HOW you specify fields in the signature, **fields* instead of fields= On Sunday, August 18, 2013 5:33:46 PM UTC+2, step wrote: > > I'm having trouble finding the right fields= format for SQLFORM.factory. > When fields= is a list of gl

[web2py] Re: db.mytable.myfield.contains() gives an error Query Not Supported: parser stack overflow

2013-08-18 Thread dave
you can pass a list, http://www.web2py.com/book/default/chapter/06#like,-regexp,-startswith,-contains,-upper,-lower It works fine for a small list, but when you get past a certain number maybe a 100 or a 1000, it gives an error, same thing with belongs. I think the nesting with the parenthesis b

[web2py] Re: making true copy of HTML helpers

2013-08-18 Thread Niphlod
Indeed...SQLFORM.factory() doesn't take any named arguments: def factory(*fields, **attributes): On Sunday, August 18, 2013 5:41:32 PM UTC+2, step wrote: > > My bad, your answer works perfectly (tested). I hadn't noticed HOW you > specify fields in the signature, **fields* instead of fields= >

[web2py] Re: How to identify the active .table files

2013-08-18 Thread at
Thank you for detailed explaination. Sorry I couldn't understand that how can we live with a blank databases folder? Suppose server1 is active and it has filled databases folder, and server2 is passive with empty databases folder. Both are pointing to same database which is on server3. My und

Re: [web2py] Re: How to identify the active .table files

2013-08-18 Thread Jonathan Lundell
On 18 Aug 2013, at 10:48 AM, at wrote: > Thank you for detailed explaination. > > Sorry I couldn't understand that how can we live with a blank databases > folder? > > Suppose server1 is active and it has filled databases folder, and server2 is > passive with empty databases folder. Both are

Re: [web2py] Re: How to identify the active .table files

2013-08-18 Thread at
IC, I was not aware of that. I thought application can't be run without having a filled databases folder. So with empty folder, do we have to explicitly define *migrate=False*? and by default migrate=True? Thanks, On Sunday, 18 August 2013 22:54:45 UTC+5, Jonathan Lundell wrote: > > On 18 Aug

Re: [web2py] Re: How to identify the active .table files

2013-08-18 Thread Anthony
On Sunday, August 18, 2013 2:03:47 PM UTC-4, at wrote: > > IC, I was not aware of that. I thought application can't be run without > having a filled databases folder. So with empty folder, do we have to > explicitly define *migrate=False*? and by default migrate=True? > Yes, by default, migrate

[web2py] {{=customform.custom.widget.delete_record}} is None

2013-08-18 Thread Annet
I have a custom form in which the check to delete checkbox isn't being displayed: {{=customform.custom.widget.delete_record}} What is the correct syntax to get the box displayed? Kind regards, Annet {{if customform:}} {{=customform.custom.widget.contents}}

[web2py] primarykey vs is_not_in_db

2013-08-18 Thread Antonis Konstantinos Tzorvas
http://paste.kde.org/p6938ac83/55437137/ trying to use primarykey=['station_id', 'source'] in db.stations_sources i was always getting the 'no _id error' when trying to apply a "proper" db.data.source.requires=IS_IN_DB(db, 'stations_soruces.station_id', 'stations_sources.source') is there any

[web2py] Re: urlify - no char mapping

2013-08-18 Thread villas
FWIW this mapping helped me once in the past... https://github.com/GoodCloud/django-rewrite/blob/master/libs/slughifi.py -- --- 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, sen

[web2py] Re: sharing my d3.js experiments with web2py community

2013-08-18 Thread PRACHI VAKHARIA
Thank you for sharing this, dear Margaret. After going through it, I will write to you if I have any questions or doubts. — Prachi -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails

[web2py] Re: Send and save as draft email forms

2013-08-18 Thread PRACHI VAKHARIA
*On Sunday, August 18, 2013 4:01:26 AM UTC-4, Massimo Di Pierro wrote:* > > *Why should web2py include mail storage? It looks more like an app to me > than a core feature.* > Dear Massimo, That is a great question, and let me try to make a case for that. Currently w2p provides DAL abstraction

[web2py] "Automatic" validators being set for tables

2013-08-18 Thread Joe Barnhart
I'm having problems with some automatic validators being set on my tables. I have fields which are optional, they are NOT set as "notnull=True" and I did not provide anyvalidator -- but I DID set a length for the field, as is good practice for most databases. It appears those fields are being

[web2py] Re: MOD_WSGI and web2py doesn't allow url below root

2013-08-18 Thread jonten
Thank you for the answer and the detailed explanation :) On Sunday, August 18, 2013 10:04:23 AM UTC+2, Massimo Di Pierro wrote: > > P.S. Also I would make a distinction on whether the mapping is done to > remove a BASE (use apache) for aesthetic reasons (also use Apache) or for > functional reas

Re: [web2py] urlify - no char mapping

2013-08-18 Thread Jonathan Lundell
Another possibility (I haven't tried it): https://pypi.python.org/pypi/Unidecode/0.04.1 -- --- 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...

[web2py] Re: {{=customform.custom.widget.delete_record}} is None

2013-08-18 Thread Niphlod
according to docs http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms it's form.custom.delete On Sunday, August 18, 2013 10:07:32 PM UTC+2, Annet wrote: > > I have a custom form in which the check to delete checkbox isn't being > displayed: > > {{=customform.custom.wi

Re: [web2py] urlify - no char mapping

2013-08-18 Thread Niphlod
i like django-urlify and slughify module structure better ... unicodedecode is yet another module that fiddles heavily with imports (it's 118 files) and I don't see it included in contrib if we're going to include its logic in IS_SLUG()... On Sunday, August 18, 2013 10:56:41 PM UTC+2, Jonathan

[web2py] Two tables, one form -- with a twist

2013-08-18 Thread Joe Barnhart
My form processing skills have been pushed beyond my understanding of web2py. Maybe I'm going about this the wrong way and someone with more chops can steer me along... I have two tables. Table RO is a table of sacrosanct data. It can be used for processing, but must never be changed. Table

Re: [web2py] urlify - no char mapping

2013-08-18 Thread Jonathan Lundell
On 18 Aug 2013, at 2:22 PM, Niphlod wrote: > i like django-urlify and slughify module structure better ... unicodedecode > is yet another module that fiddles heavily with imports (it's 118 files) and > I don't see it included in contrib if we're going to include its logic in > IS_SLUG()... The

[web2py] Re: Two databases with an auth in each

2013-08-18 Thread dave
I just bumped into this situation also, my case is students and employers, when I register employers I want to have "auth.settings.registration_requires_approval = True" and a different profile, but students can just register without requiring approval from admin On Saturday, April 13, 2013 11

[web2py] Re: Two databases with an auth in each

2013-08-18 Thread dave
I just bumped into the same situation, can you tell me which route you took? did you decide to have two applications or the other way? On Saturday, April 13, 2013 10:53:47 AM UTC-7, David Ripplinger wrote: > > Okay, that makes sense. It might not be worth modifying web2py for this > behavior whe

Re: [web2py] diffrence between web2py and django framework...

2013-08-18 Thread António Ramos
Web2py is good for osteoporosis ,you type a lot less! ;) No dia Sábado, 17 de Agosto de 2013, Carlos correiacar...@memoriapersistente.pt escreveu: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Em 16-08-2013 19:09, Udeme Samuel escreveu: > > hello developers please i am new to web2py and

[web2py] plugin_clientapi

2013-08-18 Thread Simon Ashley
Alan, you you have a simple example app, that just goes through the basics. Have looking at it and trying to learn it but have come up against configuration issues/ errors. It would help me out if I could study a simple app, that works, to see where I've gone wrong. TIA -- --- You received t

Re: [web2py] urlify - no char mapping

2013-08-18 Thread Niphlod
On Monday, August 19, 2013 12:14:48 AM UTC+2, Jonathan Lundell wrote: > > On 18 Aug 2013, at 2:22 PM, Niphlod > > wrote: > > i like django-urlify and slughify module structure better ... > unicodedecode is yet another module that fiddles heavily with imports (it's > 118 files) and I don't see

[web2py] Re: Two tables, one form -- with a twist

2013-08-18 Thread Niphlod
Given that you are pretty down the line of deciding what table needs to be "touched", you should just write a wrapper that either inserts a record on work_table and let the users edit it or that it copies the values from the ro_table to the work_table as defaults, and then prepare a "prefilled"

Re: [web2py] urlify - no char mapping

2013-08-18 Thread Jonathan Lundell
On 18 Aug 2013, at 5:56 PM, Niphlod wrote: > On Monday, August 19, 2013 12:14:48 AM UTC+2, Jonathan Lundell wrote: > On 18 Aug 2013, at 2:22 PM, Niphlod wrote: >> i like django-urlify and slughify module structure better ... unicodedecode >> is yet another module that fiddles heavily with import

[web2py] Re: primarykey vs is_not_in_db

2013-08-18 Thread Massimo Di Pierro
Please open a ticket about this. On Sunday, 18 August 2013 15:11:45 UTC-5, Antonis Konstantinos Tzorvas wrote: > > http://paste.kde.org/p6938ac83/55437137/ > > trying to use primarykey=['station_id', 'source'] in db.stations_sources i > was always getting the 'no _id error' when trying to apply

[web2py] Re: Send and save as draft email forms

2013-08-18 Thread Massimo Di Pierro
I am convinced. Thanks Prachi. I believe Alan is on the case. On Sunday, 18 August 2013 15:32:13 UTC-5, PRACHI VAKHARIA wrote: > > > > *On Sunday, August 18, 2013 4:01:26 AM UTC-4, Massimo Di Pierro wrote:* >> >> *Why should web2py include mail storage? It looks more like an app to me >> than a c

[web2py] Re: "Automatic" validators being set for tables

2013-08-18 Thread Massimo Di Pierro
Can you post some code so we can reproduce it? This should not be happening. In fact the first line of the IS_LENGTH.__call__ validators check for value == None and assumes length == 0 On Sunday, 18 August 2013 15:42:31 UTC-5, Joe Barnhart wrote: > > I'm having problems with some automatic vali

[web2py] Re: Two tables, one form -- with a twist

2013-08-18 Thread Anthony
Also, as a general note, the automatic form names will be different for create vs. update forms, but you can control that by specifying your own form name via the "formname" argument to accepts/validate/process. Anthony On Sunday, August 18, 2013 6:06:20 PM UTC-7, Niphlod wrote: > > Given that

[web2py] Re: diffrence between web2py and django framework...

2013-08-18 Thread Anthony
Have a look at this: http://www.quora.com/What-are-the-advantages-of-web2py-over-Django On Friday, August 16, 2013 11:09:57 AM UTC-7, Udeme Samuel wrote: > > hello developers please i am new to web2py and django but i want to know > what is the diffrence between the two of them and which of the

[web2py] Re: Two tables, one form -- with a twist

2013-08-18 Thread Joe Barnhart
Ah. That explains one mystery. I knew about setting the formname in the SQLFORM call, but I had not noticed I needed to pass it in the "validate" method as well. I think perhaps Niphlod is right in that I should look towards SQLFORM.factory since this seems to be trending away from the averag

[web2py] Re: "Automatic" validators being set for tables

2013-08-18 Thread Joe Barnhart
Hi Massimo -- I think it has to do more with my abuse and misuse of SQLFORM in this case. I think I'm trying to push it a little beyond its intended use model. Niphlod and Anthony have been tutoring me on some approaches. We have an awesome community growing up around web2py and these two ar

Re: [web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-08-18 Thread Alex Glaros
Anthony has created a working example. That and his analysis is listed below: Massimo's solution will work if the query involves only the TaxonomyDetail table, but your grid involves a join, so it is necessary to include the tablename (i.e., record.TaxonomyDetail.objectID). But then that will

Re: [web2py] Re: How to identify the active .table files

2013-08-18 Thread at
quite interesting and useful knowledge for me. thanks a lot. On Sunday, 18 August 2013 23:11:45 UTC+5, Anthony wrote: > > On Sunday, August 18, 2013 2:03:47 PM UTC-4, at wrote: > >> >> IC, I was not aware of that. I thought application can't be run without >> having a filled databases folder. So

Re: [web2py] diffrence between web2py and django framework...

2013-08-18 Thread Emilius Omeen
deference between web2py - full-stack framework & django - non full-stack framework, but high-level Python Web framework (and nobody knows what it means high-level :-) who call high-level ? where low -level framework ? -- --- You received this message because you are subscribed to the Go

Re: [web2py] Re: How to identify the active .table files

2013-08-18 Thread Annet
Reading this raised a view questions: Yes, by default, migrate=True. To turn off migrations for an entire DAL > connection, do: > > db = DAL(..., migrate_enabled=False) > > So it is possible to have one application that just contains the model and another application that contains the model with