[web2py] reading from external db

2016-02-12 Thread yarecki wr
I'm quite new to Python and web2py hence when I started a little project for displaying some stats on a website I quickly got to points where I just got stack. I'll describe one hopefully someone would help with and provide some explanations. Basically it work but for the moment mostly manual wh

[web2py] Column export to txt

2016-12-21 Thread yarecki wr
I have a table defined where I would need to export one column to SMB share as a txt file automatically when a new row gets added? How can this be achieved? Hope it's clear from the question I'm beggining with web2py and python for that matter :) -- Resources: - http://web2py.com - http://web2

[web2py] Re: Column export to txt

2017-01-01 Thread yarecki wr
On Thursday, December 22, 2016 at 12:47:43 AM UTC+1, Dave S wrote: > > On Wednesday, December 21, 2016 at 7:05:57 AM UTC-8, yarecki wr wrote: >> >> I have a table defined where I would need to export one column to SMB >> share as a txt file automatically when a new row

[web2py] Re: Column export to txt

2017-01-04 Thread yarecki wr
> > Testing Anthony's method, although it looks simpler I get an >> AttributeError saying Rows object has no attribute export_to_csv. Also I >> added >> > data = open(myfile).read in the same function I created for the export to txt and created a view for it. This allowed me to get the data ou

[web2py] Re: Column export to txt

2017-01-04 Thread yarecki wr
I found it needs _file and this works fine but then I tried export_to_csv_file(mycsv,'wb', write_colnames=False) and that tells me the argument is incorrect. I also tried calnames=False and represent=False from the BOOK each time getting the error with invalid keyword argument. -- Resources:

[web2py] Re: Column export to txt

2017-01-09 Thread yarecki wr
> the function is just as below > def csv_file(): mycsv=os.path.join(request.folder, 'static', '/tmp/items.csv') db(db.mytable).select(db.mytable.Items).export_to_csv_file(open(mycsv, 'wb', write_colnames=False)) data=open(mycsv).read() return data Then it's being read by a standar

[web2py] Re: Column export to txt

2017-01-09 Thread yarecki wr
Silly newby mistake :) Now works perfect. I read it only to check that the content is actually there as the goal is to somehow get the file to another server that requires authentication (Windows). -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/w