[web2py:14982] join 3 tables & import it into a new table

2009-01-14 Thread somebody

scenario:
I have 3 tables in a db(table1, table2,table3)
   - in table1 = has table1Col.id
   - in table2 = has table2Col.id and table1Col (from
table1.table1Col.id) and other entities
   - in table3 = has table3Col.id and table2Col (from
table2.table2Col.id) and other entities

means. table2 has link with table1 through table1Col.id and table3 has
link with table2 though table2Col.id

Task:
I would like to join these 3 tables together through the Col.id and
import them into a new created table called table4

Own solution (not complete, still have some error but I cannot solve):

 if form.accepts(request.vars,session):
   join_list=db(db.table1Col.id).select(db.table2.table1Col_id)

   for id in db.table2:
   table2id_list.append(id)
   filelist.append(table2.file)
   records=db(db.table3.table2Col_id==id).select
(db.table3.table2Col_id)
   table3ColId_list=db.table2.id

   for id in table3ColId_list:
   filelist.append(table3.file)

   print filelist   #would like to print out the list 1st
before it import into table4


Anyone can help me?? or any guidance how to continue the code above
and import into table4??

 thank alot in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13332] Re: zip a file

2008-12-10 Thread somebody

the code is created to store e table file then now i want to zip the
file after the file is created

On Dec 11, 1:19 pm, mdipierro <[EMAIL PROTECTED]> wrote:
> It depends what do you need to do with the file? Store it or
> return it? Perhps I do not understand the question.
>
> The open() before should be
>
> open(os.path.join(request.folder,'private',table+'.csv'),'w').write(str
> (db(db[table].id).select
>
> because:
> os.path.join is safer than str(os.sep).join
> request.folder already points to your app folder
> your data should go in private, let web2py handle the stuff in the
> other folders.
>
> Massimo
>
> On Dec 10, 10:26 pm, somebody <[EMAIL PROTECTED]> wrote:
>
>
>
> > if form.accepts(request.vars,session):
> >         for table in db.tables:
> >             rows=db(db[table].id).select()
> >             print rows
> >             open(str(os.sep).join([os.getcwd(), 'applications',
> >                 request.application, 'databases',
> >                 table+'.csv']),'w').write(str(db(db[table].id).select
> > ()))
>
> > wher should i put the zip code to zip the file created above?
> > thanks in advance- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13329] zip a file

2008-12-10 Thread somebody

if form.accepts(request.vars,session):
for table in db.tables:
rows=db(db[table].id).select()
print rows
open(str(os.sep).join([os.getcwd(), 'applications',
request.application, 'databases',
table+'.csv']),'w').write(str(db(db[table].id).select
()))



wher should i put the zip code to zip the file created above?
thanks in advance

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12917] import from csv file

2008-12-04 Thread somebody

when i want to import a csv file, i found that it will not overlap the
existing same table's value.

for example. in my db, I have table.db with table.id (with existing
value of 1 and 2) and table.name
when i empty table.db and import table.db, the
table.id become 3 and 4 rather than the
the original values (1 and 2) in the csv file

when i import same csv file, i found that, even the same table.id
( from csv file) will not overlap but it will jus import what ever
values in table.db.

for example, in e existing table.db i have table.id with value 1 and 2
and in csv file i have table.id with value of 1 and 2. when i import,
in the system, the table.id become 1,2,3 and 4 rather than jus 1 and
2..

is there any way to solve above case??
thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12892] upload a folder

2008-12-03 Thread somebody

can I upload a folder / copy a whole folder to another directory??

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:/] AttributeError: 'dict' object has no attribute 'append'

2008-12-02 Thread somebody

wad is e meaning of
AttributeError: 'dict' object has no attribute 'append'

thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12695] zip file

2008-11-30 Thread somebody

any guideline  if i want to create a text file and in the sametime,a
zip text file also been created? and how if I wan to create a input
type "file" with button summit to zip a selected file?

thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12587] Re: create a drop down list in form

2008-11-27 Thread somebody

thanks


On Nov 27, 10:40 pm, DenesL <[EMAIL PROTECTED]> wrote:
> See this 
> thread:http://groups.google.com/group/web2py/browse_thread/thread/b34a263236...
>
> On Nov 27, 2:47 am, somebody <[EMAIL PROTECTED]> wrote:
>
>
>
> > in normal FORM not SQLFORM- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12586] select all tables in sql

2008-11-27 Thread somebody

if db_items.accepts(request.vars,formname='form_one):
   rows=db(db.items.id).select()
   print rows


db(db.items.id).select()  = is just to select the "items" table in db.
how if i want to select all the tables in db??

i tried those but failed
1. dba(dba).select ()
2. dba.select()

anyone can help? thanks in advance




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12549] Re: create a drop down list in form

2008-11-26 Thread somebody


in normal FORM not SQLFORM

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12548] Re: create a drop down list in form

2008-11-26 Thread somebody

in normal FORM not SLQFORM
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12547] create a drop down list in form

2008-11-26 Thread somebody

Is it possible to create a drop down list which listed sql value in
form without any button.. jus pure drop down list..

i have a a drop down list but do not know for what reason there is a
summit button which i do not want..

thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12546] Re: input type

2008-11-26 Thread somebody

so i cannot choose my own directory to save my file..
ok



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12543] input type

2008-11-26 Thread somebody

input type "file" is to choose a file to be uploaded then wad input
type is used to select a directory where a file wan tto be saved to?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12436] Re: have multiple button summits which work on different things in a form

2008-11-24 Thread somebody

thank


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12429] have multiple button summits which work on different things in a form

2008-11-23 Thread somebody

def form():
form=FORM(TABLE(""),
 TR(" ",INPUT
(_name="submit1",_type="submit",_value="SUBMIT")),
 TR(" ",INPUT
(_name="submit2",_type="submit",_value="SUBMIT")),
 TR("",INPUT(_name="submit3",
_type="submit",_value="SUBMIT")),
 TR(" ",INPUT(_name="submit4",
_type="submit",_value="SUBMIT")))

if form.accepts(request.vars,session):
rows=db(db.item.id).select()
print rows
open('c:\\test.csv','w').write(str(db(db.item.id).select()))


return dict(form=form)

IF i only have "if form.accepts(request.vars,session):  "  no
matter which button i click, it will do the same think in if
form.accepts(request.vars,session): .. SO can i specify button submit1
do task 1, submit2 do task 2, submit3 do task 3 and submit4 do task
4?? anyone can help?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11949] Re: create a web2py application which function as sending email

2008-11-16 Thread somebody

Is it possible that I add an upload fuction so the email sent will
attach with an uploaded file?

On Nov 17, 1:33 pm, somebody <[EMAIL PROTECTED]> wrote:
> Thank alot..
> missed that page hahaaa
>
> On Nov 17, 1:08 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
>
>
> >http://mdp.cti.depaul.edu/appliances/default/show/10
>
> > On Nov 16, 10:54 pm, somebody <[EMAIL PROTECTED]> wrote:
>
> > > can we create an application in web2py to send an email?
> > > any help?- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11948] Re: create a web2py application which function as sending email

2008-11-16 Thread somebody

Thank alot..
missed that page hahaaa

On Nov 17, 1:08 pm, mdipierro <[EMAIL PROTECTED]> wrote:
> http://mdp.cti.depaul.edu/appliances/default/show/10
>
> On Nov 16, 10:54 pm, somebody <[EMAIL PROTECTED]> wrote:
>
>
>
> > can we create an application in web2py to send an email?
> > any help?- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11947] Re: Cannot import from CSV file

2008-11-16 Thread somebody

hi are u creating a new module/controller which allow you to export
SQL table value and save them as text file? I know that web2py has
build in CSV but i want to create a new controller which allow you to
export choosenSQL table value and save them as text file?

can you help?
thanks

On Nov 5, 8:50 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote:
> Hello all;
>
> Any one tried importing from CSV file?
>
> I got the error unable to parse but when i try it directly via csv module in
> normal python it parses well.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11946] Re: export sql statement and tables'values save as text file

2008-11-16 Thread somebody

i know that web2py has CSV module. but now I need to create another
controller which allow me to choose which table to export the values
and save them as text file  without click on the originally build in
CSV in web2py

On Nov 12, 10:10 pm, mdipierro <[EMAIL PROTECTED]> wrote:
> from appadmin you can save any table as CSV.
>
> also any statements
>
>    db(...).select(...)
>
> if you replace select with _select,
>
>    db(...)._select(...)
>
> will return the SQL statement without executing it.
>
> you can also replace insert with _insert, count with _count, delete
> with _delete and update with _update
>
> not sure I answered the question.
>
> Massimo
>
> On Nov 12, 7:15 am, somebody <[EMAIL PROTECTED]> wrote:
>
>
>
> > export sql statement and tables'values save as text file in web2py.
> > any guidance?
> > thanks- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11943] create a web2py application which function as sending email

2008-11-16 Thread somebody

can we create an application in web2py to send an email?
any help?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:11732] export sql statement and tables'values save as text file

2008-11-12 Thread somebody

export sql statement and tables'values save as text file in web2py.
any guidance?
thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---