[web2py] Re: web2py admin app

2017-04-14 Thread Michael Beller
Yes - you can store sessions in a database rather than the filesystem or cookies. Here is some info: http://www.web2py.com/books/default/chapter/29/04/the-core#session On Wednesday, April 12, 2017 at 6:37:40 AM UTC-7, James Holstead wrote: > > I was testing clustering in our test environment

[web2py] Re: CKEditor CDN

2017-04-14 Thread Michael Beller
I created a custom css file and limited the tags available in the example I posted, you can remove those arguments and you'll get the ckeditor defaults. If you're using SQLFORM then the text field is updated automatically along with any other form field - there's no special processing you have

[web2py] Re: CKEditor CDN

2017-04-14 Thread Michael Beller
I add this to my base template: // Replace the textarea with a CKEditor instance (replace 'content_body' with the id of your textarea) CKEDITOR.replace('content_body', { height: 500, contentsCss: '{{=URL('static','css/contract.css')}}', format_tags: 'p;h1;h2;h3;h4;div', });

[web2py] Re: Making application looks better.

2017-04-14 Thread Michael Beller
I created my own scaffold app based on the AdminLTE layout, similar to what António did in terms of layout but replaced the Welcome app. I use this for each new app instead of the Welcome app as my base app: https://github.com/mjbeller/web2py-starter On Thursday, April 13, 2017 at 3:38:52

[web2py] Re: custom forms

2016-11-08 Thread Michael Beller
The online web2py book is a great place to start: http://web2py.com/book Web2py will "automatically" generate a form (with dropdowns, radio buttons, etc.) and the form field validation based on the database model (along with the create, read, and edit forms). The forms chapter I think provides

[web2py] Re: Push Notifications

2016-11-08 Thread Michael Beller
I've been thinking about trying https://pusher.com/ On Wednesday, November 2, 2016 at 6:32:54 PM UTC-4, David wrote: > > Hello, > > My website allows users to send messages to one another; however, the only > way to see their new messages is to refresh the page. Is there any way to > notify

[web2py] Re: Bootstrap datepicker plugin

2016-07-10 Thread Michael Beller
I'm using bootstrap-datepicker.js also with these changes, not sure it's as robust but works and I use it for multiple date formats such as this: Field('origination_date', 'date', widget=datepicker_widget(format='mm/', min_view_mode='months' ), requires=IS_DATE('%m/%Y')), #

[web2py] Re: save the original value of one field in another field

2016-07-10 Thread Michael Beller
For n2, you could try only updating if n2 was not empty. This is not tested but something like ... Field('n2', 'integer', compute=lambda r: r.start_number if not r.n2 else None) On Sunday, July 10, 2016 at 4:38:33 PM UTC-4, ahz...@gmail.com wrote: > > In my application a user enters a

[web2py] Re: jQuery.web2py.component "Synchronous XMLHttpRequest ..." error

2016-06-30 Thread Michael Beller
, 2016 at 1:21:31 AM UTC-4, Michael Beller wrote: > > I'm loading an edit form in a boostrap modal > using jQuery.web2py.component(). > I'm using bootstrap-datepicker.js for my date fields. > The edit form works outside the modal. > > When I load the edit form inside the modal,

[web2py] jQuery.web2py.component "Synchronous XMLHttpRequest ..." error

2016-06-28 Thread Michael Beller
I'm loading an edit form in a boostrap modal using jQuery.web2py.component(). I'm using bootstrap-datepicker.js for my date fields. The edit form works outside the modal. When I load the edit form inside the modal, everything works fine except for the datepicker. When I click on the text field

[web2py] Re: how to debug weasyprint error - failed to load a library: cairo / cairo-2

2016-06-15 Thread Michael Beller
if anybody in the future needs it ... https://www.pythonanywhere.com/forums/topic/4898/#id_post_21876 On Tuesday, June 14, 2016 at 3:57:34 PM UTC-7, Michael Beller wrote: > > I posted this on the pythonanywhere (PAW) forums also but I think it may > be web2py specific (or at least specific t

[web2py] how to debug weasyprint error - failed to load a library: cairo / cairo-2

2016-06-14 Thread Michael Beller
I posted this on the pythonanywhere (PAW) forums also but I think it may be web2py specific (or at least specific to the PAW/web2py combination) ... I'm using weasyprint to generate a PDF. It's working on my local dev environment and my PAW personal account. On a new PAW account it fails on:

[web2py] Re: [SOLVED] Custom form not accepted (formkey missing)

2016-05-08 Thread Michael Beller
Thanks Carlos! I just came across this and your post helped me. On Friday, March 11, 2016 at 5:09:50 AM UTC-8, Carlos Kitu wrote: > > Hi guys, I don't show up here too often because all the issues I find use > to be solved here. Good job. > > Today I was going nuts with one issue, and I would

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-28 Thread Michael Beller
I haven't used yagmail, I only looked quickly but I didn't see an advantage of yagmail over the web2py mail functions. The bootply layout below looks great - I don't see any reason that wouldn't work. Do you want to receive email into the app? I didn't see how yagmail supports inboud email,

Re: [web2py] new Starter app (alternative to Welcome app)

2016-04-27 Thread Michael Beller
gt; > On Monday, April 25, 2016 at 6:27:14 PM UTC-5, Michael Beller wrote: >> >> Yes - thanks. I knew about that bug, just fixed it. The background and >> font were both white. Can you check now? >> >> On Mon, Apr 25, 2016 at 6:07 PM, Ron Chatterjee <ach

Re: [web2py] new Starter app (alternative to Welcome app)

2016-04-25 Thread Michael Beller
t; 2016-03-24 19:51 GMT+00:00 Ron Chatterjee <achatte...@gmail.com>: >>> >>>> Its all good. Just asked. >>>> >>>> >>>> On Thursday, March 24, 2016 at 3:33:00 PM UTC-4, Michael Beller wrote: >>>>> >>>>> N

[web2py] Re: Changing color of field

2016-04-21 Thread Michael Beller
There are a couple of ways to do this. I've found it easier to just add to my models rather than use javascript ... If you have a date field in your model ... Field('deadline', 'date', default=request.now + (week * 4), label=T( 'Deadline')), you can add a represent that generates a span ...

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-21 Thread Michael Beller
gt; About displaying value use default = when you create input field it >>>> should be all what you need... >>>> >>>> About the other problem I don't get it... You should be able to update >>>> a record email/username as long as the new value is

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-21 Thread Michael Beller
value use default = when you create input field it >> should be all what you need... >> >> About the other problem I don't get it... You should be able to update a >> record email/username as long as the new value is unique... >> >> Richard >> >>

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-21 Thread Michael Beller
eb2pyapp.com') > > If someone response to the email, how do I retrieve it? I need to log into > my sandgrid account I am guessing. Not sure why sessage.set_form is my app > name.com > > > > > On Thursday, April 21, 2016 at 2:00:00 PM UTC-4, Michael Beller wrote: >> >>

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-21 Thread Michael Beller
Hi Ron, I'm implementing an 'outlook' like interface for some messaging at the moment which includes two way messages with attachments. The early parts are incorporated in my scaffold app at https://mjbeller.pythonanywhere.com/starter The 'outlook' like interface that you can use is included

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-21 Thread Michael Beller
You can use the sendgrid smtp server or their api. https://sendgrid.com/blog/which-protocol-should-i-use-to-send-email-smtp-or-rest/ Here is my logic for using their api (I also use mailgun with I like also): def send_email_via_sendgrid(email_to, email_subject, email_body): #

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-21 Thread Michael Beller
Apr 20, 2016 at 11:43 PM, Michael Beller <mjbe...@gmail.com > > wrote: > >> Thanks Richard, I should have provided more details. >> >> When I tried to create a form using SQLFORM.factory for two tables >> (including auth_user), I would get an error that the auth_u

[web2py] Re: Not web2py related but want an advice.

2016-04-21 Thread Michael Beller
imho, taking advantage of courses in college to broaden and deepen your understanding of computer science (and areas outside computer science) is very worthwhile. it's hard to predict where your career will lead and what "web development" will be in 5, 10, 15, years and beyond. "web

[web2py] Re: How to ensure each row in the db table having distinct value of a partcular field?

2016-04-20 Thread Michael Beller
unique=True assures the value is unique at the database level but does not add a form validator. In addition to unique=True, you can add a validator like this: db.person.username.requires = IS_NOT_IN_DB(db, 'person.username') from the book:

Re: [web2py] what's the best approach for view and update forms for multiple tables?

2016-04-20 Thread Michael Beller
, April 20, 2016 at 3:58:37 PM UTC-4, Richard wrote: > > Hello Michael, > > I am not sure to understand what you are trying to acheive exactly and > what is causing issue... > > On Wed, Apr 20, 2016 at 2:18 PM, Michael Beller <mjbe...@gmail.com > > wrote: > >&

[web2py] Re: relation "auth_user" already exists

2016-04-20 Thread Michael Beller
It sounds like you need to update the .tables files to match your database and models. I believe you need to set both migrate=True and fake_migrate_all=True for the fake migrate to regenerate the .tables files. Here's the logic in the book:

[web2py] Re: How can I pre populate a option column of a form?

2016-04-20 Thread Michael Beller
before you call SQLFORM, insert: db.pratiche.stato_pratica.default = 'aperta' On Wednesday, April 20, 2016 at 6:05:06 PM UTC-4, Andrea Marin wrote: > > Hi I have this type of form in my model file: > > db.define_table('pratiche', > Field('nome', requires=IS_NOT_EMPTY()), >

[web2py] what's the best approach for view and update forms for multiple tables?

2016-04-20 Thread Michael Beller
The approach in the book for one form for multiple tables works well for create forms: http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables I have not found a good method for view or update forms. I have a model: db.define_table('buyer',

[web2py] Re: Load component in a ?

2016-03-26 Thread Michael Beller
You may be able to use jquery unwrap, wrap, or replace For example, I want to load a component and not generate the wrapping DIV so I added a unique id to the top element in my view.load file and this inline at the bottom: $("#unique-id").unwrap(); I think you may be able to use replace

[web2py] Re: What are the platforms for free web hosting of web2py apps?

2016-03-24 Thread Michael Beller
at I have some > php apps, and the second is that I have many low traffic sites, making the > pythonanywhere plan too expensive. > > Greetings. > > El miércoles, 23 de marzo de 2016, 21:54:47 (UTC-4), Michael Beller > escribió: >> >> +1 for pythonanywhere.com &g

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-24 Thread Michael Beller
avatar field? > > On Thursday, March 24, 2016 at 11:56:27 AM UTC-4, Michael Beller wrote: >> >> The appconfig in 2.13 has a problem with strings separated by comma's in >> the appconfig.ini file. Starter app uses 2.14.1 >> >> You can either install 2.14.1 o

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-24 Thread Michael Beller
ers\classes.py"*, *line 18*, in *__init__ > *return self.*__dict__*.*__init__*(**args*, ***kwargs > *) *TypeError*: *'NoneType' object *is not *iterable > > Using 2.13.4 (which has a flash bar rash that just don't go away). > > > > On Thursday, March 24, 2016

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-24 Thread Michael Beller
m.py and perhaps >>> https://almsaeedstudio.com/themes/AdminLTE/pages/tables/data.html >>> to the new grid.py >>> >>> On Wednesday, March 23, 2016 at 10:22:32 PM UTC-4, Massimo Di Pierro >>> wrote: >>>> >>>> I am linking

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-24 Thread Michael Beller
irect chat. > > On Thursday, March 24, 2016 at 12:23:08 AM UTC-4, Michael Beller wrote: >> >> I plan to! When ready, I'd like to try and apply these styles >> https://almsaeedstudio.com/themes/AdminLTE/pages/forms/general.html >> to the new form.py and perhaps &

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
, Massimo Di Pierro wrote: > > I am linking this from the new examples app. I assume you will be > maintaining it. for a while. :-) > On Wednesday, 23 March 2016 19:38:22 UTC-5, Michael Beller wrote: >> >> Are you using 2.14.1 beta? >> >> I would try to get it r

[web2py] Re: What are the platforms for free web hosting of web2py apps?

2016-03-23 Thread Michael Beller
+1 for pythonanywhere.com based in UK if that meets your non-USA requirement awesome support completely scalable runs on AWS infrastructure (they've essentially built a layer on top of AWS that's make it trivial to manage) On Tuesday, March 22, 2016 at 8:47:12 AM UTC-4, Carlos Cesar Caballero

[web2py] Re: Auth_user add username field

2016-03-23 Thread Michael Beller
hem to be shown on the registration page. Any ideas? > > On Wednesday, March 23, 2016 at 5:43:14 PM UTC-7, Michael Beller wrote: >> >> no changes should be required to any controller or view. Everything is >> handled by the line: >> return dict(form=auth()) >> >> i

[web2py] Re: Auth_user add username field

2016-03-23 Thread Michael Beller
:16:42 PM UTC-4, Jerry Liu wrote: > > Not sure if I understood, you mean I still have to make changes on View > and Controller, right? > because adding this line doesn't change anything on login and registration > views. > > On Wednesday, March 23, 2016 at 4:12:49 PM UTC-7,

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
Are you using 2.14.1 beta? I would try to get it running without changes before making changes (unless you have a need to get it running on an old version of web2py). As Massimo pointed out, it's not necessarily backward compatible but other than removing host_names (which I already did in

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
I changed auth = Auth(db, host_names=myconf.get('host.name')) to auth = Auth(db) for backwards compatibility (I think host_names will be introduced in the upcoming release) That should fix that problem. Are you having another problem? I'm actually having a problem with the old pydal in old

[web2py] Re: Auth_user add username field

2016-03-23 Thread Michael Beller
It's easier than that ... just change username=True in db.py, all the web2py components (e.g., log in form, auth_user table, log in menu, etc.) will now support username ... auth.define_tables(username=True, signature=True) On Wednesday, March 23, 2016 at 5:46:38 PM UTC-4, Jerry Liu wrote: >

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
/db1.py change this response.formstyle = myconf.get('forms.formstyle') to this response.formstyle = 'bootstrap3_inline' that should work in older web2py versions On Wednesday, March 23, 2016 at 2:27:04 PM UTC-4, Ramos wrote: > > 2.12.13 > > 2016-03-23 17:15 GMT+00:00 Michael

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
t;>> [image: Imagem inline 2] >>>> >>>> >>>> >>>> >>>> 2016-03-23 11:41 GMT+00:00 Massimiliano <mbel...@gmail.com>: >>>> >>>>> Just copy >>>>> >>>>> appconfic.ini from welcome/p

Re: [web2py] learning curve?

2016-03-23 Thread Michael Beller
(like attached). Is it something I need to configure in the > app or there are some specific setups? > > Bill. > > On Wednesday, March 23, 2016 at 8:16:23 AM UTC-4, Michael Beller wrote: >> >> Hi Jon, >> >> I just posted my sample app, called Starter, that uses: &g

Re: [web2py] learning curve?

2016-03-23 Thread Michael Beller
Hi Jon, I just posted my sample app, called Starter, that uses: https://almsaeedstudio.com/preview You can read about it here: https://groups.google.com/forum/#!topic/web2py/Md-OTq-hi-U%5B1-25%5D and download it here: https://github.com/mjbeller/web2py-starter On Monday, March 21, 2016 at

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Michael Beller
t;> On Wednesday, March 23, 2016 at 11:19:23 AM UTC+1, Ramos wrote: >>> >>> Nice but i get an error installing it as "starter" application >>> any help ? >>> >>> [image: Imagem inline 1] >>> >>> 2016-03-23 9:40 GMT+00:00 Ma

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-22 Thread Michael Beller
app is capable really? > > Richard > > On Tue, Mar 22, 2016 at 10:17 PM, Michael Beller <mjbe...@gmail.com > > wrote: > >> I created a new 'starter' app for the types of data and process >> management apps I tend to build. >> >> I used https:/

[web2py] new Starter app (alternative to Welcome app)

2016-03-22 Thread Michael Beller
I created a new 'starter' app for the types of data and process management apps I tend to build. I used https://almsaeedstudio.com/preview as the template and I'm hosting a preview at https://mjbeller.pythonanywhere.com/starter. I'd welcome any feedback but also wanted to share the code at

[web2py] PyCharm license for web2py dev - who wants?

2015-10-12 Thread Michael Beller
+1 -- 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 subscribed to the Google Groups "web2py-users" group. To

[web2py] Tags and Tag Class (list:reference or many-to-many)

2015-08-17 Thread Michael Beller
I like this approach but I'm getting an error: type 'exceptions.TypeError' unbound method formatter() must be called with Validator instance as first argument (got list instance instead) Is there a sample app or update with this Tag approach? On Friday, January 17, 2014 at 1:12:00 PM UTC-5,

[web2py] Re: Field validatio with multiple columns

2015-08-13 Thread Michael Beller
I really like the approach crayzeewulf used here: http://stackoverflow.com/questions/9683604/composite-key-in-web2py/9685846#9685846 On Wednesday, August 12, 2015 at 11:17:45 PM UTC-4, JC wrote: Hello, I´ve the following model: db.define_table('bsc_input',

[web2py] Re: error with list:reference table

2015-08-13 Thread Michael Beller
): else: refs = db(id.belongs(value)).select(id) return refs and ', '.join( _fieldformat(self.ref, x) for x in value) or '' I've tried it - works On Thursday, August 13, 2015 at 6:44:45 AM UTC+3, Michael Beller wrote: The error occurs when I use the render

[web2py] Re: error with list:reference table

2015-08-12 Thread Michael Beller
]: print teachers teacher.id,teacher.Name,teacher.schools 1,xxx,|1|2|3| In [9]: print teachers[0].schools [1L, 2L, 3L] On Wednesday, 12 August 2015 07:55:50 UTC-5, Michael Beller wrote: db.define_table( 'school', Field('Name'), format='%(Name)s

[web2py] Re: error with list:reference table

2015-08-12 Thread Michael Beller
, 11 August 2015 23:03:24 UTC-5, Michael Beller wrote: I was using web2py 2.10.4 and encountered the error using list:reference: type 'exceptions.TypeError' isinstance() arg 2 must be a class, type, or tuple of classes and types I then upgraded to 2.12.2 and applied this fix https

[web2py] error with list:reference table

2015-08-11 Thread Michael Beller
I was using web2py 2.10.4 and encountered the error using list:reference: type 'exceptions.TypeError' isinstance() arg 2 must be a class, type, or tuple of classes and types I then upgraded to 2.12.2 and applied this fix

[web2py] Re: Is the server or client processing Python in the controller?

2015-07-07 Thread Michael Beller
The book has a good overview how a web application works: http://www.web2py.com/books/default/chapter/29/01/introduction#Model-View-Controller A browser only processes HTML, CSS, and Javascript. The w2p controller processes a view and generates the html, css, and javascript required to send to

[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Michael Beller
Why do you want to prevent the server from doing the python processing? I don't know what you mean by instead of embedding as JS On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote: I am having trouble finding anything definitive here. Please help if you have any input, even if

[web2py] Re: dynamic query on web2py

2015-06-27 Thread Michael Beller
Could you order by a virtual field where the virtual field is a lambda returning a random number? http://www.web2py.com/books/default/chapter/35/06/the-database-abstraction-layer#New-style-virtual-fields--experimental- On Saturday, June 27, 2015 at 8:28:09 AM UTC-4, 黄祥 wrote: yeah, something

[web2py] Re: bootstrap layout adaption

2015-06-27 Thread Michael Beller
I think it would be fairly straightforward. For any grid you would just pass the data using a rows object to the view and create the required structure in the template. For any form you have a couple of options but if you wanted to use the validators in SQLFORM I think you would set the CSS

Re: [web2py] Re: sending email

2015-06-24 Thread Michael Beller
If you have two factor auth enabled in gmail you need to authorize app and generate unique password -- 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

[web2py] set of rows as input to smart grid

2015-06-24 Thread Michael Beller
You can pass a list of fields using the 'fields' arg of smartgrid -- 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: web2pyslices down

2015-05-09 Thread Michael Beller
In the meantime ... http://web2pyslices.pythonanywhere.com/ -- 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

[web2py] Re: where are Massimo's lesson sources?

2015-02-22 Thread Michael Beller
Not sure which applications you're referring to but many are here: https://github.com/mdipierro/web2py-appliances On Sunday, February 22, 2015 at 3:07:16 AM UTC-8, da...@mail.hebrew.edu wrote: Hi, I'm watching Massimo's lessons, and was wondering if there are sources for the applications he

[web2py] Re: how to use groupby and sum() in query or grid?

2015-02-19 Thread Michael Beller
Thank you but I get the following error with that approach: type 'exceptions.TypeError' list indices must be integers, not Expression However, I did get this to work: t = db.items q = t.id0 usum = t.sales.sum() usum.tablename = 'items' usum.readable = True usum.represent

[web2py] how to use groupby and sum() in query or grid?

2015-02-18 Thread Michael Beller
Given: db.define_table('items', Field('country'), Field('state'), Field(''product'), Field(sales', 'integer') Can you show total sales by country and state? I can groupby in a grid using groupby=db.items.country|db.items.state but I can't find how to include the

[web2py] Re: Best and simpler approach to Inline editing / deleting / appending (jqGrid, Jeditable,etc)

2015-02-09 Thread Michael Beller
I've started using http://www.datatables.net/ primarily for the great search and responsive behavior. I've read about the inline support but haven't tried it yet but it looks very good. The other option that looks very good is http://handsontable.com/ but I've only read through the

[web2py] Re: Create new website off entry in database

2014-10-13 Thread Michael Beller
Massimo created a series of videos for a course he taught that included some really helpful tutorials and examples. In one of the videos, he built a complete app for Surveys - including the ability to build a list of questions, poll for answers, and other features. I think you'll find the

[web2py] Re: Create new website off entry in database

2014-10-13 Thread Michael Beller
Massimo put together a series of 5 videos available on YouTube for a class he taught that are really helpful. In one of the videos, he walked through a tuturial for building a survey app with questions and answers (and other features). You may find it helpful with your app. I watched all 5

[web2py] Re: Total newbie, advice on storing scans

2014-08-21 Thread Michael Beller
Web2py has an 'upload' field type that helps you manage file uploads. Upload is a little bit of a misnomer because you can select the file path to store the file (or an existing path) and the blob is not stored in the database. You can read more here:

Re: [web2py] Re: Strange ajax problem

2014-08-15 Thread Michael Beller
Don't be sorry! Thanks but I don't see any views in the package - I see your two functions at the bottom of the default controller but no corresponding views. Did I miss them? On Fri, Aug 15, 2014 at 8:25 AM, Leonel Câmara leonelcam...@gmail.com wrote: I'm sorry I wasn't testing any of this.

[web2py] Re: Strange ajax problem

2014-08-15 Thread Michael Beller
Perfect - I can't thank you enough! I saw the code in index right after I sent my other message, I was looking for display_page. Not sure what I did wrong last night (probably just a case of staring at code too long) but I see how you added the $.web2py.enableElement. I just went back and

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
and http responses. On Wednesday, August 13, 2014 6:51:59 PM UTC-4, Michael Beller wrote: Thanks ... Niphlod - I'll try to create a minimal app to reproduce. Cliff - are you suggesting to use the web2py ajax function rather the jQuery post? I'm also trying to understand why web2py

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
= something_created_server_side You may have to mess around with the css a bit to get the vertical alignment and height right. This will work around the client side handlers. On Thursday, August 14, 2014 4:20:05 PM UTC-4, Michael Beller wrote: Thanks Cliff and Niphlod, I've used ajax

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Leonel - awesome explanation. I looked through your code that you posted to load forms in modals and handle file uploads - I need to study more. One question - you say below you're using web2py's ajax convenience function which doesn't care about what it's doing - I'm actually not

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Leonel, I tried both options but couldn't get them to work - or at least I haven't found the right combination. I also created a simple ajax form using the example in the book to apply your two recommendations. I could only get it to work with the 'return false' statement but that

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
I just encountered the same problem. I'm using a Bootstrap Modal form and encountering the same problem - the form sends and receives data via AJAX but then adds the 'disabled' class to the button. I found this logic in web2py.js but I'm not clear on what's happening and why: // Form

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
double submission. web2py disables the submit button when you click on it until a proper response is returned. Don't EVER use inline javascript, and don't use web2py.js internal functions without proper knowledge of the inner workings :-P On Wednesday, August 13, 2014 8:52:25 PM UTC+2, Michael

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
Thanks ... Niphlod - I'll try to create a minimal app to reproduce. Cliff - are you suggesting to use the web2py ajax function rather the jQuery post? I'm also trying to understand why web2py is intercepting the event and why it doesn't think the response is succesful which I assume is why

[web2py] How do you display created_by and modified_by names and not id's when using lazy tables?

2014-08-06 Thread Michael Beller
When I set lazy_tables=True in the DAL, all my signatures fields show the user_id and not the user name. I also set db.auth_user._format = '%(last_name)s' which I thought would force the auth_user definition with lazy tables but my signatures still show id's. Any thoughts on what I'm missing?

[web2py] Re: list all users with membership of a group

2014-06-18 Thread Michael Beller
This will give you a list of user id's: db(db.auth_membership.group_id==3).select(db.auth_membership.user_id) This will give you all the user information for each user: db(db.auth_membership.group_id==3).select(db.auth_user.ALL, left=db.auth_membership.on(db.auth_user.id ==

[web2py] Bug with upload widget when using digitally signed URL's?

2014-06-15 Thread Michael Beller
I'm trying to secure file downloads. I use user_signature=True for an action that generates an edit form that includes an upload field. The upload widget generates a download link but the link appends the file name arg after the signature var. I'm using: crud.settings.download_url =

[web2py] Is there a method to force a user to change their password?

2014-06-13 Thread Michael Beller
Also, what is the password reset key used for? I see in some posts information about registration key but not registration identifier - what is the identifier used for? if registration_key=='' : user can login if registration_key=='blocked' : user account is blocked if

[web2py] Re: Is there a method to force a user to change their password?

2014-06-13 Thread Michael Beller
to blocked to prevent the user from logging in. The password_reset_key is the uuid used to identify a user when they ask for a password reset link. the uuid appears in the link and expires when the user resets the password. On Friday, 13 June 2014 09:50:48 UTC-5, Michael Beller wrote: Also

[web2py] Re: Uploading with SQLFORM.factory: specifying tablename component of filename

2014-06-05 Thread Michael Beller
web2py renames the file as a security measure to prevent directory traversal attacks. You can read more about it here ... http://www.web2py.com/books/default/search/29?search=traversal and here ... http://en.wikipedia.org/wiki/Directory_traversal_attack As you point out, web2py stores the new

[web2py] Re: How to update the stored original filename for upload field using smartgrid edit form?

2014-06-04 Thread Michael Beller
. On Monday, June 2, 2014 9:03:32 AM UTC-4, Michael Beller wrote: I'm trying to store the original filename, filetype, and filesize for an upload field using a smartgrid. I can add these fields during the insert (by setting the field defaults) but not update the fields if you update

[web2py] Re: Scheduler

2014-06-04 Thread Michael Beller
You can't use the web2py scheduler but you can create your own simple version. Here is more information from the python anywhere forum: https://www.pythonanywhere.com/forums/topic/179/ Basically you can launch web2py periodically, e.g., once an hour or once per day, and execute a module that

[web2py] Re: user roles

2014-06-03 Thread Michael Beller
:26 PM UTC+2, Michael Beller wrote: If the user is logged in, then auth.user_groups contains a dictionary of the user's roles. You can also use auth.has_membership('role name') to check membership. You can search auth.user_groups for a role, e.g., if any (role in ['customer_service', 'admin

[web2py] Re: user roles

2014-06-03 Thread Michael Beller
in auth.user_groups. itervalues()): On Tuesday, June 3, 2014 9:02:19 AM UTC-4, Michael Beller wrote: confirm that you have a logged in user first On Tuesday, June 3, 2014 3:00:18 AM UTC-4, Yebach wrote: If I use your if statement in my controller, this is the error I get type

[web2py] Re: How to change SQLFORM smartgrid title

2014-06-03 Thread Michael Beller
I believe smartgrid uses the table _plural attribute for the first item in the smarrgrid breadcrumb. If _plural is not set, it uses the table name and a pluralization function to create the name. You can set the attributes in the define table method, e.g., singular=Dog, plural=Dogs You can

Re: [web2py] web2py function import not working well

2014-06-03 Thread Michael Beller
Some of the code in the functions and classes not displayed in your original post may reference web2py globals and environment variables. I think (I'm still learning web2py also) that running your code in the shell then has access to the web2py environment. Modules do not have access

[web2py] How to update the stored original filename for upload field using smartgrid edit form?

2014-06-02 Thread Michael Beller
I'm trying to store the original filename, filetype, and filesize for an upload field using a smartgrid. I can add these fields during the insert (by setting the field defaults) but not update the fields if you update the uploaded file. The edit form does upload the new file but I don't know

[web2py] Re: user roles

2014-06-02 Thread Michael Beller
If the user is logged in, then auth.user_groups contains a dictionary of the user's roles. You can also use auth.has_membership('role name') to check membership. You can search auth.user_groups for a role, e.g., if any (role in ['customer_service', 'admin'] for role in auth.user_groups.

[web2py] best method to check for auth membership (with no DB IO)

2014-05-31 Thread Michael Beller
I've been checking for auth membership to control access to menus and access to controller functions. But they all require significant DB IO ... Decorators: @auth.requires_membership() @auth.requires(lambda: auth.has_membership('customer_service') or auth. has_membership('admin')) #

[web2py] Re: how to determine the server (name) ?

2014-05-30 Thread Michael Beller
Depending on your server and hosting environment, request.env.http_host may always return '127.0.0.1:8000' when you're using the browser based shell (in admin) or running web2py from console. I found it was more reliable to use request.env.web2py_path which always gave a unique path (in the

[web2py] Re: AppAdmin: CSV import bug

2014-05-20 Thread Michael Beller
I'm also using Excel on a Mac and had the same problem. However, if I select Windows Comma Separated (.csv) option rather than the default Comma Separated Values (.csv) in the Save As ... dialog box the import through the appadmin interface works. On Friday, November 22, 2013 5:49:37 AM

[web2py] Re: color cells based on value in SQLFORM

2014-05-12 Thread Michael Beller
| status server | 1 The server cell would be green.Could I do this? On Saturday, May 10, 2014 1:26:51 PM UTC-4, Michael Beller wrote: I learned this method from one of Massimo's lecture video's: At the top of your model file: # function to allow models to set status style def show_status

[web2py] Re: list:reference

2014-05-12 Thread Michael Beller
I haven't used 'list:reference' before, what are the advantages or use cases for your approach rather than add a reference field such as Field('daily', 'reference daily') on the post table? On Monday, May 12, 2014 2:06:01 AM UTC-4, Jesse Ferguson wrote: I FIgured it out, I was missing the

[web2py] Re: best way to load more db tables via ajax

2014-05-12 Thread Michael Beller
The recipe on pagination in the book may provide some ideas: http://web2py.com/books/default/chapter/29/14/other-recipes?search=pagination#Pagination You could then put your list that you're trying to concatenate in an ajax load. On Monday, May 12, 2014 8:49:23 AM UTC-4, Trevor Overman wrote:

[web2py] What is the best method to format datetimes?

2014-05-11 Thread Michael Beller
I'm not sure of all the pros and cons of using the different methods to format a datetime field. A datetime fields gets a default IS_DATETIME validator and uses the calendar widget in forms which uses the language translation files to format the field. You can also specify a format parameter,

  1   2   >