[web2py] Re: boolean field type in a query.

2014-03-26 Thread Avi A
I tried to add NULL to the query, if that what you meant, but it says that NULL is undefined. On Wednesday, March 26, 2014 11:43:11 PM UTC+2, Niphlod wrote: > > Maybe (but just maybe) you need to fetch ALSO records that have a > f_test_is_a_clone that is NULL ? > > On Wednesday, March 26, 2014 9

[web2py] Re: auth.requires_login()(lambda: None)() indirect loop in default controller

2014-03-26 Thread 黄祥
it works well now, thank you so much, anthony. 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 (Report Issues) --- You received this message because you

[web2py] Re: Remove query db field

2014-03-26 Thread xgp . latino
Mandar, I use DAL to make a select to my db. I get field name's as titles and then content of select. variable = db(db.hcregistros.id=="1").select('hcregistros.noid','hcregistros.fecha','hcregistros.registro') *hcregistros.noid hc*cregistros.fecha hcregistros.reg

[web2py] Re: auth.requires_login()(lambda: None)() indirect loop in default controller

2014-03-26 Thread Anthony
Assuming the user() function is in the default controller, you can't require login to get to that function because that's the function used for login. Instead, you could do something like: if request.function != 'user': auth.requires_login()(lambda: None)() That will skip the login requirem

[web2py] Re: Finnish language translator

2014-03-26 Thread Dave S
On Wednesday, March 26, 2014 1:01:20 PM UTC-7, Niphlod wrote: > > consult a finnish friend to make a fi.py translation file :D > If there's a shortage here, I have penpals in a couple of usenet forums that are speakers of both English and Finnish, and might take on small jobs. Though that's a

[web2py] Re: displaying count and groupby

2014-03-26 Thread Dave S
On Wednesday, March 26, 2014 12:58:36 PM UTC-7, Niphlod wrote: > > assuming. > > count = db.table.id.count() > groupby = db.table.birthday.month() > > #you can do > > rows = db(db.table.id >0).select(count, groupby, groupby=groupby) > for row in rows: > print row[count], row[groupby] > >

Re: [web2py] Re: I'd like to know what is a suitable tool to generate document templates.

2014-03-26 Thread Omar Gutiérrez
Limedrop, > If your customer is happy using MS Word why force them to change? Word > files are just zipped up xml that can be manipulated using tools such as > lxml.etree. We let our customers upload Word templates that we then > populate with data and return to them as docx. That way they can

Re: [web2py] Free web2py hosting for a free software web2py application

2014-03-26 Thread pang
I've managed to make karakolas work on pythonanywhere without any loss in functionality. I just had to install a latex package locally. It's an interesting service, it really has batteries included. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/w

[web2py] Re: SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread Niphlod
grid can take also a query --> can fetch records from multiple tables --> we need to know what table the field comes from On Wednesday, March 26, 2014 9:21:17 PM UTC+1, David Simmons wrote: > > thanks Anthony - that worked. >>> >> > Do you know why SQLFORM fields takes a string whilst SQLFORM.gr

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Niphlod
Maybe (but just maybe) you need to fetch ALSO records that have a f_test_is_a_clone that is NULL ? On Wednesday, March 26, 2014 9:28:16 PM UTC+1, Avi A wrote: > > Now I use: > my_tests_list = db((db.t_tests.created_by == auth.user.id) & > (db.t_tests.f_test_is_a_clone > == False) ).select() > >

[web2py] auth.requires_login()(lambda: None)() indirect loop in default controller

2014-03-26 Thread 黄祥
hi, i have auth.requires_login()(lambda: None)() in default controller and it return indirect loop. is it possible to use auth.requires_login()(lambda: None)() in default controller? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-26 Thread backseat
I have slightly more information now. Once the SQLFORM.grid 'Add' form is displayed, typing in the 'name' form does not call the echo() function. This seems like a bug to me. The echo() function is called as expected when the grid is shown, but not when the Add form is shown - but there is some

Re: [web2py] Re: I'd like to know what is a suitable tool to generate document templates.

2014-03-26 Thread Limedrop
If your customer is happy using MS Word why force them to change? Word files are just zipped up xml that can be manipulated using tools such as lxml.etree. We let our customers upload Word templates that we then populate with data and return to them as docx. That way they can use Word to app

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Avi A
Now I use: my_tests_list = db((db.t_tests.created_by == auth.user.id) & (db.t_tests.f_test_is_a_clone == False) ).select() and the list is still emply. SELECT t_tests.id, t_tests.f_test_name, t_tests.f_test_project, t_tests. f_test_platform, t_tests.f_test_device, t_tests.f_test_milestone, t

[web2py] Re: SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread David Simmons
> > thanks Anthony - that worked. >> > Do you know why SQLFORM fields takes a string whilst SQLFORM.grid takes the actual db.table.field? cheers Dave -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: Finnish language translator

2014-03-26 Thread Niphlod
consult a finnish friend to make a fi.py translation file :D On Wednesday, March 26, 2014 8:20:43 AM UTC+1, at wrote: > > Hi, > > I am working on a web-application which needs to be translated to finnish > language and there are no translator available for *finnish* in web2py > languages folder.

Re: [web2py] Re: janrain and web2py

2014-03-26 Thread Niphlod
it's been sitting on issues and roadmap for quite a while On Tuesday, March 25, 2014 10:27:19 PM UTC+1, Michele Comitini wrote: > > Quint has done all the hard work for web2py: > > https://code.google.com/p/w2p-social-auth/ > > > 2014-03-25 22:24 GMT+01:00 Michele Comitini > >: > > > I

[web2py] Re: Use function when select with DAL?

2014-03-26 Thread Niphlod
use executesql(), it's the only way to do it. On Wednesday, March 26, 2014 9:11:22 AM UTC+1, DucVa wrote: > > Hi all, > I want to use function when select (or in clause 'where') with DAL. Like > following: > > select convert(nvarchar(10), invoice_no_from) > from invoice_no_management > where conv

[web2py] Re: displaying count and groupby

2014-03-26 Thread Niphlod
assuming. count = db.table.id.count() groupby = db.table.birthday.month() #you can do rows = db(db.table.id >0).select(count, groupby, groupby=groupby) for row in rows: print row[count], row[groupby] i.e. the variables (count, groupby) you set are automatically "translated" to the "u

[web2py] Re: SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread Anthony
Try fields=[db.timeline.tl_start]. Anthony On Wednesday, March 26, 2014 3:07:16 PM UTC-4, David Simmons wrote: > Hi > > I have the following method: > > def add_event(): > form = SQLFORM.grid(db.timeline, > fields = ['tl_start'] ) > return dict(form=form) > >

[web2py] SQLFORM error - object has no attribute 'tablename'

2014-03-26 Thread David Simmons
Hi I have the following method: def add_event(): form = SQLFORM.grid(db.timeline, fields = ['tl_start'] ) return dict(form=form) my view has {{= form }} but I get the following error when trying to view the page: 'str' object has no attribute 'tablename'

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Avi A
Thanks you all and for the debugging tip. :) On Wednesday, March 26, 2014 7:57:28 PM UTC+2, Anthony wrote: > > In DAL queries, you must use &, |, ==, and ~ rather than "and", "or", > "is", and "not". This is because in Python, the former operators can be > overloaded (in the case of the DAL, via

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Anthony
In DAL queries, you must use &, |, ==, and ~ rather than "and", "or", "is", and "not". This is because in Python, the former operators can be overloaded (in the case of the DAL, via the Expression class) but the latter cannot. Anthony On Tuesday, March 25, 2014 8:08:40 PM UTC-4, Avi A wrote:

Re: [web2py] Re: I'd like to know what is a suitable tool to generate document templates.

2014-03-26 Thread Omar Gutiérrez
Thanks for the answer Massimo, We discarded MS Word to HTML conversion because we have problems with the code generated (we have a kind of preview in HTML) Thanks to mention Reportlab, we are using xhtml2pdf Pisa tool. Cheers On Wed, Mar 26, 2014 at 10:55 AM, Massimo Di Pierro < massimo.dipie.

Re: [web2py] Remove query db field

2014-03-26 Thread Mandar Vaze
In your original email you did mention smartgrid It is not clear when you say "simple db select query" Are you using select query on the commandline of the DB ? Or is it a DAL query ? If it is DAL query - headers are not returned/shouldn't matter -Mandar On Wednesday, March 26, 2014 7:57:11 PM

[web2py] Re: boolean field type in a query.

2014-03-26 Thread Mandar Vaze
You should try .. & (db.t_tests.f_test_is_a_clone == False) that is how built-in is_active boolean works. For additional debugging learning - try printing db._lastsql after your query. It will show you "raw" query - It helps narrow down the problem -Mandar On Wednesday, March 26, 2014 5:38:4

[web2py] Re: uploadfolder default value (web2py version 2.9.4)

2014-03-26 Thread Mandar Vaze
I think this might be a false alarm on my part. In another project I used mysql - where ( I assume) self._adapter.folder is set - so default value is assigned within DAL code. My current project uses mongoDB - hence it is possible that for mongoDB adapter doesn't set the .folder value - hence the

[web2py] Re: I'd like to know what is a suitable tool to generate document templates.

2014-03-26 Thread Massimo Di Pierro
MS Word documents can be easily be converted to HTML because Word can export to HTML. The resulting HTML is terrible and not humanly readable, but works. If you use markmin notice in web2py there is a gluon.contrib.markmin.markmin2pdf which is designed to generate documents. markmin is more pow

[web2py] I'd like to know what is a suitable tool to generate document templates.

2014-03-26 Thread Omar Meat Boy Gutiérrez
Hi everyone, I'd like to discuss with you about your experience with document templates. *I have the next problem:* a) A customer want to generate different kinds of documents. He creates the `templates` using programs like Word. b) I receive the document and I need to convert it to HTML.

Re: [web2py] Remove query db field

2014-03-26 Thread xgp . latino
Johann, I never said i was using smartgrid, i use a simple db select query. Bests. El miércoles, 26 de marzo de 2014 05:22:29 UTC-5, Johann Spies escribió: > > On 26 March 2014 06:30, > wrote: > >> >> As mostly may know, when doing a select query the result will show a db >> field title for

[web2py] Use function when select with DAL?

2014-03-26 Thread DucVa
Hi all, I want to use function when select (or in clause 'where') with DAL. Like following: select convert(nvarchar(10), invoice_no_from) from invoice_no_management where convert(nvarchar(10), invoice_no_from) like '%458%' How must I do it? Best regard! -- Resources: - http://web2py.com - http

[web2py] Integrating Stripe with the gluon/contrib/stripe.py usage and template examples

2014-03-26 Thread Greg Vaughan
So i am trying to implement a stripe payment page and using the examples in the current gluon/contrib/stripe.py I cut and pasted the Template into a page with the default controller to see how it went but it failed first up with a global name not defined error on pk=PUBLISHABLE_KEY_GOES_HERE.

[web2py] uploadfolder default value (web2py version 2.9.4)

2014-03-26 Thread Mandar Vaze
Documentation (http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types) says "uploadfolder defaults to the application's "uploads/" folder." Yet, the code (web2py™ Version 2.9.4-stable+timestamp.2014.03.05.04.44.09) defaults to "None" resulting into follow

Re: [web2py] Re: Password feild type seems to save in plain text for me.

2014-03-26 Thread Marin Pranjić
This is how auth_user.password is defined internally: https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1753 is_crypted = CRYPT(key=settings.hmac_key, min_length=settings. password_min_length) Field(passfield, 'password', length=512,readable=False, label=self.messages. label_password,

[web2py] Re: Password feild type seems to save in plain text for me.

2014-03-26 Thread Encompass solutions
How do I do this? And is this how it is don't in db.auth_user? Cause it's rather confusing that it doesn't do this automatically. BR, Jason Brower On Sunday, March 23, 2014 2:24:24 PM UTC+2, Anthony wrote: > > By default, I think password fields only get an IS_LENGTH validator, so > you'll have

Re: [web2py] Remove query db field

2014-03-26 Thread Johann Spies
On 26 March 2014 06:30, wrote: > > As mostly may know, when doing a select query the result will show a db > field title for each column. > > How do i remove or change this db field title for some nice header as use > with smartgrid.? > Search the web2py book for 'headers=' and see in "Forms an

[web2py] Re: manage extra custom field with ldap_auth

2014-03-26 Thread maurizio
ldap_auth() got an unexpected keyword argument 'user_employeeid_attrib' Il giorno lunedì 24 marzo 2014 12:24:03 UTC+1, maurizio ha scritto: > > Hi all, > i try to manage extra custom field from ldap via ldap_auth user attribute: > but I can't figure out how to manage it... > any idea? > > code snip

[web2py] Re: displaying count and groupby

2014-03-26 Thread Dave S
On Wednesday, March 26, 2014 1:08:04 AM UTC-7, Dave S wrote: (sorry about the formatting. GG was trying to out-wit me, and its success shows how easy that is to do.) > After browsing the sqlite docs, I figured out to count my bithdays per > month > for the table corresponding to the model >

[web2py] displaying count and groupby

2014-03-26 Thread Dave S
After browsing the sqlite docs, I figured out to count my bithdays per month for the table corresponding to the model db.define_table( 'person', Field('surname','string', length=25), Field('birthdate', 'date')) Then I found Niphlod's post that gave the DAL-ese I needed at

[web2py] Using routes and a subdomain for the ultimate in routing power!

2014-03-26 Thread Jason Brower
I currently have this.. routers = dict( BASE = dict(default_application='melodigram'), ) But is it possible to just use the subdomains here? subdomain = request.env.http_host.split('.')[0] if subdomain = "testing": routers = dict( BASE = dict(default_application='testing'), ) else

[web2py] Finnish language translator

2014-03-26 Thread at
Hi, I am working on a web-application which needs to be translated to finnish language and there are no translator available for *finnish* in web2py languages folder. Can someone suggest what to do now? Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http: