[web2py] Re: Oracle drivers.

2015-10-14 Thread Michael M
Has anyone been able to reproduce this?

On Thursday, October 8, 2015 at 12:09:45 PM UTC-7, Michael M wrote:
>
> Thank-you Niphlod!
>
> On Thursday, October 8, 2015 at 12:08:40 PM UTC-7, Niphlod wrote:
>>
>> the repo for pydal is the other one no worries though, I linked your 
>> one in https://github.com/web2py/pydal/issues/299
>>
>> On Thursday, October 8, 2015 at 3:13:11 AM UTC+2, Michael M wrote:
>>>
>>> Submitted:
>>> https://github.com/web2py/web2py/issues/1082
>>>
>>> On Wednesday, October 7, 2015 at 5:29:43 PM UTC-7, Massimo Di Pierro 
>>> wrote:

 This may be a bug. Can you please open a pydal ticket and we will check 
 it asap?

 On Wednesday, 7 October 2015 14:50:13 UTC-5, Michael M wrote:
>
> Never checked there.  But it is.
>
> $ python web2py.py
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2015
> Version 2.12.3-stable+timestamp.2015.08.19.00.18.03
> Database drivers available: cx_Oracle, pymysql, imaplib, sqlite3, 
> pg8000, pyodbc
>
> Weird.  just rebooted the Virt. and still getting:
>
> Traceback (most recent call last):
>   File "/opt/www-data/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/opt/www-data/web2py/applications/test/models/db.py" 
> , line 20, in 
> 
> db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
> cast=int), check_reserved=['all'])
>   File "/opt/www-data/web2py/gluon/packages/dal/pydal/base.py", line 174, 
> in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/opt/www-data/web2py/gluon/packages/dal/pydal/base.py", line 459, 
> in __init__
> raise RuntimeError("Failure to connect, tried %d times:\n%s" % 
> (attempts, tb))
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "/opt/www-data/web2py/gluon/packages/dal/pydal/base.py", line 437, 
> in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "/opt/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 57, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File 
> "/opt/www-data/web2py/gluon/packages/dal/pydal/adapters/oracle.py", line 
> 105, in __init__
> if do_connect: self.find_driver(adapter_args,uri)
>   File "/opt/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 188, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('cx_Oracle',)
>
>
> On Wednesday, October 7, 2015 at 12:45:19 PM UTC-7, Willoughby wrote:
>>
>> When you start web2py from a command line it should list 'Database 
>> drivers available' - is it on that list?
>>
>> On Wednesday, October 7, 2015 at 3:12:01 PM UTC-4, Michael M wrote:
>>>
>>> Just to cover more basis I installed the following:
>>>
>>> sudo rpm -Uvh
>>>
>>> oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
>>> oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
>>> oracle-instantclient11.2-jdbc-11.2.0.4.0-1.x86_64.rpm
>>> oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm
>>> oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
>>> oracle-instantclient11.2-tools-11.2.0.4.0-1.x86_64.rpm
>>>
>>> then 
>>>
>>> cx_Oracle-5.1.2-11g-py27-1.x86_64.rpm
>>>
>>> Still no dice in Web2py
>>>
>>>
>>> On Tuesday, October 6, 2015 at 5:09:18 PM UTC-7, Michael M wrote:

 I was testing in non-prod (RHEL) to see if it was built in.  it 
 wasnt.  on my Fedora 22 at my desk I installed cx_Oracle because it 
 works 
 when i am in CLI python and I can call it no errors.  I have yet to 
 dabble 
 in virtualenv.

 I have systemctl restart httpd after every change.  even reboots to 
 make sure.

 On Tuesday, October 6, 2015 at 5:02:12 PM UTC-7, Leonel Câmara 
 wrote:
>
> Is it possible web2py is running in a virtualenv where you have 
> not installed cx_Oracle?
>
> Also don't forget to restart Apache.
>


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: qrcode

2015-10-14 Thread Michael M
def qrpage():
#Install Python Modules: (Pillow,qrcode)
#https://github.com/lincolnloop/python-qrcode

ToQRData = auth.user.username + ' Likes MLP:FIM'
import qrcode
import StringIO
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=1,
)
qr.add_data(ToQRData)
qr.make(fit=True)

# use an in-memory object to save
output = StringIO.StringIO()
img = qr.make_image()
img.save(output)

# and the use getvalue() method to get the string
img_tag = '' % 
output.getvalue().encode('base64').replace('\n', '')
return locals()


On Tuesday, October 13, 2015 at 2:05:23 PM UTC-7, Fabiano Almeida wrote:
>
> Hi all!
>
> How to dynamically generate qr code in web2py?
>
> grateful,
>
> Fabiano.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] _onkeyup / ajax call

2015-10-14 Thread Mark Billion
Im pulling my hair out. . . . 

Im using an inline call to the web2py ajax function via the controller as 
below:

ajax_form.element('#Debts_creditor')['_onkeyup'] = 
"ajax('https:.../t2/default/cred_selector', ['creditor'], 'suggestions');"

The goal is for this ajax call to control a div that I am inserting in a 
dynamically created iframe div, per below.

Ive been at this for two days and cannot for the life of me figure out what 
Im doing wrong.  Any help would be much appreciated.



$('.iframe_input').click(function(){
var element = $(this).attr('name');
$('#iframe_target').html('');

});


function row_adder() {

var iframe = document.getElementById('myFrame'),
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
$(iframeDoc).find('#Debts_creditor__row').after('here');

}





def cred_selector():
if not request.vars.creditor:
return ""
else:
click_string = "jQuery('#Debts_creditor').val('%s'); 
jQuery('#Debts_street_1').val('%s'); \
jQuery('#Debts_street_2').val('%s'); 
jQuery('#Debts_zip_code').val('%s')"

pattern = request.vars.creditor + '%'
selected = [[row.creditor, row.street_1, row.street_2, 
row.zip_code] for row in 
db(db.preferred_creditor.creditor.like(pattern)).select()]

return ''.join([DIV(k[0], _onclick=click_string %(k[0], k[1], k[2], 
k[3]), 

_onmouseover="this.style.backgroundColor='grey'",

_onmouseout="this.style.backgroundColor='white'").xml() for k in selected])


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Niphlod,

I trying to generate qr code with built-in feature, for local use, mobile
for reading.

thx

2015-10-13 18:20 GMT-03:00 Niphlod :

> with any qrcode library or qrcode ondemand service out there ? What did
> you try ?
>
>
> On Tuesday, October 13, 2015 at 11:05:23 PM UTC+2, Fabiano Almeida wrote:
>>
>> Hi all!
>>
>> How to dynamically generate qr code in web2py?
>>
>> grateful,
>>
>> Fabiano.
>>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Import CSV file

2015-10-14 Thread TheFltube
Hi folks, glad to join this group

I tried to import in Web2Py the attached CSV file ( no sensible data, just 
fake info for training ;), after having created the corresponding db.py

It works but only IDs are created for the correct number of rows ( held in 
CSV ) but no field is actually loaded, they're all empty

If i try to access SqlLite db and import the CSV into the already created 
table ( by db.py ) , it works like a charm and data are correctly visible 
and accessible via controllers/views

Sorry ( and apologize ) if the post has already been threaded in another 
section

Best regards
 Fabrizio

db.define_table('contacts',
Field('first_name'),
Field('last_name'),
Field('company_name'),
Field('address'),
Field('city'),
Field('county'),
Field('state_name'),
Field('zip'),
Field('phone1'),
Field('phone2'),
Field('email', requires=IS_EMAIL()),
Field('web')
)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
first_name;last_name;company_name;address;city;county;state;zip;phone1;phone2;email;web
James;Butt;Benton, John B Jr;6649 N Blue Gum St;New Orleans;Orleans;LA;70116;504-621-8927;504-845-1427;jb...@gmail.com;http://www.bentonjohnbjr.com
Josephine;Darakjy;Chanay, Jeffrey A Esq;4 B Blue Ridge Blvd;Brighton;Livingston;MI;48116;810-292-9388;810-374-9840;josephine_dara...@darakjy.org;http://www.chanayjeffreyaesq.com
Art;Venere;Chemel, James L Cpa;8 W Cerritos Ave #54;Bridgeport;Gloucester;NJ;8014;856-636-8749;856-264-4130;a...@venere.org;http://www.chemeljameslcpa.com
Lenna;Paprocki;Feltz Printing Service;639 Main St;Anchorage;Anchorage;AK;99501;907-385-4412;907-921-2010;lpapro...@hotmail.com;http://www.feltzprintingservice.com
Donette;Foller;Printing Dimensions;34 Center St;Hamilton;Butler;OH;45011;513-570-1893;513-549-4561;donette.fol...@cox.net;http://www.printingdimensions.com
Simona;Morasca;Chapman, Ross E Esq;3 Mcauley Dr;Ashland;Ashland;OH;44805;419-503-2484;419-800-6759;sim...@morasca.com;http://www.chapmanrosseesq.com
Mitsue;Tollner;Morlong Associates;7 Eads St;Chicago;Cook;IL;60632;773-573-6914;773-924-8565;mitsue_toll...@yahoo.com;http://www.morlongassociates.com
Leota;Dilliard;Commercial Press;7 W Jackson Blvd;San Jose;Santa Clara;CA;95111;408-752-3500;408-813-1105;le...@hotmail.com;http://www.commercialpress.com
Sage;Wieser;Truhlar And Truhlar Attys;5 Boston Ave #88;Sioux Falls;Minnehaha;SD;57105;605-414-2147;605-794-4895;sage_wie...@cox.net;http://www.truhlarandtruhlarattys.com
Kris;Marrier;King, Christopher A Esq;228 Runamuck Pl #2808;Baltimore;Baltimore City;MD;21224;410-655-8723;410-804-4694;k...@gmail.com;http://www.kingchristopheraesq.com
Minna;Amigon;Dorl, James J Esq;2371 Jerrold Ave;Kulpsville;Montgomery;PA;19443;215-874-1229;215-422-8694;minna_ami...@yahoo.com;http://www.dorljamesjesq.com
Abel;Maclead;Rangoni Of Florence;37275 St  Rt 17m M;Middle Island;Suffolk;NY;11953;631-335-3414;631-677-3675;amacl...@gmail.com;http://www.rangoniofflorence.com
Kiley;Caldarera;Feiner Bros;25 E 75th St #69;Los Angeles;Los Angeles;CA;90034;310-498-5651;310-254-3084;kiley.caldar...@aol.com;http://www.feinerbros.com
Graciela;Ruta;Buckley Miller & Wright;98 Connecticut Ave Nw;Chagrin Falls;Geauga;OH;44023;440-780-8425;440-579-7763;gr...@cox.net;http://www.buckleymillerwright.com
Cammy;Albares;Rousseaux, Michael Esq;56 E Morehead St;Laredo;Webb;TX;78045;956-537-6195;956-841-7216;calba...@gmail.com;http://www.rousseauxmichaelesq.com
Mattie;Poquette;Century Communications;73 State Road 434 E;Phoenix;Maricopa;AZ;85013;602-277-4385;602-953-6360;mat...@aol.com;http://www.centurycommunications.com
Meaghan;Garufi;Bolton, Wilbur Esq;69734 E Carrillo St;Mc Minnville;Warren;TN;37110;931-313-9635;931-235-7959;meag...@hotmail.com;http://www.boltonwilburesq.com
Gladys;Rim;T M Byxbee Company Pc;322 New Horizon Blvd;Milwaukee;Milwaukee;WI;53207;414-661-9598;414-377-2880;gladys@rim.org;http://www.tmbyxbeecompanypc.com
Yuki;Whobrey;Farmers Insurance Group;1 State Route 27;Taylor;Wayne;MI;48180;313-288-7937;313-341-4470;yuki_whob...@aol.com;http://www.farmersinsurancegroup.com
Fletcher;Flosi;Post Box Services Plus;394 Manchester Blvd;Rockford;Winnebago;IL;61109;815-828-2147;815-426-5657;fletcher.fl...@yahoo.com;http://www.postboxservicesplus.com
Bette;Nicka;Sport En Art;6 S 33rd St;Aston;Delaware;PA;19014;610-545-3615;610-492-4643;bette_ni...@cox.net;http://www.sportenart.com
Veronika;Inouye;C 4 

[web2py] Add/Modify Access-Control-Allow-Origin to web2py Service Request

2015-10-14 Thread Ken Smith


I need to create a service that accepts JSON get requests from outside 
domains. When I try to make the request on an outside domain I get error: 
"No 'Access-Control-Allow-Origin' header is present on the requested 
resource."

I have the following code in my app's default.py:

def call():
return service()
@service.jsondef SmallTest(a, b):
response.headers['Access-Control-Allow-Origin'] = '*'  # or restrict 
access to specific origins
return response.json(a + b)

If I access the resource directly (type 
'myappurl/call/json?SmallTest?a=hello=world' in my browser) then this 
works fine.

But when I try to access this with ajax via jQuery on outside domain it 
gets the error I mentioned above.

Thanks for any help you can provide.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] qrcode

2015-10-14 Thread Carlos Costa
http://www.web2pyslices.com/slice/show/1462/qr-code-builder-with-web2py

2015-10-13 18:04 GMT-03:00 Fabiano Almeida :

> Hi all!
>
> How to dynamically generate qr code in web2py?
>
> grateful,
>
> Fabiano.
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Carlos J. Costa
Cientista da Computação  | BS Computer Science
Esp. Gestão em Telecom   | PgC Telecom Mangement
<º))><

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread Prasad M
I am trying to import data from csv in web2py's SQlite databae. 
1) First I have defined table in database.
2) I wrote db.table2.import_from_csv_file(open(open('mycsv','r')) this line 
. 
Both steps are in Model. 

But while displaying data from the same table I am getting repeated rows at 
each refresh of the page. It means each time file appends data to table. 

So my question is how to solve this issue? 
Exactly where to write code for import data from csv to table? This is my 
query. 
I am trying to get this from 2 days.
Please try to answer. 
Thank you in advanced 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Filtering a set of items from a collection issues

2015-10-14 Thread John Smidt
That worked! Thanks for the quick help!

On Tuesday, October 13, 2015 at 9:52:47 PM UTC-6, Anthony wrote:
>
>
>
> On Tuesday, October 13, 2015 at 12:21:10 PM UTC-4, John Smidt wrote:
>>
>> Ok, I get how the IS_IN_SET needs a filtered set as the first argument 
>> but now I'm not sure how to get the current_collection_id? This is all 
>> dealing with a SQLFORM.grid and my .requires statement is in my model so 
>> how do I get the id of the collection that was selected from the grid into 
>> my model for the filter?
>>
>
> First, no reason not to use IS_IN_DB -- it is designed for this purpose.
>
> Regarding the current collection ID, you can just set the validator within 
> your controller (after you get the current ID) -- the "requires" attribute 
> of a field can be changed at any time before the actual validation happens. 
> Another option is to get it from request.vars (if the current request 
> doesn't involve the controller action in question, then the value will 
> simply be None).
>
> Anthony
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Michael,

With your example, return this:

Qrpage
> StringIO:
> ToQRData:Fabiano Likes MLP:FIMimg: 0x7f02d1c0a9d0>img_tag: src="data:image/png;base64,iVBORw0KGgoNSUhEUgAAAQ4AAAEOAQBQysQIAAAB0klEQVR4nO2aQY7cIBBFXwVLs4Qb5Cj4BjnT3MwcZQ4wEl6OBPpZgJ3OIhopTnpsC1YNfouvUulTRbWJT1b99hkBA/nD0rL/ksq29WU79eVMcq+HeElSgRSAmPsXSZKW08m9GlLNLAAxO5G+lx7iZGZP13JfpIVzfZFew1druR8Ss9MvZ/haLfdAJsAJqJBmh+E/jJgrRD1Zy/2QCVbbNv7dlH6AUninn/pTyb0Y0kuDtjLtQns806jIjiDJzMxCNbPgRDOKdcLmdcLms8m9FIIWX9CCE/iCFi9p8RIxu5G7xxCk7NQ6tKjSTIG4G8Xo1Y4gPVmVnVrX1nIXAC+N6B5C+uuC1B8WNlMAKTffOJPciyHNcrvv4lqZ0NK2Vw8jun+P9FutPY/5PbBbOTac4V8gyV5EfDPrnfA6tXMpn1HulZDWCZvN+6tuCtX6CqeTeyHksS/r5cJePeA0brWDSNqyFFYzYq6mhWrgCzafTe7VkH02EduAwsnm5hbP13JDZJtNpADgP1oW29xS+XRyL4u4/rqwsJVqr+NWO4BMj5t1KobPWBQQ36bnarkf8jibwGeIS52UDMDruVruh/w2m6D2YMcc6B/GbOIAYuO/OP8R+Qk7Fi5D47GUFwBJRU5ErkJggg==">
> output:qr: instance at 0x7f02d1bf40e0>qrcode: '/usr/local/lib/python2.7/dist-packages/qrcode-5.1-py2.7.egg/qrcode/__init__.pyc'>
>

How to show de picture + text message?

thx

2015-10-14 13:05 GMT-03:00 Michael M :

> def qrpage():
> #Install Python Modules: (Pillow,qrcode)
> #https://github.com/lincolnloop/python-qrcode
>
> ToQRData = auth.user.username + ' Likes MLP:FIM'
> import qrcode
> import StringIO
> qr = qrcode.QRCode(
> version=1,
> error_correction=qrcode.constants.ERROR_CORRECT_L,
> box_size=10,
> border=1,
> )
> qr.add_data(ToQRData)
> qr.make(fit=True)
>
> # use an in-memory object to save
> output = StringIO.StringIO()
> img = qr.make_image()
> img.save(output)
>
> # and the use getvalue() method to get the string
> img_tag = '' %
> output.getvalue().encode('base64').replace('\n', '')
> return locals()
>
>
> On Tuesday, October 13, 2015 at 2:05:23 PM UTC-7, Fabiano Almeida wrote:
>>
>> Hi all!
>>
>> How to dynamically generate qr code in web2py?
>>
>> grateful,
>>
>> Fabiano.
>>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Add/Modify Access-Control-Allow-Origin to web2py Service Request

2015-10-14 Thread Leonel Câmara
Do you have crossDomain: true in your jquery ajax request options?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Stifan

I installed the semanticwebexample and not found reference to qr code on it.

thx

2015-10-13 18:28 GMT-03:00 黄祥 :

> i think there is web2py appliances that create some thing like this before
> : semanticwebexample
>
> 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 are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Richard,

elaphe worked! thank you!

How to show a text message with qrcode on same page?

Thx

2015-10-13 21:07 GMT-03:00 Richard Vézina :

> You can have a look on the side of elaphe :
> https://bitbucket.org/whosaysni/elaphe/
>
> For most type of code it works... But there were issue with bouding box
> for some of them in the pass, hope it has been solve since then...
>
> Richard
>
> On Tue, Oct 13, 2015 at 5:28 PM, 黄祥  wrote:
>
>> i think there is web2py appliances that create some thing like this
>> before : semanticwebexample
>>
>> 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 are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Custom login form error display

2015-10-14 Thread Krzysztof Socha

>
>
> Note, if you use form.custom.widget.fieldname in a custom form, you still 
> get errors displayed automatically (the error is part of the widget 
> object). The example linked above shows the hiderror option being used. In 
> that case, you are explicitly suppressing the automatic error display (this 
> affects standard forms as well as custom forms). In the example shown, 
> instead of showing errors within the form itself (the default automatic 
> behavior), the errors are manually inserted all together at the top of the 
> form.
>  
>

I have a similar problem, but a bit more complicated... I have a SQLFORM 
(form) and a SQLFORM.grid (grid) in one view. The grid can be edited, and 
one of the fields uses a custom widget. I have no clue how to get to the 
errors of that field to show them properly. If I use the form.errors, I get 
only the errors for the 'form'. How do I get the errors for the 'grid'? I 
tried grid.errors, but only get an error saying that DIV element has no 
attribute 'errors'...

Any thoughts?

Krzysztof.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] cache.action decorator generates an error

2015-10-14 Thread Krzysztof Socha
Hi,

I am trying to configure caching on my site, but it does not seem to work. 
As soon as I use the cache.action decorator, such as:

@cache.action(time_expire=0,cache_model=cache.ram)

for any action in the controller, I get an exception thrown with:

*'session_' local variable referenced before assignment*

It works with *cache_model=None*, but this is not exactly what I want 

web2py version:

2.12.3-stable+timestamp.2015.08.19.00.18.03
(Running on nginx/1.4.6, Python 2.7.6)

Any thoughts on this?

Regards,
Krzysztof.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: CMS WEB2PY

2015-10-14 Thread Massimo Di Pierro
Is the CMS you talk about built with web2py?

On Tuesday, 13 October 2015 08:17:20 UTC-5, Carlos Cesar Caballero wrote:
>
> I am working on a site that is builded using custom made CMS, I am 
> planning to release it to github when it's finished (the cms), right now 
> you can see the site (work in progress) at www.daxslab.com, suggestions 
> and criticism are very welcomed
>
> El 12/10/15 a las 06:09, Paolo Amboni escribió:
>
> Are there some contraindications to use web2py with php based cms like 
> joomla?
>
> Il giorno sabato 10 ottobre 2015 18:34:55 UTC+2, Anthony ha scritto: 
>>
>> If it has to be Python, there are several Django based CMSes -- Wagtail 
>> looks like a nice one (there's also Mezzanine and 
>> Django CMS).
>>
>> Anthony
>>
>> On Saturday, October 10, 2015 at 3:32:22 AM UTC-4, Paolo Amboni wrote: 
>>>
>>> After some research i finally concluded that there is no stable and 
>>> structured CMS made for web2py (tell me if i'm wrong).
>>> Which is a python cms that better can be put beside a web2py site 
>>> (already made)?
>>> Thanks.
>>>
>> -- 
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-10-14 Thread Gerd
+1

Am Sonntag, 11. Oktober 2015 21:21:16 UTC+2 schrieb Francisco Ribeiro:
>
> Hello all,
>
> for those who know PyCharm is a great IDE from JetBrains that provides 
> free licenses for Open Source projects like web2py ( 
> https://www.jetbrains.com/buy/opensource/?product=pycharm ). To request 
> such a license, I need to know how many of you would want one of these as 
> well so I can provide them with a number of seats. 
>
> A "+1" response for me is enough but I will also need your email address 
> to send you the license key (which you can send on a private message).
>
> Kind regards,
> Francisco
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Michael M
create a default/qrpage.html

insert this   {{=XML(img_tag)}}

On Wednesday, October 14, 2015 at 10:59:25 AM UTC-7, Fabiano Almeida wrote:
>
> Hi Michael,
>
> With your example, return this:
>
> Qrpage
>> StringIO:
>> ToQRData:Fabiano Likes MLP:FIMimg:> 0x7f02d1c0a9d0>img_tag:> src="data:image/png;base64,iVBORw0KGgoNSUhEUgAAAQ4AAAEOAQBQysQIAAAB0klEQVR4nO2aQY7cIBBFXwVLs4Qb5Cj4BjnT3MwcZQ4wEl6OBPpZgJ3OIhopTnpsC1YNfouvUulTRbWJT1b99hkBA/nD0rL/ksq29WU79eVMcq+HeElSgRSAmPsXSZKW08m9GlLNLAAxO5G+lx7iZGZP13JfpIVzfZFew1druR8Ss9MvZ/haLfdAJsAJqJBmh+E/jJgrRD1Zy/2QCVbbNv7dlH6AUninn/pTyb0Y0kuDtjLtQns806jIjiDJzMxCNbPgRDOKdcLmdcLms8m9FIIWX9CCE/iCFi9p8RIxu5G7xxCk7NQ6tKjSTIG4G8Xo1Y4gPVmVnVrX1nIXAC+N6B5C+uuC1B8WNlMAKTffOJPciyHNcrvv4lqZ0NK2Vw8jun+P9FutPY/5PbBbOTac4V8gyV5EfDPrnfA6tXMpn1HulZDWCZvN+6tuCtX6CqeTeyHksS/r5cJePeA0brWDSNqyFFYzYq6mhWrgCzafTe7VkH02EduAwsnm5hbP13JDZJtNpADgP1oW29xS+XRyL4u4/rqwsJVqr+NWO4BMj5t1KobPWBQQ36bnarkf8jibwGeIS52UDMDruVruh/w2m6D2YMcc6B/GbOIAYuO/OP8R+Qk7Fi5D47GUFwBJRU5ErkJggg==">
>> output:qr:> instance at 0x7f02d1bf40e0>qrcode:> '/usr/local/lib/python2.7/dist-packages/qrcode-5.1-py2.7.egg/qrcode/__init__.pyc'>
>>
>
> How to show de picture + text message?
>
> thx
>
> 2015-10-14 13:05 GMT-03:00 Michael M :
>
>> def qrpage():
>> #Install Python Modules: (Pillow,qrcode)
>> #https://github.com/lincolnloop/python-qrcode
>> 
>> ToQRData = auth.user.username + ' Likes MLP:FIM'
>> import qrcode
>> import StringIO
>> qr = qrcode.QRCode(
>> version=1,
>> error_correction=qrcode.constants.ERROR_CORRECT_L,
>> box_size=10,
>> border=1,
>> )
>> qr.add_data(ToQRData)
>> qr.make(fit=True)
>>
>> # use an in-memory object to save
>> output = StringIO.StringIO()
>> img = qr.make_image()
>> img.save(output)
>>
>> # and the use getvalue() method to get the string
>> img_tag = '' % 
>> output.getvalue().encode('base64').replace('\n', '')
>> return locals()
>>
>>
>> On Tuesday, October 13, 2015 at 2:05:23 PM UTC-7, Fabiano Almeida wrote:
>>>
>>> Hi all!
>>>
>>> How to dynamically generate qr code in web2py?
>>>
>>> grateful,
>>>
>>> Fabiano.
>>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Michael M
Glad it worked for you!

I like the method that I found(just took three working pieces and pushed 
together) because no static files are generated using StringIO memory and 
encoding it with Base64.  (as far as I know)  ;)

On Wednesday, October 14, 2015 at 12:11:25 PM UTC-7, Fabiano Almeida wrote:
>
> Hi Michael,
>
> 2015-10-14 16:00 GMT-03:00 Michael M :
>
>> {{=XML(img_tag)}}
>
>
> It worked! Grateful for all!
>
> Fabiano.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 11:03:01 AM UTC-7, Prasad M wrote:
>
> I am trying to import data from csv in web2py's SQlite databae. 
> 1) First I have defined table in database.
> 2) I wrote db.table2.import_from_csv_file(open(open('mycsv','r')) this 
> line . 
> Both steps are in Model. 
>
> But while displaying data from the same table I am getting repeated rows 
> at each refresh of the page. It means each time file appends data to table. 
>

Models get run every time the page is displayed (including refreshes).  So 
you are doing the import (step 2) ) each time you refresh.  You either need 
logic to only run the import once, or you need to remove the import from 
the model.

What are you trying to do with the import?  One use is to initialize the 
table with known data when installing it in a new host.  In that case, the 
logic could be something like db().select(db.table2.id > 0).count()  > 0.

/dps


> So my question is how to solve this issue? 
> Exactly where to write code for import data from csv to table? This is my 
> query. 
> I am trying to get this from 2 days.
> Please try to answer. 
> Thank you in advanced 
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 11:57:30 AM UTC-7, Richard wrote:
>
> if db(db.table.id > 0).count() == 0:
> db.table2.import_from_csv_file(open(open('mycsv','r'))
>
> So it will be executed only once...
>
> Richard
>

You type too fast!

/dps
 

>
> On Wed, Oct 14, 2015 at 10:48 AM, Prasad M  > wrote:
>
>> I am trying to import data from csv in web2py's SQlite databae. 
>> 1) First I have defined table in database.
>> 2) I wrote db.table2.import_from_csv_file(open(open('mycsv','r')) this 
>> line . 
>> Both steps are in Model. 
>>
>> But while displaying data from the same table I am getting repeated rows 
>> at each refresh of the page. It means each time file appends data to table. 
>>
>> So my question is how to solve this issue? 
>> Exactly where to write code for import data from csv to table? This is my 
>> query. 
>> I am trying to get this from 2 days.
>> Please try to answer. 
>> Thank you in advanced 
>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread Richard Vézina
:)

Richard

On Wed, Oct 14, 2015 at 3:00 PM, Dave S  wrote:

>
>
> On Wednesday, October 14, 2015 at 11:57:30 AM UTC-7, Richard wrote:
>>
>> if db(db.table.id > 0).count() == 0:
>> db.table2.import_from_csv_file(open(open('mycsv','r'))
>>
>> So it will be executed only once...
>>
>> Richard
>>
>
> You type too fast!
>
> /dps
>
>
>>
>> On Wed, Oct 14, 2015 at 10:48 AM, Prasad M  wrote:
>>
>>> I am trying to import data from csv in web2py's SQlite databae.
>>> 1) First I have defined table in database.
>>> 2) I wrote db.table2.import_from_csv_file(open(open('mycsv','r')) this
>>> line .
>>> Both steps are in Model.
>>>
>>> But while displaying data from the same table I am getting repeated rows
>>> at each refresh of the page. It means each time file appends data to table.
>>>
>>> So my question is how to solve this issue?
>>> Exactly where to write code for import data from csv to table? This is
>>> my query.
>>> I am trying to get this from 2 days.
>>> Please try to answer.
>>> Thank you in advanced 
>>>
>>> --
>>> 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 unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Michael,

2015-10-14 16:00 GMT-03:00 Michael M :

> {{=XML(img_tag)}}


It worked! Grateful for all!

Fabiano.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread Richard Vézina
if db(db.table.id > 0).count() == 0:
db.table2.import_from_csv_file(open(open('mycsv','r'))

So it will be executed only once...

Richard

On Wed, Oct 14, 2015 at 10:48 AM, Prasad M 
wrote:

> I am trying to import data from csv in web2py's SQlite databae.
> 1) First I have defined table in database.
> 2) I wrote db.table2.import_from_csv_file(open(open('mycsv','r')) this
> line .
> Both steps are in Model.
>
> But while displaying data from the same table I am getting repeated rows
> at each refresh of the page. It means each time file appends data to table.
>
> So my question is how to solve this issue?
> Exactly where to write code for import data from csv to table? This is my
> query.
> I am trying to get this from 2 days.
> Please try to answer.
> Thank you in advanced 
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: CMS WEB2PY

2015-10-14 Thread Carlos Cesar Caballero Díaz

Yes, it is.

Right now is a set of CMS functionalities for web2py apps as posts, 
pages, comments, tagging and a dashboard (with internationalization 
support for multilingual sites), in this moment I am working in the 
authorization system that is very basic.


I don't like the most of CMSs because we need a huge code base for only 
the functionalities that we need. Because of that, the goal, right now, 
is not to build a web2py wordpress, but something that we can dismantle 
and take only the parts that we need for build an application.


Cheers.

El 14/10/15 a las 14:01, Massimo Di Pierro escribió:

Is the CMS you talk about built with web2py?

On Tuesday, 13 October 2015 08:17:20 UTC-5, Carlos Cesar Caballero wrote:

I am working on a site that is builded using custom made CMS, I am
planning to release it to github when it's finished (the cms),
right now you can see the site (work in progress) at
www.daxslab.com , suggestions and
criticism are very welcomed

El 12/10/15 a las 06:09, Paolo Amboni escribió:

Are there some contraindications to use web2py with php based cms
like joomla?

Il giorno sabato 10 ottobre 2015 18:34:55 UTC+2, Anthony ha scritto:

If it has to be Python, there are several Django based CMSes
-- Wagtail looks like a nice one
(there's also Mezzanine and Django CMS).

Anthony

On Saturday, October 10, 2015 at 3:32:22 AM UTC-4, Paolo
Amboni wrote:

After some research i finally concluded that there is no
stable and structured CMS made for web2py (tell me if i'm
wrong).
Which is a python cms that better can be put beside a
web2py site (already made)?
Thanks.

-- 
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 unsubscribe from this group and stop receiving emails from it,
send an email to web2py+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout
.


--
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 unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.




--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] how to return nothing

2015-10-14 Thread Alex Glaros
how to get function to return nothing?

Goal is simply to avoid pages of records on html page as function runs

def utility_change_column_name(): #used once in a while by programmer.  Not 
used by users.
  for r in db.PostalCode:
  db((r.update(r.countryCode = r.countryCodeFromGeoNames))
  return(nothing)

thanks,

Alex Glaros

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-10-14 Thread Carlos Costa
+1

2015-10-14 19:41 GMT-03:00 Stuart Rolinson :

> +1
>
> Thanks,
> Stuart
>
> On Sunday, October 11, 2015 at 12:21:16 PM UTC-7, Francisco Ribeiro wrote:
>>
>> Hello all,
>>
>> for those who know PyCharm is a great IDE from JetBrains that provides
>> free licenses for Open Source projects like web2py (
>> https://www.jetbrains.com/buy/opensource/?product=pycharm ). To request
>> such a license, I need to know how many of you would want one of these as
>> well so I can provide them with a number of seats.
>>
>> A "+1" response for me is enough but I will also need your email address
>> to send you the license key (which you can send on a private message).
>>
>> Kind regards,
>> Francisco
>>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Carlos J. Costa
Cientista da Computação  | BS Computer Science
Esp. Gestão em Telecom   | PgC Telecom Mangement
<º))><

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] how to return nothing

2015-10-14 Thread Alex Glaros
does anyone see anything wrong with the update syntax?

def utility_change_column_name(): #used once in a while by programmer. Not 
used by users.
for r in db.PostalCode:
db(db.PostalCode).update(r.countryCode = r.countryCodeFromGeoNames)
return dict()

am getting 
 keyword can't be an expression

  File "C:\alex\alt_web2py\web2py\gluon\restricted.py", line 209, in compile2
return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec')
  File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/default.py" 
, line 5924
db(db.PostalCode.id).update(r.countryCode = r.countryCodeFromGeoNames)
SyntaxError: keyword can't be an expression

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: _onkeyup / ajax call

2015-10-14 Thread Mark Billion
NM.  I injected the jquery into the header.  

On Wednesday, October 14, 2015 at 2:22:39 PM UTC-4, Mark Billion wrote:
>
> Im pulling my hair out. . . . 
>
> Im using an inline call to the web2py ajax function via the controller as 
> below:
>
> ajax_form.element('#Debts_creditor')['_onkeyup'] = 
> "ajax('https:.../t2/default/cred_selector', ['creditor'], 'suggestions');"
>
> The goal is for this ajax call to control a div that I am inserting in a 
> dynamically created iframe div, per below.
>
> Ive been at this for two days and cannot for the life of me figure out 
> what Im doing wrong.  Any help would be much appreciated.
>
> 
> 
> $('.iframe_input').click(function(){
> var element = $(this).attr('name');
> $('#iframe_target').html('');
> 
> });
> 
> 
> function row_adder() {
> 
> var iframe = document.getElementById('myFrame'),
> iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
> $(iframeDoc).find('#Debts_creditor__row').after(' id="suggestions">here');
> 
> }
> 
> 
>
>
>
> def cred_selector():
> if not request.vars.creditor:
> return ""
> else:
> click_string = "jQuery('#Debts_creditor').val('%s'); 
> jQuery('#Debts_street_1').val('%s'); \
> jQuery('#Debts_street_2').val('%s'); 
> jQuery('#Debts_zip_code').val('%s')"
>
> pattern = request.vars.creditor + '%'
> selected = [[row.creditor, row.street_1, row.street_2, 
> row.zip_code] for row in 
> db(db.preferred_creditor.creditor.like(pattern)).select()]
> 
> return ''.join([DIV(k[0], _onclick=click_string %(k[0], k[1], 
> k[2], k[3]), 
> 
> _onmouseover="this.style.backgroundColor='grey'",
> 
> _onmouseout="this.style.backgroundColor='white'").xml() for k in selected])
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How to import data from csv file in web2py for SQLite database?

2015-10-14 Thread 黄祥
another way around i think you can create a function (e.g. 
import_data_csv.py) in controller or modules and access it (web browser or 
terminal)

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 are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] how to return nothing

2015-10-14 Thread Tito Garrido
try:

return dict()

On Wed, Oct 14, 2015 at 6:43 PM, Alex Glaros  wrote:

> how to get function to return nothing?
>
> Goal is simply to avoid pages of records on html page as function runs
>
> def utility_change_column_name(): #used once in a while by programmer.
> Not used by users.
>   for r in db.PostalCode:
>   db((r.update(r.countryCode = r.countryCodeFromGeoNames))
>   return(nothing)
>
> thanks,
>
> Alex Glaros
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-10-14 Thread Stuart Rolinson
+1

Thanks,
Stuart

On Sunday, October 11, 2015 at 12:21:16 PM UTC-7, Francisco Ribeiro wrote:
>
> Hello all,
>
> for those who know PyCharm is a great IDE from JetBrains that provides 
> free licenses for Open Source projects like web2py ( 
> https://www.jetbrains.com/buy/opensource/?product=pycharm ). To request 
> such a license, I need to know how many of you would want one of these as 
> well so I can provide them with a number of seats. 
>
> A "+1" response for me is enough but I will also need your email address 
> to send you the license key (which you can send on a private message).
>
> Kind regards,
> Francisco
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: _onkeyup / ajax call

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 2:30:03 PM UTC-7, Mark Billion wrote:
>
> NM.  I injected the jquery into the header.  
>

Element selection?

/dps
 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-10-14 Thread Carlos Zenteno
Don't want to burst any bubbles, but, I read somewhere that the free 
licenses are for the people that work on the Open Source Projects,
the developers of the projects, not for the people that use the resulting 
product.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to return nothing

2015-10-14 Thread Leonel Câmara
You can actually return None or an empty string.

That said you should use the scheduler instead of you calling it once in a 
while.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Why is https not working (not private) with my implementation of this web2py slice?

2015-10-14 Thread Phillip
 

I need to use https for a page. I am using the following web2py slice:


http://www.web2pyslices.com/slice/show/1507/generate-ssl-self-signed-certificate-and-key-enable-https-encryption-in-web2py


I have tried opening web2py with the following line (with and without [-i 
IP and -p PORT]):


python web2py.py -c 
/Users/Phillip/Desktop/web2pyFiles/web2py/applications/GJBSG/private/ssl_certificate.crt
 
-k 
/Users/Phillip/Desktop/web2pyFiles/web2py/applications/GJBSG/private/ssl_self_signed.key
 
-i 127.0.0.1 -p 8000


but https is declared 'not private' and is crossed out. Because of this, I 
am getting a SSL certificate error when the registration of a service 
worker is attempted.


Must I use a public IP for this purpose?


Please indicate what steps are required to traverse this anomaly 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to return nothing

2015-10-14 Thread Alex Glaros
also, could not get this to work

db(db.PostalCode.id > 0).update(PostalCode.countryCode = 
PostalCode.countryCodeFromGeoNames)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to return nothing

2015-10-14 Thread Alex Glaros
hey Leonel,

do you see anything wrong with syntax for the parts above the return?

this didn't work either:

for r in db.PostalCode: 
db(db.PostalCode.id==r.id).update(countryCode = 
countryCodeFromGeoNames)
db.commit()

thanks,

Alex

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] how to return nothing

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 3:27:31 PM UTC-7, Alex Glaros wrote:
>
> does anyone see anything wrong with the update syntax?
>
> def utility_change_column_name(): #used once in a while by programmer. Not 
> used by users.
> for r in db.PostalCode:
> db(db.PostalCode).update(r.countryCode = r.countryCodeFromGeoNames)
>

shouldn't this be "db(db.PostalCode).update(countryCode = 
r.countryCodeFromGeoNames)" ?
 

> return dict()
>
> am getting 
>  keyword can't be an expression
>
>   File "C:\alex\alt_web2py\web2py\gluon\restricted.py", line 209, in compile2
> return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec')
>   File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/default.py" 
> , line 
> 5924
> db(db.PostalCode.id).update(r.countryCode = r.countryCodeFromGeoNames)
> SyntaxError: keyword can't be an expression
>
>
/dps
 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] how to return nothing

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 5:31:59 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, October 14, 2015 at 3:27:31 PM UTC-7, Alex Glaros wrote:
>>
>> does anyone see anything wrong with the update syntax?
>>
>> def utility_change_column_name(): #used once in a while by programmer. 
>> Not used by users.
>> for r in db.PostalCode:
>>
>
Oh, getting all the column names, er, field names.  Is countryCode a column 
name?
 

> db(db.PostalCode).update(r.countryCode = r.countryCodeFromGeoNames)
>>
>
> shouldn't this be "db(db.PostalCode).update(countryCode = 
> r.countryCodeFromGeoNames)" ?
>

I guess not.  Can you use update() to modify column names?  Or just the 
contents of the field?


/dps
 

>  
>
>> return dict()
>>
>> am getting 
>>  keyword can't be an expression
>>
>>   File "C:\alex\alt_web2py\web2py\gluon\restricted.py", line 209, in compile2
>> return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec')
>>   File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/default.py" 
>> , line 
>> 5924
>> db(db.PostalCode.id).update(r.countryCode = r.countryCodeFromGeoNames)
>> SyntaxError: keyword can't be an expression
>>
>>
> /dps
>  
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Reverse Proxy problem with grid form (bootstrap 3.x)

2015-10-14 Thread Daniel Vogel
I'm still searching for a solution to use auth.wiki behind reverse proxy. 
Sites with SQLFORM are deformed.

I see three capabilities: 

- auth.wiki fix which eliminate the need of "ProxyHTMLURLMap" 
- Fix some layout or css code (temporary fix)
- wait for next web2py release


Am Mittwoch, 9. September 2015 04:48:42 UTC+2 schrieb Daniel Vogel:
>
> Hi,
>
> I use web2py 2.12.3 with auth.wiki. In development mode, no problem with 
> HTML rendering. But behind a Apache reverse proxy in need some rules to 
> change HTML URL's.
>
> ProxyHTMLEnable On
> ProxyHTMLLinks imgsrc
> ProxyHTMLLinks ahref
>
> 
> Require all granted
> ProxyPass http://localhost:8000/eav
> ProxyPassReverse http://localhost:8000/
> ProxyHTMLURLMap http://localhost:8000/eav /eav
> 
>
> With this settings the grid form is deformed, the first search field is as 
> high as the display. If I remove the "ProxyHTMLURLMap", it's ok, but all 
> the img URL's has localhost:8000 in auth.wiki.
>
>
>
> 
>
>
>
> How can I fix this problem?
>
>
> Thanks
>
> 
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-10-14 Thread Luis Valladares
+1. Thanks for the info BTW!

El domingo, 11 de octubre de 2015, 14:51:16 (UTC-4:30), Francisco Ribeiro 
escribió:
>
> Hello all,
>
> for those who know PyCharm is a great IDE from JetBrains that provides 
> free licenses for Open Source projects like web2py ( 
> https://www.jetbrains.com/buy/opensource/?product=pycharm ). To request 
> such a license, I need to know how many of you would want one of these as 
> well so I can provide them with a number of seats. 
>
> A "+1" response for me is enough but I will also need your email address 
> to send you the license key (which you can send on a private message).
>
> Kind regards,
> Francisco
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Mod_WSGI deployment problem

2015-10-14 Thread Laurent Lc
It works for me thank you :)

Le mercredi 21 janvier 2009 11:35:13 UTC+1, voltron a écrit :
>
> Hi Massimo! 
>
> thanks for your help. Sadly, that did not work either , another idea? 
>
> Thanks 
>
> On Jan 21, 11:31 am, mdipierro  wrote: 
> > try edit wsgihandler.py and replace this line 
> > 
> > path=os.path.dirname(os.path.abspath(__file__)) 
> > 
> > with 
> > 
> > path='/bla/bla/bla' 
> > 
> > where 
> > 
> > '/bla/bla/bla' should be the absolute path to your web2py folder '/.../ 
> > web2py/' 
> > 
> > and make sure you have the folder gluon in there. 
> > 
> > Massimo 
> > 
> > On Jan 21, 4:09 am, voltron  wrote: 
> > 
> > > I cannot get my site to work using WSGI, this is the error I see in 
> > > the Apache configs: 
> > 
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19] mod_wsgi 
> > > (pid=31101): Target WSGI script '/projects/test_site/wsgihandler.py' 
> > > cannot be loaded as Python module. 
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19] mod_wsgi 
> > > (pid=31101): Exception occurred processing WSGI script '/projects/ 
> > > test_site/wsgihandler.py'. 
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19] Traceback 
> > > (most recent call last): 
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19]   File "/ 
> > > projects/test_site/wsgihandler.py", line 19, in  
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19] import 
> > > gluon.main 
> > > [Wed Jan 21 10:57:11 2009] [error] [client 195.145.60.19] ImportError: 
> > > No module named gluon.main 
> > 
> > > I tried to easy_install web2py, that did not work(easy install fails), 
> > > I also tried placing the Web2py source in the "usr/lib/python2.5" 
> > > folder, that did not help either 
> > 
> > > Does anyone have any idea what I have missed? 
> > 
> > > Thanks

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] 0.db naming convention?

2015-10-14 Thread Tom Campbell
I notice there seems to be a convention that application-specific models go 
in a file named 0.db. Any particular reason for that or inside info that 
makes it easier to work with later? 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: OperationalError: database is locked

2015-10-14 Thread kenny c
Hi Niphlod,

Thank you for this information. 

Could you tell me how you manage to copy new data into db from db2 after 
finishing the scheduler job?

Thank you.

On Friday, November 9, 2012 at 10:31:03 AM UTC-5, Niphlod wrote:
>
> if you can, use a separate db for the scheduler. SQLite doesn't handle 
> well concurrent writes (with default operational capabilities), so having 
> the scheduler operating on the same database of your "insertion" of 
> messages can lead to locks.
>
> Just do 
>
> db = DAL('whatever.db')
> db2 = DAL('whatever_scheduler.db')
>
> db.define_table('messages', .)
>
> from gluon.scheduler import Scheduler
> mysched = Scheduler(db2)
>
> and to queue tasks you can then use
>
> db2.scheduler_tasks.validate_and_insert()
>
> or, with the new API
>
> mysched.queue_task(***)
>
>
>
> On Friday, November 9, 2012 3:56:59 PM UTC+1, Mike Anson wrote:
>>
>> Greetings...
>>
>> I may have a problem with my database (sqlite) locking.
>>
>> Traceback (most recent call last):
>>   File "/home/web2py/src/web2py/gluon/scheduler.py", line 218, in executor
>> result = dumps(_function(*args,**vars))
>>   File "applications/ircmessage/models/tasks.py", line 57, in 
>> send_unsent_messages
>> for row in db(db.messages.status=='unsent').select(db.messages.id, 
>> db.messages.message, db.messages.uid):
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 8787, in select
>> return adapter.select(self.query,fields,attributes)
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 2127, in select
>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1615, in select
>> return self._select_aux(sql,fields,attributes)
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1580, in _select_aux
>> self.execute(sql)
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1693, in execute
>> return self.log_execute(*a, **b)
>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1687, in log_execute
>> ret = self.cursor.execute(*a, **b)
>> OperationalError: database is locked
>>
>> I have a scheduler every minute that get's records (messages) out of the 
>> DB with a status of unsent. The messages then get posted to an IRC channel 
>> and updated to sent to they are not included the next time the scheduler 
>> runs the script.
>>
>> This seems to work just fine.
>>
>> It's when I inject a new message (which by default has a message status 
>> set to unsent) via a bash script. The message inserts fine but my script 
>> that posts it to the IRC channel doesn't not post anything but simply 
>> updates it's status to sent without actually sending it. By sending it I 
>> mean post a message over sockets.
>>
>> Here is my model for sending unsent messages:
>> for row in db(db.messages.status=='unsent').select(db.messages.id, 
>> db.messages.message, db.messages.uid):
>> message_id = row.id
>> message_message = row.message
>> message_uid = row.uid
>> 
>> #socket connection already opened earlier in the script
>> s.send("PRIVMSG %s :%s - %s\r\n" % (channel, message_uid, 
>> message_message))
>> print "message %s has been sent" % message_id
>>
>> ## Only seems to print message when a delay is here.
>> time.sleep(5)
>>
>> ## Set message record to sent and update modified field
>> modified_stamp = strftime("%Y-%m-%d %H:%M:%S")
>> db.messages[message_id] = dict(status='sent', 
>> modified=modified_stamp)
>> 
>> db.commit()
>>
>> Inserting a message via jsonrpc (shown) and cURL (not shown):
>>
>> @service.jsonrpc
>> def savemessage(message, uid):
>> db.messages.insert(message=message, uid=uid)
>> db.commit()
>> 
>> message = {"status":"saved"}
>>
>> return message
>>
>>
>> Should I simply switch to a postgresql or mysql database to prevent this 
>> locking?
>>
>> Thanks for any help/advice in advance
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: OperationalError: database is locked

2015-10-14 Thread kenny c
I guess if SQLite cannot handle many concurrent users while 
writing/reading, should I move to postgres or mongoDB? There will be over 
10k rows added every 10mins.

Thanks.

On Wednesday, October 14, 2015 at 10:03:30 PM UTC-4, kenny c wrote:
>
> Hi Niphlod,
>
> Thank you for this information. 
>
> Could you tell me how you manage to copy new data into db from db2 after 
> finishing the scheduler job?
>
> Thank you.
>
> On Friday, November 9, 2012 at 10:31:03 AM UTC-5, Niphlod wrote:
>>
>> if you can, use a separate db for the scheduler. SQLite doesn't handle 
>> well concurrent writes (with default operational capabilities), so having 
>> the scheduler operating on the same database of your "insertion" of 
>> messages can lead to locks.
>>
>> Just do 
>>
>> db = DAL('whatever.db')
>> db2 = DAL('whatever_scheduler.db')
>>
>> db.define_table('messages', .)
>>
>> from gluon.scheduler import Scheduler
>> mysched = Scheduler(db2)
>>
>> and to queue tasks you can then use
>>
>> db2.scheduler_tasks.validate_and_insert()
>>
>> or, with the new API
>>
>> mysched.queue_task(***)
>>
>>
>>
>> On Friday, November 9, 2012 3:56:59 PM UTC+1, Mike Anson wrote:
>>>
>>> Greetings...
>>>
>>> I may have a problem with my database (sqlite) locking.
>>>
>>> Traceback (most recent call last):
>>>   File "/home/web2py/src/web2py/gluon/scheduler.py", line 218, in 
>>> executor
>>> result = dumps(_function(*args,**vars))
>>>   File "applications/ircmessage/models/tasks.py", line 57, in 
>>> send_unsent_messages
>>> for row in db(db.messages.status=='unsent').select(db.messages.id, 
>>> db.messages.message, db.messages.uid):
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 8787, in select
>>> return adapter.select(self.query,fields,attributes)
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 2127, in select
>>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1615, in select
>>> return self._select_aux(sql,fields,attributes)
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1580, in _select_aux
>>> self.execute(sql)
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1693, in execute
>>> return self.log_execute(*a, **b)
>>>   File "/home/web2py/src/web2py/gluon/dal.py", line 1687, in log_execute
>>> ret = self.cursor.execute(*a, **b)
>>> OperationalError: database is locked
>>>
>>> I have a scheduler every minute that get's records (messages) out of the 
>>> DB with a status of unsent. The messages then get posted to an IRC channel 
>>> and updated to sent to they are not included the next time the scheduler 
>>> runs the script.
>>>
>>> This seems to work just fine.
>>>
>>> It's when I inject a new message (which by default has a message status 
>>> set to unsent) via a bash script. The message inserts fine but my script 
>>> that posts it to the IRC channel doesn't not post anything but simply 
>>> updates it's status to sent without actually sending it. By sending it I 
>>> mean post a message over sockets.
>>>
>>> Here is my model for sending unsent messages:
>>> for row in db(db.messages.status=='unsent').select(
>>> db.messages.id, db.messages.message, db.messages.uid):
>>> message_id = row.id
>>> message_message = row.message
>>> message_uid = row.uid
>>> 
>>> #socket connection already opened earlier in the script
>>> s.send("PRIVMSG %s :%s - %s\r\n" % (channel, message_uid, 
>>> message_message))
>>> print "message %s has been sent" % message_id
>>>
>>> ## Only seems to print message when a delay is here.
>>> time.sleep(5)
>>>
>>> ## Set message record to sent and update modified field
>>> modified_stamp = strftime("%Y-%m-%d %H:%M:%S")
>>> db.messages[message_id] = dict(status='sent', 
>>> modified=modified_stamp)
>>> 
>>> db.commit()
>>>
>>> Inserting a message via jsonrpc (shown) and cURL (not shown):
>>>
>>> @service.jsonrpc
>>> def savemessage(message, uid):
>>> db.messages.insert(message=message, uid=uid)
>>> db.commit()
>>> 
>>> message = {"status":"saved"}
>>>
>>> return message
>>>
>>>
>>> Should I simply switch to a postgresql or mysql database to prevent this 
>>> locking?
>>>
>>> Thanks for any help/advice in advance
>>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Import CSV file

2015-10-14 Thread Dave S


On Wednesday, October 14, 2015 at 11:03:02 AM UTC-7, TheFltube wrote:
>
> Hi folks, glad to join this group
>
> I tried to import in Web2Py the attached CSV file ( no sensible data, just 
> fake info for training ;), after having created the corresponding db.py
>
> It works but only IDs are created for the correct number of rows ( held in 
> CSV ) but no field is actually loaded, they're all empty
>
> If i try to access SqlLite db and import the CSV into the already created 
> table ( by db.py ) , it works like a charm and data are correctly visible 
> and accessible via controllers/views
>
> Sorry ( and apologize ) if the post has already been threaded in another 
> section
>


I think we're going to need to see what your code looks like in order to 
comment sensibly.  How are you getting the file, copied by hand by the 
Admin user, or uploading it through a controller?  How are you importing 
the file once you have it?

I hadn't done this before, as the appadmin console had always done enough 
for me.  But you inspired me to write a controller and whip up a model, and 
give it a shot.  First thing I found out was how much I had forgotten about 
queries since the last time I worked on one.  Then I used SQLFORM, rather 
like the Image Blog in Chapter 3

Because of SQLFORM, I created a table for the forms, with a "something" 
field (string) and a "myfile" field (upload).  Then I created the table I 
wanted to import to.  The accepted form had the filename in 
form.var.myfile, so I just plugged that into the csv import call (hardwired 
the directory portion as a shortcut)..

It was pretty easy, although I did fumble around a bit trying to select an 
ID from request.vars, but that was an unnecessary side trip.  And while the 
upload table is handy for debugging, I will probably put a truncate on it 
because it really is just temporary information.

Ah, I just took a look at your actual csv file.  One difference is that I 
have an id column as a result of "always having done it that way" for 
appadmin, so I cloned an input file and stripped out the id column.  Still 
worked fine.

Dave
/dps

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.