[web2py] Re: How to import 'configuration' into a module

2020-12-08 Thread Andrew Rogers
I found the answer 2 seconds after I posted the question which I did 20 minutes after looking through a lot of pages and code. from gluon.contrib.appconfig import AppConfig from gluon.tools import Auth configuration = AppConfig() On Tuesday, 8 December 2020 at 23:34:30 UTC+10 Andrew

[web2py] How to import 'configuration' into a module

2020-12-08 Thread Andrew Rogers
I want to use the auth functionality in a module. I think I need to do this: auth = Auth(db, host_names=configuration.get('host.names')) Which means I need: from gluon.tools import Auth But how do I import the 'configuration' module? I couldn't find any mention of it here:

[web2py] How to move the location of the checkbox labels in SQLform

2020-11-28 Thread Andrew Rogers
Is there an easy way to reposition the labels for checkboxes? I would like to show them on the left side in the same way as the other controls. I posted to StackOverflow as well.

Re: [web2py] web2py 2.21.1 is OUT

2020-11-28 Thread Andrew Rogers
Yes, thank for web2py. It has been great. Plan to make my next app in py4web and then look at migrating my first one across. On Saturday, 28 November 2020 at 20:18:37 UTC+10 lbjc...@gmail.com wrote: > Thank you for your great product. > Regards > > On Sat, Nov 28, 2020, 07:22 Massimo Di Pierro

[web2py] Re: Problem with wsgihandler.py Apache/Python3

2020-11-06 Thread Andrew Rogers
This still seems like a problem. In my case I had forgotten to create a password after installing web2py on Debian. I assume it was throwing an error on: raise HTTP(200, T('admin disabled because no admin password')) After I created a password this error went away: *Internal Server Error*

[web2py] IS_IN_DB always applies the common_filter even when I ask it not to (FIXED)

2020-10-06 Thread Andrew Rogers
FYI I was trying to disable the common filter on a table that was used in the IS_IN_DB validator. I tried a few options: IS_IN_DB(db, 'Organisation.id', ignore_common_filters=True) and IS_IN_DB(db(db.Organisation.id>=0, ignore_common_filters=True) The former should work for IS_NOT_IN_DB but it

Re: [web2py] Re: Mobile and Tablets detection

2020-10-03 Thread Andrew Rogers
Hi I am having trouble with detecting a mobile user when emulating an iPhone (or any of the mobile devices) in the desktop version of Chrome. Edge seems to work fine. *request.user_agent() * gives me: , 'os': , 'bot': False, 'browser': , 'is_mobile': *False*, 'is_tablet': False}>

Re: [web2py] Re: Reloading modules

2020-08-19 Thread Andrew Rogers
This is an old post. But I had this problem too. 'track_changes' works fine in a brand new project. But i can't get it to work in my now quite large project. Eventually I found something that works. My module is called 'public.py' and it lives where it should - in the

[web2py] Re: Under what circumstances would db.define_table() return None

2020-07-17 Thread Andrew Rogers
define_table('DatabaseModel', Field('TableName')) > > for t in db.tables: > dbmemo.DatabaseModel.update_or_insert(TableName=t) > > > On Wednesday, 15 July 2020 07:45:36 UTC+1, Andrew Rogers wrote: >> >> This code working fine but now it fails because t

[web2py] Under what circumstances would db.define_table() return None

2020-07-15 Thread Andrew Rogers
This code working fine but now it fails because the db.define_table() returns None. table = db.define_table('DatabaseModel', Field('TableName')) # This is not working now for t in db.tables: table.update_or_insert(TableName=t) The only thing that I think I have changed that might have

[web2py] Re: belongs to one table but not the other ...

2020-07-15 Thread Andrew Rogers
Try adding a '~' in front of it. db(~(db.cart.id.belongs(another_table_select))).select(db.cart.id) See: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=lazy#Logical-operators On Wednesday, 15 July 2020 13:12:53 UTC+10, Vlad wrote: > > I have the following

Re: [web2py] My attempt at integrating datatables.net and web2py

2020-07-06 Thread Andrew Rogers
2 July 2020 at 13:51:29 UTC+10 Andrew Rogers wrote: > OK, great. I will tidy and document and bundle something up and upload it > somewhere. Hopefully be available early next week. > > On Thu, 2 Jul 2020, 1:28 am Kevin Keller, wrote: > >> Andrew, I would also love to have a l

[web2py] Re: Is there a way to cache images from "download" function?

2020-06-25 Thread Andrew Rogers
Hi I tried this from the book, but got an error: @cache.action(time_expire=874, cache_model=cache.ram, session=True, vars=True, public=True) So i tried the ideas in this post and they had miscellaneous errors. I thought things have probably changed since 2014. Then i started removing

[web2py] Re: How to debug appadmin CSV uploading

2020-05-01 Thread Andrew Rogers
Can't help you Jon sorry. I tried to upload a while back but got a different issue (see https://groups.google.com/forum/#!topic/web2py/03-7xKAioD8) So maybe that feature has fallen into disuse? On Friday, 1 May 2020 16:57:38 UTC+10, Jonsubs wrote: > > Hi everyone, > I'm trying to upload a

[web2py] Re: The virtual fields are not accessible until I convert my records to a list

2020-05-01 Thread Andrew Rogers
Ugg, I'm a goose. Silly mistake. It works exactly as it should. Sadly i dont. On Saturday, 2 May 2020 00:09:50 UTC+10, Andrew Rogers wrote: > > (I posted this question here as well: > https://stackoverflow.com/questions/61544049/the-virtual-fields-are-not-accessible-until-i-convert-m

[web2py] The virtual fields are not accessible until I convert my records to a list

2020-05-01 Thread Andrew Rogers
(I posted this question here as well: https://stackoverflow.com/questions/61544049/the-virtual-fields-are-not-accessible-until-i-convert-my-records-to-a-list ) The book here gives this example for

[web2py] Re: Visual Studio Code

2020-05-01 Thread Andrew Rogers
Thanks for the reminder re the intellisense. Do you think it still works fine? I tried to out just now and had some issues. But the problem may well be me and not it. On Friday, 1 May 2020 19:55:39 UTC+10, villas wrote: > > Further to Andrew's reply you could also try these ideas: > > >

Re: [web2py] Re: Why would new code be ignored and old code be executed?

2020-05-01 Thread Andrew Rogers
Hi again I am having a similar problem again. I havent compiled the app - i have learnt from that mistake, thanks. I am now trying to import some of my custom functions from other python files in the same app. After i got an __init.py__ file in place i was able to see and use my imported

[web2py] How do I hide automatically generated child columns in web2py's SmartGrid?

2020-04-24 Thread Andrew Rogers
(I also asked this question here https://stackoverflow.com/questions/61402508/how-do-i-hide-child-columns-in-web2pys-smartgrid ) I love the way web2py smartgrid creates automatic child links to referenced tables. But i can't find how to customise them. I want to show only some of the child

[web2py] Re: Why do my questions never show up?

2020-04-21 Thread Andrew Rogers
This one has appeared Jon :) I had the same problem a few months ago. Did you submit via the Google Groups web interface or via email? The ones i have submitted via the groups interface (https://groups.google.com/forum/ ) seemed to go

[web2py] Re: Field('upload') : problem with file name

2020-04-15 Thread Andrew Rogers
>>> Field(name, 'upload', size=200) I think 'size' should be 'length'. The latter worked for me and the former didn't. On Monday, 20 July 2015 16:24:24 UTC+10, Massimo Di Pierro wrote: > This is handled by web2py. The filenames are truncated according to the > size of the uploadfield. This

[web2py] Re: Cool "formstyle" trick w/Python lambda

2020-03-19 Thread Andrew Rogers
Thanks. That helped me too! But i have no idea how it did it. Need to read up on widgets. All i wanted to do was add the "readonly" attribute to a form field. I thought the following would have worked (from the book). Is it intended to add attributes? If you need to add custom attributes to

Re: [web2py] Re: SQLFORM grid process not working

2020-03-06 Thread Andrew Rogers
> > Many thanks to you guys for answering so many user questions. I am finding >> it really helpful. >> > Cheers Andrew -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Why would new code be ignored and old code be executed?

2020-03-06 Thread Andrew Rogers
Thanks for your advice Val. I will try your suggestion... and google search a little to see what it does I dont think i had two servers running but i will look out for that in the future. It seems that the Module i added was the main problem. I moved all the code into the Controller and

[web2py] Re: Image upload error when using smarthumb

2020-03-05 Thread Andrew Rogers
I had trouble with the above code. Perhaps it was because i am using the uploadseparate =true parameter which means images get dropped into different folders. Or perhaps because i don't know what i am doing. Anyhow, the code below works for me. I had to manipulate the thumbnail filename a lot

[web2py] Why would new code be ignored and old code be executed?

2020-03-05 Thread Andrew Rogers
Everything has been good for days. But I have had this happen multiple times in the last few hours. I make changes to a module or controller file, save it, refresh the app but the old code still runs. I was working in both the IDE that comes with web2py and Visual Studio Code. I eventually

[web2py] I think the language code for Malay in the default install of web2py is wrong

2020-03-05 Thread Andrew Rogers
Hi According to https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes and http://www.lingoes.net/en/translator/langcode.htm the language code for Malay is "ms". However in my new web2py install the file name for Malay is "my" (see attached). I understand "my" is for Myanmar... which is where

[web2py] Importing a CSV file from the Database form fails

2020-03-05 Thread Andrew Rogers
Hi I exported a CSV file using the Import/Export > 'export as csv file' button found in the Database interface of web2py. That worked fine. I then modified the exported file slightly - just changed the IDs. I then tried to import the modified file back into the table using the 'import'

[web2py] Re: web2py with js framework

2020-02-19 Thread Andrew Rogers
I've been using Vue for just 30 mins and web2py for not much longer. I just wanted to get something really, really simple working. All i did was added this to index.html. I am sure this is bad practice - just a first step to trying to understand how things fit together. Thanks to Mirek's tip

[web2py] Re: Web2py or py4web for a brand new project

2020-01-14 Thread Andrew Rogers
Hi Is the documentation for web2py still mostly relevant for py4web? Thanks Andrew On Thursday, 12 December 2019 20:47:05 UTC+6:30, icodk wrote: > > Should I use Web2py or py4web for a brand new project ? > What is still missing from py4web ? > Can I debug with pycharm ? > I need all the

[web2py] Re: Web2py or py4web for a brand new project

2020-01-14 Thread Andrew Rogers
Thanks for that info. I am about to start a new project which is also my first. So i would like to go with py4web. But i am nervous about not having good documentation for py4web. Is the old documentation and videos etc that you have made (which are great - thanks) still mostly relevant? On