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
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
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
>
> 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
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:
> 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
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
7 matches
Mail list logo