Re: [web2py] creating DAL from SQL file

2015-04-25 Thread Ron Chatterjee
I got the code to run half way. I am saying, if we can bypass subprocess.Popen by: cat_str = 'SELECT *From' + " " + table_name[0] get_table = cursor.execute(cat_str) sql_create_stmnt = cursor.fetchall() I may not need to have mysqldump or anything. I just don't know what subprocess.Popen doe

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
MAGIC! Thank you, Anthony and Dmitry. I misread Dmitry's code for the view and retained the dict() when returning a value from showtasks(), and removed showtasks.load. That is completely wild! Thought I had read the book thoroughly before bugging you folks. Thank you. -- Resources: - http://w

Re: [web2py] creating DAL from SQL file

2015-04-25 Thread Richard Vézina
I never try it... I may try it for you, but not now, I am working late tonight to push a new app version in production :( >From the script doc : This plugin needs:mysqlmysqldumpinstalled and globally available.Under Windows you will probably need to add the mysql executable directory to the PATH

Re: [web2py] creating DAL from SQL file

2015-04-25 Thread Ron Chatterjee
I very simple question. Have you tried? Does the script works for you? Because it didn't work for me. Idk what you don't understand that I am doing. Its all the same code. someone can just step through it and figure out that its failing on subprocess.Popen. Idk why its so hard to understand. Sp

[web2py] put table._format as default for referenced fields

2015-04-25 Thread Leonardo Pires Felix
Hi, There is a better way to put the table format attribute in each referenced field that has not a label specified? My application has now 183 tables so far, and puting one by one is kind of boring. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com

[web2py] Re: Pydal ilike search inside a list of strings?

2015-04-25 Thread Massimo Di Pierro
db.tablename.fieldname.contains('whatever') On Saturday, 25 April 2015 10:28:10 UTC-5, Tom Stratton wrote: > > Hi - > > I'm struggling to find a way to do an "ilike" style search within a list > of strings field in the db. > > For example, my field may contain ['Donald Duck', 'Minnie Mouse'] > >

Re: [web2py] Re: database chema recommendations needed

2015-04-25 Thread Richard Vézina
Yes, but it is in python... I would use it as a starting point and transform it into a web app... But I don't know what you are doing and what you already have... But what you were talking about seems to me as a pretty big undertake for a single man!! (but again you maybe not alone). Richard On W

Re: [web2py] creating DAL from SQL file

2015-04-25 Thread Richard Vézina
I don't know what you are doing... As far as I can see the only thing you have to do is to is that you call the script with as argument a valid web2py db connection string... a database dump is what is say you dump your db into a file... But I don't think this script work like that, I thought it c

[web2py] duplicate session when using ajax callback in component

2015-04-25 Thread 黄祥
hi, is it possible to use ajax callback to update session value in component? the same code on ajax callback is work fine when not in component (originally take from web2py appliance (estore) i've tested it and ended with duplicate session during ajax callback to update session value in componen

[web2py] Re: How to set a condition with @auth.requires_login in Web2py

2015-04-25 Thread Anthony
Did this solution not work for you? On Saturday, April 25, 2015 at 11:28:10 AM UTC-4, Christophe Meessen wrote: > > In my web2py web app, the controller function def index(): has the > decorator @auth.requires_login(). > > For development and testing

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Anthony
On Saturday, April 25, 2015 at 3:24:38 PM UTC-4, Tom Campbell wrote: > > Thanks, Dmitry--some questions. > >1. What does "will take no view" mean for the showtasks() method? > > If you return a string or HTML helper object (which includes the grid), web2py will not look for/execute a view but

[web2py] Re: LOAD() problem: Yes, I am bungling the world's smallest web2py app.

2015-04-25 Thread Tom Campbell
Thanks, Dmitry--some questions. 1. What does "will take no view" mean for the showtasks() method? 2. Why are .load extensions not recommended? There seems to be some history on the list but I don't understand the issues. -- Resources: - http://web2py.com - http://web2py.com/book (Docum

[web2py] Re: Capture XML response into string for further parsing with ElementTree

2015-04-25 Thread Niphlod
you have fromstring() for parsing the xml. just fetch it with, e.g. urllib2 and load it with fromstring(). On Saturday, April 25, 2015 at 5:28:15 PM UTC+2, NeoToren wrote: > > Amazon Payments responds to a website with XML. > Amazon doesn't send back an XML to my site - it just displays XML - at

[web2py] Re: Combine IS_IN_DB and IS_NOT_IN_DB

2015-04-25 Thread Niphlod
You should read the section on database validators http://web2py.com/books/default/chapter/29/07/forms-and-validators#Database-validators you can either use the _and argument of IS_IN_DB, but more easily for everybody, e.g. there's not even a chance they can select an ip that is used yet,

[web2py] Re: database chema recommendations needed

2015-04-25 Thread Mark Graves
One more thing, if you are worried about the speed, you can always cache the results in memory. On Tuesday, April 21, 2015 at 10:05:32 AM UTC-5, John wrote: > > New to programming and web2py. Been dabbling in web design for a while, > building sites with wordpress, plugging things in. My first r

[web2py] Re: database chema recommendations needed

2015-04-25 Thread Mark Graves
Hey John, Welcome to the community. I'm not sure I understand your requirements exactly, but here is my thoughts on a schema: For the initial MVP, I usually like to keep the amount of tables to a minimum, then as I figure out the common queries I can separate them out into multiple tables. F

[web2py] Caching Architecture Question

2015-04-25 Thread Mark Graves
Hey everyone, Question on cacheing & app architecture. I have some selects I would like to cache for speedup, specifically in redis, but on a more abstract level, I have a question. I have modularized most of my functions so I can efficiently iterate the application, and can unit test effecti

Re: [web2py] Re: web2py update app admin doesn't work anymore

2015-04-25 Thread Kevin Bethke
thanks it worked perfectly On Sat, Apr 25, 2015 at 6:18 PM, 黄祥 wrote: > what version did you use right now? > if i'm not wrong in the newest version got the pydal modules separate. > please download and unzip from web2py website. > > ref: > http://web2py.com/books/default/chapter/29/14/other-rec

[web2py] Re: How to remove application name from urls generated from a scheduled task?

2015-04-25 Thread Lisandro
If by chance someone is dealing with the same problem and using nginx, here's a temporary fix: edit your virtual host configuration, and add this lines inside the server {} block directive: location /appname/ { rewrite ^/appname/(.*)$ $scheme://mydomain.com/$1 redirect; } El viernes, 24

[web2py] Re: How to avoid error when app is renamed and sessions are stored in db and shared through domains?

2015-04-25 Thread Lisandro
If by chance someone is dealing with the same problem and using nginx, here's a temporary fix: edit your virtual host configuration, and add this lines inside the server {} block directive: location /appname/ { rewrite ^/appname/(.*)$ $scheme://mydomain.com/$1 redirect; } El jueves, 2

[web2py] Re: web2py update app admin doesn't work anymore

2015-04-25 Thread 黄祥
what version did you use right now? if i'm not wrong in the newest version got the pydal modules separate. please download and unzip from web2py website. ref: http://web2py.com/books/default/chapter/29/14/other-recipes#Upgrading http://web2py.com/init/default/download best regards, stifan -- Re

[web2py] Re: upload field

2015-04-25 Thread 黄祥
perhaps you can use validators on form level. e.g. requires = IS_UPLOAD_FILENAME(extension='pdf') ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#Special-type-validators best regards, stifan On Saturday, April 25, 2015 at 10:28:10 PM UTC+7, KevC wrote: > > Hi! > > I want

[web2py] Re: Combine IS_IN_DB and IS_NOT_IN_DB

2015-04-25 Thread 黄祥
perhaps you can use unique=True on your table 'server' e.g. 1 db.define_table('server', Field('servername', length=200), Field('port', length=200), Field('ipaddress_id', unique=True, 'reference ipaddress')) db.server.ipaddress_id.requires = IS_IN_DB(db,db.ipaddress.id, '%(ip)s') anoth

[web2py] Re: How to set a condition with @auth.requires_login in Web2py

2015-04-25 Thread 黄祥
perhaps you can do something like : if auth.is_logged_in(): e.g. *models/menu.py* if auth.is_logged_in(): response.menu = [ (T('Test'), False, URL('default', 'index'), [ (T('Test'), False, URL('default', 'test'), []), ]), ] best regards, stifan > > -- Resources: - http://web2py.com - http://web

[web2py] Capture XML response into string for further parsing with ElementTree

2015-04-25 Thread NeoToren
Amazon Payments responds to a website with XML. Amazon doesn't send back an XML to my site - it just displays XML - at the same URL my website sent a well formed, hashed and signed message. I need to parse the Amazon XML response into meaningful variables for moving forward with the purchasing wo

[web2py] Re: routes.py breaking login...

2015-04-25 Thread Tom Stratton
Thanks Anthony! In the end I added this to db.py: ``` auth.settings.controller = 'pkg' auth.settings.login_url = URL ('pkg', 'user') ``` and it all worked out On Saturday, April 18, 2015 at 8:15:45 AM UTC-7, Anthony wrote: > > Auth

[web2py] Combine IS_IN_DB and IS_NOT_IN_DB

2015-04-25 Thread kecajkecaj123
Hi Guys, I have simple database: db.define_table('ipaddress', Field('ip', unique=True, length=200), Field('subnet', length=200), format = '%(ip)s') db.define_table('server', Field('servername', length=200), Field('port', length=200), Field('ipaddress_id', 'reference ipaddress'

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I found that I can use: {{=LOAD('tenant','stackList.load',ajax=True, target="stackList",vars={ 'reload_div':'stackList'},content=CENTER(IMG(_src=URL(request.application, 'static','images/ajax_loader_blue_256.gif'}} So this gives me a spinner gif inside my component div on page reload. It doe

[web2py] Re: Failed login attempt lockout

2015-04-25 Thread 黄祥
the idea is base on wordpress plugin 'limit login attempts', that i want to achieve it using web2py. first i want to start from simple, just record the attempted times in database table, after that, banned ip user for several time (minutes or hours) if the failed login is reached max retries t

[web2py] Re: database chema recommendations needed

2015-04-25 Thread John
Gramps is a desktop program for building a family tree. We have a web based version that we're fine with although I'd like to tie it into the actual site sometime for joint login purposes. This other part of the site is the individual transcriptions of old records. The data you would reference/c

Re: [web2py] Re: auth.wiki()

2015-04-25 Thread Ben Lawrence
It works now for me. All I had to do was add a tag to one of the pages. Seems search doesn't work for empty tag table. On Tuesday, April 21, 2015 at 8:26:44 AM UTC-7, Alex Glaros wrote: > > no, did not get it to work, but submitted bug report. You can follow > progress of bug report here: > > h

Re: [web2py] Re: [OT] HTML to PDF

2015-04-25 Thread Ariya Owam-aram
Hi, Now it work very well on my site and can be run on NginX step 1. download : http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb 2. install : (from command line) 1. dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb 2.

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I think I found my solution, in my controlling function when I send the response.js for the reload, I'm doing it like this now: spinner=CENTER(IMG(_src=URL(request.application,'static', 'images/ajax_loader_blue_256.gif'))) response.js = "jQuery('#stackList').html('{0}');jQuery('#

[web2py] upload field

2015-04-25 Thread KevC
Hi! I want to upload a file type .PDF in upload field but I only aceept this type of file. What can I do? I hope you can help me. Best regards. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.co

[web2py] Re: dynamically add rows to html table

2015-04-25 Thread Lieven Van Acker
> > ... > > Use the same function to populate the div on initial page load as you do > to from the ajax call. Note it's handy to have that function easily > callable from something that's not ajax for debugging, as ajax hides the > error message. > > > Can you provide an example on how to in

[web2py] How to set a condition with @auth.requires_login in Web2py

2015-04-25 Thread Christophe Meessen
In my web2py web app, the controller function def index(): has the decorator @auth.requires_login(). For development and testing purpose I comment out this decorator. But I often forget to uncomment it before committing the code. I would like to change this decorator into something that would

[web2py] Re: csv download problem from an SQLFORM.grid populated by an AJAX call

2015-04-25 Thread drmbded
> > While putting together an example of the error I found that my example >> worked fine, in fact I'm getting HTML instead of CSV from a grid that was >> not created from an AJAX call. >> > This must be something that I've cause but with such a simplified application I'm stumped as to what is

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I've tried twice before to post my solution on this, but here's a third try: So I solved this for my app, in the following way. For reference for others, and for comment if I'm doing something stupid. But, this works for me: In my view: {{=LOAD('tenant','stackList.load',ajax=True, target="stack

Re: [web2py] unicode error with postgre on 2.10.3 (with sample app)

2015-04-25 Thread bodobammel
Hey guys, 2.10.3 doesn't seem ready for prime time :-( In fact this bug makes 2.10.3 unusable for postgres users with need for non ASCII-characters.. For reference let's link to the corresponding issue here too: https://github.com/web2py/web2py/issues/910 Is there any solution yet? Bodo Am S

[web2py] Pydal ilike search inside a list of strings?

2015-04-25 Thread Tom Stratton
Hi - I'm struggling to find a way to do an "ilike" style search within a list of strings field in the db. For example, my field may contain ['Donald Duck', 'Minnie Mouse'] I'd like that record returned when I am searching for '%mouse%' Maybe I need to cast the list to a string but this is just

[web2py] Re: Trying to persist a DAL connection to save time connection

2015-04-25 Thread Michel Krav
Thanks anthony, I thought I'd be critized the hard way by some experienced users, so thanks for your quick, constructive and straightforward response, as always. I really appreciate the quality of your job in web2py and the job for animating this user group. I admit not read the entire book,

[web2py] Re: alternate date and time picker

2015-04-25 Thread Lieven Van Acker
Hi Greg, I'm trying to integrate the date and time picker from Pickadate.js, but seem to have some problems with the styling, e.g. the dates table width is only taking half of the widget with, and styling of the header is different from the expected (default) styling as experienced on http://a

[web2py] web2py update app admin doesn't work anymore

2015-04-25 Thread BlueShadow
Hi I'm running web2py on ubuntu with nginx after updating to the current version my appadmin doesn't work anymore. this is the error I got directly from the appadmin error folder: S'output' p2 S" No module named pydal.objects" p3 sS'layer' p4 S'/home/www-data/web2py/applications/admin/controllers/

[web2py] Re: How to remove application name from urls generated from a scheduled task?

2015-04-25 Thread Lisandro
This is my routes.py: # -*- coding: utf-8 -*- routers = dict(\ BASE = dict(\ default_controller = 'default', \ default_function = 'index', \ domains = {\ 'website.dev':'website', \ 'panel.website.dev':'website_panel', \ }, \ root_static = ['robots.txt'], \ m

[web2py] Re: How to remove application name from urls generated from a scheduled task?

2015-04-25 Thread Niphlod
there's nothing fancy in the scheduler that alters the environment at runtime: it's no different from a web2py shell. can you post your routes, your "desired urls" and the code that generates them ? On Friday, April 24, 2015 at 6:37:43 PM UTC+2, Lisandro wrote: > > I'm using parametric based rou

[web2py] Re: ghost scheduler workers can never be deleted even the web2py-schduler is stopped.

2015-04-25 Thread Niphlod
there's nothing that magically insert records on the scheduler_worker table. watch the last_heartbeat column and see if it changes. If it's changing, the workers are still running somewhere and accessing your database. On Friday, April 24, 2015 at 9:24:59 PM UTC+2, Pengfei Yu wrote: > > Hi I am

[web2py] Re: DB2 database issue with Clob types

2015-04-25 Thread Paolo Valleri
you should provide us more info... which web2py type are you using that is mapped to CLOB field? web2py/pyodbc version Paolo On Friday, April 24, 2015 at 6:17:53 PM UTC+2, Boris Aramis Aguilar Rodríguez wrote: > > ('ODBC data type -99 is not supported. Cannot read > column LDTEXT.', 'HY000')

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-04-25 Thread Stefan van den Eertwegh
Hi Massimo, I also provide consulting for web2py apps. I was trained at Formatics. Company: Corebyte (NL) Adres: www.corebyte.nl Thanks! Op zondag 15 februari 2015 23:21:36 UTC+1 schreef Massimo Di Pierro: > > We need to update the list of companies that provide web2py consulting. > This list i