[web2py] is it possible to do something like SELECT column1, column2 is null FROM table.. in DAL?

2023-06-21 Thread Dragan Matic
Postgresql allows this syntax: SELECT column1, column2 is null FROM table WHERE... Which returns the value from column one and a true/false for column2 like this: column1 column2 value1 true value2 false To summarize, I just want for database to tell me whether column2 i

[web2py] Re: wev2py 2.22.1 is out

2022-02-12 Thread Dragan Matic
Hi Massimo, As already pointed out, when I try to download source code from this addres https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip the dal directory is empty and it breaks web2py. On Tuesday, February 1, 2022 at 4:59:33 AM UTC+1 Massimo Di Pierro wrote: > Hello Every

Re: [web2py] Does oauth2.0 work with python3?

2021-10-09 Thread Dragan Matic
# For Python 3.0 and later >> from urllib.request import urlopen >> except ImportError: >> # Fall back to Python 2's urllib2 >> from urllib2 import urlopen >> >> Best regards, >> Murat. >> >> >> >> >> Dragan Matic , 23 E

[web2py] Can I limit wiki articles visibility only for logged in users.

2019-07-05 Thread Dragan Matic
As the title says, I would like to limit visibility of some built-in wiki articles. Ideally, I would like to have articles that would be visible to everybody and then some of them visible only to logged-in users. Is it possible to have some auth functionality for articles or if not is it possib

[web2py] welcome app - broken menu on 2.17.2

2018-10-11 Thread Dragan Matic
welcome app's menu is broken on both firefox and chromium. This is how it looks on chromium: [image: chromium.png] And this is how it looks on firefox: [image: firefox.png] -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Is there a way to donate money to web2py

2018-01-31 Thread Dragan Matic
It would be nice if web2py had a patreon page or something similar. I see that similar questions have been asked before and I know that there was a 'send bitcoins' link but most of us still pay online with credit cards or paypal. If web2py had a patreon page people could just send a predefined

[web2py] Is there a way to put icon or image picker in form?

2018-01-09 Thread Dragan Matic
I would like to have an icon or image picker in form where user could choose from a set of predefined icons. Form would contain a few other fields like a title, text and an icon that would visually mark the topic of the text. Icons could be either pictures in 'static' folder or in 'uploads' (si

[web2py] How to translate extra fields in auth form?

2017-12-18 Thread Dragan Matic
I've added a few extra fields to auth_user table like this auth.settings.extra_fields['auth_user'] = [ Field('avatar', 'upload'), Field('avg_rating', 'decimal(3, 2)', default=0), Field('receive_notifications', 'boolean', default=True) ] I do not know how to translate them, t

[web2py] Re: SSL database connections

2016-06-27 Thread Dragan Matic
> db = DAL(., driver_args=dict(sslmode="require")) > > should work fine. I do not know of other engines that support it but there > is always a way to tell the driver. > > On Friday, 24 June 2016 05:53:37 UTC-5, Dragan Matic wrote: >> >> Has there been any pro

[web2py] Re: Instructions on how to deploy on Digital Ocean

2016-06-27 Thread Dragan Matic
I don't want to brag or anything similar but I think this covers the same topic with more in-depth explanations. On Sunday, June 26, 2016 at 5:58:01 PM UTC+2, Massimo Di

[web2py] Re: SSL database connections

2016-06-24 Thread Dragan Matic
Has there been any progress in connecting through SSL with DAL? Searching chapter 6 (DAL) of the web2py book for "ssl" or "secure" does not find anything. On Sunday, August 23, 2009 at 6:01:11 PM UTC+2, mdipierro wrote: > > We do not support that but now that I know it should be easy to add.

Re: [web2py] Re: how to create pdf report in web2py???

2016-05-16 Thread Dragan Matic
Here's a simple example, creating a PDF invoice in web2py app: This is the controller code: def show_pdf_invoice(invoice_number, invoice): from fpdf import FPDF pdf = FPDF() pdf.add_page() pdf.set_font('Arial', 'B', 10) pdf.cell(25, 5, 'My company name', ) pdf.set_font('A

[web2py] Is web2py the right tool for this kind of project?

2016-03-22 Thread Dragan Matic
I want to create a service where users could remotely manage some services on their computers which are behind the firewall. Users could register their account, under their account they could register one or more (let's say up to 20) client computers, for each of these they could download a sc

[web2py] Re: how to create dev site for my web2py postgres app on pythonanywhere.com

2016-02-21 Thread Dragan Matic
Here's explained: http://blog.draganmatic.com/init/default/show_page/3 On Sunday, February 21, 2016 at 9:30:14 AM UTC+1, Alex Glaros wrote: > > can anyone please walk me through the concepts of creating a dev site for > my web2py postgres app on pythonanywhere.com? > > I'd like to have a copy of

[web2py] A guide how to install your web2py app on your own server (using DigitalOcean droplets)

2016-02-15 Thread Dragan Matic
Hey guys, I wrote a guide for beginners how to install and configure your own server and how to host your web2py app on it, if anybody's interested here's the link: http://blog.draganmatic.com/init/default/show_page/3 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] How to hide app name and how to prevent name "leakage" if hosting multiple apps on one server?

2015-03-01 Thread Dragan Matic
Let's say that I have application named app1 and I am hosting it on www.app1.com domain. I would like application name not to be shown. If for instance I have two controllers, ctr1 and ctr2, URL helper will always generate addresses like www.app1.com/*app1*/ctr1/some_function and www.app1/ *app1

[web2py] Re: Web2py Funding

2014-11-20 Thread Dragan Matic
Is there a way to donate money to web2py project? I can only see "donate bitcoins" on front page. On Thursday, November 20, 2014 4:44:37 AM UTC+1, Massimo Di Pierro wrote: > > Honestly I do not understand how Meteor pulled it off. > I would have been happy to rebuilt something better than meteo

[web2py] Re: Deployment script for CentOS: apache + mod_wsgi + msql

2014-11-18 Thread Dragan Matic
for centos6 you should use setup-web2py-fedora.sh, it does the job. for centos7 there is setup-web2py-centos7.sh as Massimo mentioned but it will not work on centos 6 due to differences is these two systems. On Tuesday, November 11, 2014 12:29:34 PM UTC+1, lesssugar wrote: > > Hi, guys, I would

[web2py] Re: Mercurial?

2014-11-18 Thread Dragan Matic
Also, file scripts/setup-web2py-centos7.sh is missing from mercurial repository. Obviously there is a problem in syncing two repositories. On Monday, November 17, 2014 8:25:44 AM UTC+1, Johann Spies wrote: > > According to https://code.google.com/p/web2py/source/checkout the > Mercurial reposit

[web2py] Supplied setup scripts for fedora and centos do not work under centos 7. Here is the updated script.

2014-10-06 Thread Dragan Matic
Because of the changes in apache configuration and in the way iptables are configured in centos 7 none of the automated scripts could install web2py. In the attachment is the updated script that will install web2py with apache on fresh install of centos 7. SELinux configuration is still missing

Re: [web2py] Re: Appadmin redirect after upgrading to 2.9.7

2014-09-05 Thread Dragan Matic
+1 Here. It does the same thing to me, 2.9.7 appadmin redirects to web2py admin. 2.9.6 is working correctly. On Friday, September 5, 2014 10:06:24 PM UTC+2, Niphlod wrote: > > because the only change we made was making the access to appadmin more > secure when web2py is behind a proxy. > > Howe

[web2py] Re: How to show just entered value in the same form after self-submitting?

2014-08-19 Thread Dragan Matic
Unfortunately that won't work, if you recreate the form it does not self-submit, in fact in that case submit button does nothing, try this - it won't work: form=SQLFORM.factory( Field('some_text', 'string')) if form.accepts(request): form=SQLFORM.factory

[web2py] How to show just entered value in the same form after self-submitting?

2014-08-14 Thread Dragan Matic
I have a form with two fields, one field is a selection box of previously typed values and the other is a text box. User can choose a value from a selection box or can type a value in text box and submit it in which case I would like to add a value to a selection box, something like this: # so

[web2py] Re: Is there a way to find ID of inserted row if there is trigger after insert?

2014-08-06 Thread Dragan Matic
m sending a bug report On Wednesday, August 6, 2014 12:43:38 PM UTC+2, Dragan Matic wrote: > > Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 > Database drivers available: SQLite(sqlite3), MySQL(pymysql), > PostgreSQL(pg8000), IMAP(imaplib) > > Postgresql 9.3

[web2py] Re: Is there a way to find ID of inserted row if there is trigger after insert?

2014-08-06 Thread Dragan Matic
Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib) Postgresql 9.3 on linux mint 17. trigger is BEFORE_INSERT On Wednesday, August 6, 2014 12:30:30 PM UTC+2, Niphlod wrote: > > it doesn't have to do w

[web2py] Is there a way to find ID of inserted row if there is trigger after insert?

2014-08-06 Thread Dragan Matic
If I do something like this: new_id = db.table1.insert(...) and there is a trigger that inserts row in another table (table2) based on insert in table1 then the value of new_id is the id that is inserted in table2 instead of table1. Is this a bug or a feature? If it is a feature how can I get

[web2py] Re: Bootstrap is really killing web2py

2014-07-30 Thread Dragan Matic
re user base of web2py. Just my 2c. On Wednesday, July 30, 2014 1:12:44 AM UTC+2, Anthony wrote: > > On Tuesday, July 29, 2014 12:16:13 PM UTC-4, Dragan Matic wrote: >> >> Is there some tutorial how to do it for those of us not so versed in CSS? >> If you just replace bo

[web2py] Re: Bootstrap is really killing web2py

2014-07-29 Thread Dragan Matic
Is there some tutorial how to do it for those of us not so versed in CSS? If you just replace bootstrap.min.css in static/css the menus and forms do not work the way they used to in BS2. On Tuesday, July 29, 2014 5:36:06 PM UTC+2, Massimo Di Pierro wrote: > > web2py includes bs2 but this is cli

[web2py] Re: How to host a website from web2py homepage on pythonanywhere.com?

2014-07-08 Thread Dragan Matic
Check my answer on the same question here: https://groups.google.com/forum/?fromgroups#!searchin/web2py/dragan/web2py/IURWDAP2eTY/EBgPNBZ2kmwJ On Sunday, July 6, 2014 1:46:09 PM UTC+2, Ritesh Bhat wrote: > > Hi everyone, > I am a beginner and am using the web2py framework.for the first time. I

[web2py] Re: How do I do transaction in web2py?

2014-05-12 Thread Dragan Matic
All database operations in your controllers which are executed through DAL are executed in a transaction. So every time you do a database operation in your controller it starts a new transaction which is automatically commited if there were no errors. If it encounters any error then the transac

Re: [web2py] Re: Free opensource Janrain alternative - Python Social auth

2014-04-02 Thread Dragan Matic
I have installed the plugin and I think I have configured it according to manual but it keeps giving me this error: name 'current' is not defined File c:\web2py\applications\authtest\models\plugin_social_auth.py in at line 41 Am I missing something? On Thursday, February 27, 2014 8:27:5

Re: [web2py] Re: janrain and web2py

2014-03-27 Thread Dragan Matic
It still works with Google in version 2.8.x. But as someone mentioned, their prices are pretty high, it would be nice to have an alternative. On Wednesday, March 26, 2014 9:03:13 PM UTC+1, Niphlod wrote: > > it's been sitting on issues and roadmap for quite a while > > On Tuesday, Marc

[web2py] Re: sqlform.grid - is there a way to set a column to certain value when entering new rows?

2014-03-03 Thread Dragan Matic
I did not know that. Thanks. On Monday, March 3, 2014 2:24:49 PM UTC+1, Anthony wrote: > > You can dynamically change the default value of a field at any time: > > db.my_table.my_column.default = 'my default' > > Anthony > > On Monday, March 3, 2014 8:07:57 AM U

[web2py] Re: sqlform.grid - is there a way to set a column to certain value when entering new rows?

2014-03-03 Thread Dragan Matic
It shouldn't always be the same value, but is based on a certain condition. If for instance user chooses to view rows where value is '1', then every new row inserted should also have the value of '1'. On Monday, March 3, 2014 12:29:08 PM UTC+1, 黄祥 wrote: > > just a suggestion, why not using de

[web2py] sqlform.grid - is there a way to set a column to certain value when entering new rows?

2014-03-03 Thread Dragan Matic
I have a grid and would like to show only rows where mytable.my_column == certain value form = SQLFORM.grid(db.my_table.my_column == my_value) and I would also like that every new row has the same predefined value. Is there a way to say to a grid that every new row should have my_val

[web2py] Re: WYSIWYG editor - CKeditor plug-in

2014-02-13 Thread Dragan Matic
I am using the same plugin in my project and it works perfectly, users can upload images without problems. If you think problem is in routes try without it. On Thursday, February 13, 2014 12:53:36 PM UTC+1, Gael Princivalle wrote: > > Hello all. > > I need to add a WYSIWYG editor in my web2py ap

[web2py] Re: How to use PythonAnywhere to host an already developed Web2py app?

2014-02-02 Thread Dragan Matic
hough, How do I get my " > YOUR_USERNAME.pythonanywhere.com/" to automatically direct to my webapp > instead of point to the generic "Welcome" HelloWorld app? > > Otherwise I have to constantly add the app in for " > YOUR_USERNAME.pythonanywhere.com/app2&quo

[web2py] Re: How to use PythonAnywhere to host an already developed Web2py app?

2014-01-31 Thread Dragan Matic
1. Create an account on pythonanywhere and log in (I presume you want a "Beginner" account for 0$/month) 2. Click on "Dashboard" 3. Click on "Web" 4. Click on "Add a new web app" 5. Click "Next", click on "web2py" 6. Enter your admin password, click on "Next" 7. You ca

[web2py] Re: How to do a insert..select with DAL?

2014-01-28 Thread Dragan Matic
-database-abstraction-layer#insert > > On Tuesday, January 28, 2014 1:39:34 PM UTC+1, Dragan Matic wrote: >> >> Is there a way to do insert.. select with DAL? I would like to do >> something like this: >> >> insert into table1 (col1, col2, col3, col4) >> selec

[web2py] How to do a insert..select with DAL?

2014-01-28 Thread Dragan Matic
Is there a way to do insert.. select with DAL? I would like to do something like this: insert into table1 (col1, col2, col3, col4) select col5, col6, 'val1', 'val2' from table2 where col5 = 'val3' Thanks Dragan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

[web2py] Re: How to make registrations invitation-only with Janrain login/registrations

2013-11-14 Thread Dragan Matic
; > On Friday, November 8, 2013 5:57:08 AM UTC-7, Dragan Matic wrote: >> >> When using web2py authentication I can check if user is logging in or >> registering a new user and then I can check if it has proper invitation >> code in and deny him registration. >> >

[web2py] How to make registrations invitation-only with Janrain login/registrations

2013-11-08 Thread Dragan Matic
When using web2py authentication I can check if user is logging in or registering a new user and then I can check if it has proper invitation code in and deny him registration. But what if user is using Janrain? Login and registraton is then done through an external app. Is there a way to inte

[web2py] Multiple login forms with ExtendedLoginForm example from book not working

2013-10-24 Thread Dragan Matic
I am trying to create Janrain login + web2py login with password so the users can choose login and registration method. When I try the following example from the book: from gluon.contrib.login_methods.rpx_account import RPXAccount from gluon.contrib.login_methods.extended_login_form import Exte

[web2py] ajax function is not called when passing non-ascii characters as arguments

2013-09-20 Thread Dragan Matic
On my page I have a set of links (page types) that loads its content dynamically when user clicks on the link. Clicking on each link calls a "LoadPage" javaScript function that calls python function that loads page content and puts it in "pageType" DIV. function LoadPage(pageType) {

[web2py] Re: Newby, can't connect to a Postgresl database

2013-09-08 Thread Dragan Matic
Postgres probably doesn't have 'root' as user. Its root user is 'postgres'. After that check if your address is allowed to connect to postgres server in pg_hba.conf and if server is listening on your network ('listen_addresses' setting in postgresql.conf). It could also be a firewall issue, c

[web2py] What is the best way to inform users that maintenance is in progress?

2013-08-05 Thread Dragan Matic
Let's suppose that I want to disable my web app for a certain period of time while I am updating the database and that I want to inform users that maintenance is in progress? 1. In models I can create a global var MAINTENANCE_IN_PROGRESS = False which I could thange to True when I want to do so

[web2py] New conditional fields in SQLFORM.factory?

2013-07-31 Thread Dragan Matic
Is it possible to use conditional fields introduced in 2.5.1 with SQLFORM.factory and what would be the syntax? -- --- 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 emai

[web2py] How to make app setup / is it possible to have modelless app?

2013-07-16 Thread Dragan Matic
What would be the best way to create an app setup? After uploading/installing an app to a server I would like a user to be able to start a setup page where he would choose a database/user/password and a few other configuration parameters. Problem is that for every called page model is executed

[web2py] Re: What would be the best way to optimize/resize images after upload

2013-05-19 Thread Dragan Matic
; You then have to use im.save('path', 'jpeg') to get a jpeg out. You also >> have to do a little extra work to save it to db or do some file management >> to discard the original, if you so desire. >> >> >> >> On Thursday, May 9, 2013 5:43:4

[web2py] What would be the best way to optimize/resize images after upload

2013-05-08 Thread Dragan Matic
Is there a way to automatically optimize and convert images after users upload it on my web app? I am pretty sure lots of users will upload uncompressed .bmp pictures or extra large pictures directly from camera. I think it would be best if I could resize and compress them immediately after upl

[web2py] Re: Bootstrap typeahead

2013-04-23 Thread Dragan Matic
I'm not sure if typeahead will accept json as source but for me it worked the following way: I created a string from values in which values were in double quotes and delimited by comma and I sent that string to the view: For example: source_string = '"one", "two", "three"' return dict(sstr=sour

[web2py] auth.settings.extra_fields - do not show on registration?

2013-04-22 Thread Dragan Matic
Is it possible to add extra fields into auth and not have them shown/asked on the registration page but only on the user settings page? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emai

[web2py] webiste language based on domain name?

2013-04-09 Thread Dragan Matic
Is it possible to present a language based on domain name? If I have a multiple national domains registered for my web site - for example if I have www.mywebsite.com, www.meinewebseite.de or www.misitioweb.es I would like to do something like: if userentered=='www.mywebsite.com': T.force('e

[web2py] Re: DAL is not joining tables if I have multiple clauses?

2013-03-30 Thread Dragan Matic
Thanks a lot to everybody, it seems that I have just skimmed over this part of the book. I will have to re-read it again more carefully. On Friday, March 29, 2013 2:23:36 PM UTC+1, Niphlod wrote: > > Annet got it right. > > On Friday, March 29, 2013 1:16:34 PM UTC+1, Cliff Kachinske wrote: >> >>

[web2py] DAL is not joining tables if I have multiple clauses?

2013-03-29 Thread Dragan Matic
I have a table that shows family connections for users (I need one way connections) defined as: db.define_table('family_members', Field('user_id', 'integer'), Field('connected_to', 'integer')) I need to read and to show all users that are connected to a logged user, basically an inne

[web2py] How to use auth.requires_permission with record_id?

2013-03-07 Thread Dragan Matic
I'm having problems grasping the mechanism of function decoration with auth.requires_permission(). For instance I have a simple table defined like this: db.define_table('messages', Field('messagetext', 'string')) And I would like users to be able to see just their own messages. I have a contro

[web2py] Re: uploading a picture through SQLFORM.factory?

2013-02-08 Thread Dragan Matic
r, 'uploads/')), > table_name='mypictures') > > With that change, the filenames will begin with "mypictures" instead of > "no_table", and response.download() should then be able to locate the real > database table and properly serv

[web2py] uploading a picture through SQLFORM.factory?

2013-02-08 Thread Dragan Matic
Here is a model table for holding picture names: db.define_table('mypictures', Field('description', 'string'), Field('mypicture', 'upload')) If I try to upload a picture through simple SQLFORM everything works ok, picture is renamed to something like 'mypictures.mypicture.be0ff92956b81

[web2py] Is there a way to use query in autocomplete with SQLFORM.factory?

2013-01-24 Thread Dragan Matic
I would like autocomplete to show just a subset of data, not all rows in table. Is it possible to use query in autocomplete like this? query = db.recipe.user_id==auth.user_id form=SQLFORM.factory(Field('title', 'string', required=True, requires= IS_NOT_EMPTY()), Field('type', 'st

[web2py] auth.wiki() writes apsolute links for wiki pages. Can I change it to write only relative url?

2012-12-07 Thread Dragan Matic
Currently if I write markmin link in auth.wiki() like this: [[Some link text @some-wiki-page]] - link is written as absolute URL. If I move my database to another site all the links in wiki pages break. Can I change this behavior or is this a feature? Dragan --

Re: [web2py] Unique constraint/index on multiple fields?

2012-11-19 Thread Dragan Matic
I'm using postgres too, that will be the way to go, tnx On Monday, November 19, 2012 7:57:32 AM UTC+1, Johann Spies wrote: > > On 16 November 2012 15:59, Dragan Matic > > wrote: > >> It has been asked before but I haven't seen any definitive answer. Is &

[web2py] Unique constraint/index on multiple fields?

2012-11-17 Thread Dragan Matic
ppadmin/select/db?orderby=auth_membership.group_id> 1 <http://127.0.0.1:8000/kuvar/appadmin/update/db/auth_membership/1>Dragan Matic (1) <http://127.0.0.1:8000/kuvar/appadmin/update/db/auth_user/1>user_1 (1) <http://127.0.0.1:8000/kuvar/appadmin/update/db/auth_group/1>2<http://127.0.

[web2py] Re: 2.2.1 auth.wiki() automatically adds users to wiki_editor group. Bug or feature?

2012-11-08 Thread Dragan Matic
should > not happen for other users. If it happens it is a bug. Can you confirm this > is working as intended? > > On Thursday, 8 November 2012 08:00:31 UTC-6, Dragan Matic wrote: >> >> I am doing an auth.wiki(manage_permissions=True). >> >> Basically, I want t

[web2py] 2.2.1 auth.wiki() automatically adds users to wiki_editor group. Bug or feature?

2012-11-08 Thread Dragan Matic
I am doing an auth.wiki(manage_permissions=True). Basically, I want to have a wiki writer and a wiki_reader who will not be able to edit wiki posts. Two users (reader and writer) are registered and two groups are automatically opened (user_1 and user_2). For every wiki post user_1 and user_2 a