[web2py] Re: relational database example app

2011-06-19 Thread niknok
Google Translate thinks it's Swahili...

On Jun 19, 1:40 pm, Vineet vineet.deod...@gmail.com wrote:
 What is this tongue? (wewe andeya kuja nikufundishe web2py na ubebe
 nyama :D)

 It is my sincere thought that web2py group is for sharing the
 knowledge within the community.
 Kindly write something which others can understand.
 For any personal matter, one can use emails.

 On Jun 18, 11:26 am, kesh johnmah...@gmail.com wrote:







  wewe andeya kuja nikufundishe web2py na ubebe nyama :D

  On May 24, 11:46 pm, Markandeya mrc55...@gmail.com wrote:

   Ok i found some appliances on the Appliances web page and that is very
   helpful. Which ones are considered good coding standards/practices to
   follow?? Which would you advise to get started with??
   Any recommendations or suggestions would be appreciated. Thanks again,
   Markandeya


[web2py] Re: Social network plug-in

2011-06-19 Thread niknok
Can someone post this somewhere where resume download is supported? I
got a crappy connection right now...

On Jun 12, 12:09 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Here is the source of the facebook clone

  web2py.app.friends.w2p
 1002KViewDownload


[web2py] FORM Field change keyboary reaction type

2011-06-19 Thread max
Is there any way to change the behaviour of the field in web2py.
I want to use the ente rkey in the   number side of the keyboard for
jumping into the next field.
looks like there is something similar in the  multiple value columns.



[web2py] Help with db.import_from_csv_file()?

2011-06-19 Thread Wei Wang
Greetings!

I have a simple form, which takes in a CSV file name and upload the file for 
import to database.

This is the code to import uploaded data:

if form.accepts(request.vars, session):
response.flash = 'Form accepted'
db.import_from_csv_file(request.vars.csvfile.file)

In the database db, I have a table unit:

db.define_table('unit',
Field('org', db.org, requires=IS_NOT_EMPTY()),
Field('type', type='integer', label=T('Unit Type'), 
requires=IS_NOT_EMPTY(),),
Field('name', type='string', label=T('Unit Name'), 
requires=IS_NOT_EMPTY(),))

The problem is: When I upload the file below, I get all NULL's for the 
unit.type field.

TABLE unit
unit.org,unit.type,unit.name
1,1,Unit 10
1,1,Unit 12
1,1,Unit 13
1,1,Unit 14
1,1,Unit 15
1,1,Unit 16
1,1,Unit 17
1,1,Unit 18
1,1,Unit 7
1,1,Unit 8
1,1,Unit 9
1,2,Unit 10
1,2,Unit 19
1,3,Unit 13
1,3,Unit 14
1,3,Unit 15
1,3,Unit 17
1,3,Unit 18
1,3,Unit 19
1,3,Unit 4
1,3,Unit 6
1,3,Unit 8
1,3,Unit 9
2,1,Unit 22
2,1,Unit 23
2,2,Unit 20
2,3,Unit 21
3,1,Unit 32
3,1,Unit 34
3,3,Unit 31
3,3,Unit 33
4,1,Unit 37
4,1,Unit 42
4,2,Unit 39
4,2,Unit 44
4,2,Unit 47
4,3,Unit 45
4,3,Unit 48

END

Help is much appreciated.


[web2py] Re: Help with db.import_from_csv_file()?

2011-06-19 Thread Massimo Di Pierro
This is a bug that has been fixed in trunk. Sorry about it.

Massimo

On Jun 19, 1:55 am, Wei Wang ww9riv...@gmail.com wrote:
 Greetings!

 I have a simple form, which takes in a CSV file name and upload the file for
 import to database.

 This is the code to import uploaded data:

     if form.accepts(request.vars, session):
         response.flash = 'Form accepted'
         db.import_from_csv_file(request.vars.csvfile.file)

 In the database db, I have a table unit:

 db.define_table('unit',
         Field('org', db.org, requires=IS_NOT_EMPTY()),
         Field('type', type='integer', label=T('Unit Type'),
 requires=IS_NOT_EMPTY(),),
         Field('name', type='string', label=T('Unit Name'),
 requires=IS_NOT_EMPTY(),))

 The problem is: When I upload the file below, I get all NULL's for the
 unit.type field.

 TABLE unit
 unit.org,unit.type,unit.name
 1,1,Unit 10
 1,1,Unit 12
 1,1,Unit 13
 1,1,Unit 14
 1,1,Unit 15
 1,1,Unit 16
 1,1,Unit 17
 1,1,Unit 18
 1,1,Unit 7
 1,1,Unit 8
 1,1,Unit 9
 1,2,Unit 10
 1,2,Unit 19
 1,3,Unit 13
 1,3,Unit 14
 1,3,Unit 15
 1,3,Unit 17
 1,3,Unit 18
 1,3,Unit 19
 1,3,Unit 4
 1,3,Unit 6
 1,3,Unit 8
 1,3,Unit 9
 2,1,Unit 22
 2,1,Unit 23
 2,2,Unit 20
 2,3,Unit 21
 3,1,Unit 32
 3,1,Unit 34
 3,3,Unit 31
 3,3,Unit 33
 4,1,Unit 37
 4,1,Unit 42
 4,2,Unit 39
 4,2,Unit 44
 4,2,Unit 47
 4,3,Unit 45
 4,3,Unit 48

 END

 Help is much appreciated.


[web2py] Re: Help with db.import_from_csv_file()?

2011-06-19 Thread Wei Wang
I think I may have found out why that was happening.

In the latest version of dal.py, lines 4765-4766 read:

elif field.type in ('double','integer'):
value = None

That basically eliminates any data of type double or integer. Commenting 
those two lines and restart web2py seems to work for my import.

Now, why does the Table.import_from_csv_file() method does something like 
that?


[web2py] Re: Help with db.import_from_csv_file()?

2011-06-19 Thread Wei Wang
OK. :-) Thanks!


Re: Re : Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation

2011-06-19 Thread Ovidio Marinho
what solution you need?


Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 88269088
   Paraiba-Brasil



2011/6/19 Dwayne dwaynebl...@gmail.com

 Thank you pbreit. Maybe I can pay 30 dollars to the first person who finds
 a solution. And the solution can be posted online obviously.


[web2py] Re: FORM Field change keyboary reaction type

2011-06-19 Thread pbreit
Any behaviors you see are provided by the browser. What you are seeing on a 
multi-down is that some browsers let you press enter to select the current 
entry and move to the next field. To do what you want, you'd need to trap 
keyboard entry using JavaScript, perhaps with onkeydown/onkeypress/onkeyup 
and event.keycode('13')

Here's a short discussion that might help:
http://forums.devx.com/showthread.php?t=6688

But I would strongly recommend against changing this since most users expect 
enter to submit the form.


Re : Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation

2011-06-19 Thread Dwayne
Thank you pbreit. Maybe I can pay 30 dollars to the first person who finds a 
solution. And the solution can be posted online obviously. 

[web2py] Use plugin_wiki widgets in standard views

2011-06-19 Thread José L .
I'd like to use some of the widgets plugin_wiki has (mainly jqgrid and tags) 
, but I don't want to use plugin wiki pages to build the site because I'd 
like to have more flexibility (specially with layouts and javascript).
Is there an easy way to use some of these widgets in a normal view? (I've 
thought of loading a wiki page from the normal page, but I'd like to know if 
there is an easier method)

Regards.


[web2py] Re: Use plugin_wiki widgets in standard views

2011-06-19 Thread José L .
Forget my previous email , I've found the answer in the book:
{{=plugin_wiki.widget('jqgrid',table='... ) }}


[web2py] Re: import error

2011-06-19 Thread selecta
thanks sounds great, i will try first thing tomorrow morning at work,
things are kind of messed up at home right now ...

On Jun 18, 1:39 am, Pierre Thibault pierre.thibau...@gmail.com
wrote:
 2011/6/17 selecta gr...@delarue-berlin.de

  I also have problems importing pygments from the modules directory
 http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.pygments_test...

  i downloaded pygments fromhttp://pypi.python.org/pypi/Pygments

 Do you still have problems with you are using the last version of trunk?

 --

 A+

 -
 Pierre
 My blog and profile
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: Help with db.import_from_csv_file()?

2011-06-19 Thread villas
BTW I used to have problems with field 'type' because it was a reserved word 
on firebird DB.  I have always avoided that name since.


Re : Re: Re : Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation

2011-06-19 Thread Dwayne
Everything is explained here :)
 
https://groups.google.com/d/topic/web2py/QZ11R6eYQdM/discussion


[web2py] problem with using powertable in components

2011-06-19 Thread apple
Just started using powertables. This is a brilliant tool and works
fantastically in most cases. However I have had a problem trying to
load two powertables on a page within components. It seems to show the
two tables correctly but then renders a bunch of extra tables that are
empty and misformatted. If I refresh the screen it also shows an error
warning about not being able to reinitialize the table.

# html view is:

{{extend 'layout.html'}}
link rel=stylesheet type=text/css href=/{{=request.application}}/
static/css/{{=request.application}}.css /

{{=LOAD(f=list, extension=load, ajax=True,
vars=dict(table=customer))}}
{{=LOAD(f=list, extension=load, ajax=True,
vars=dict(table=todo))}}

# load view is:

{{include 'web2py_ajax.html'}}
link rel=stylesheet type=text/css href=/{{=request.application}}/
static/css/base.css /
link rel=stylesheet type=text/css href=/{{=request.application}}/
static/css/{{=request.application}}.css /

div
{{=result}}
/div
 controller just returns a basic table. no fancy hidden
columns or anything.





[web2py] Re: Social network plug-in

2011-06-19 Thread peter
I tried the facebook clone app, and when I logged in using my google
id I got and internal error.

friends/85.211.34.104.2011-06-19.21-09-18.b6e21f1b-1439-46c0-b2f9-
a2d40bee1b20



On Jun 19, 7:41 am, niknok nikolai...@gmail.com wrote:
 Can someone post this somewhere where resume download is supported? I
 got a crappy connection right now...

 On Jun 12, 12:09 am, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:



  Here is the source of the facebook clone

   web2py.app.friends.w2p
  1002KViewDownload- Hide quoted text -

 - Show quoted text -


[web2py] list: reference multiselect

2011-06-19 Thread weheh
Web2py has changed so much in the last 6 months that I figure I should
ask what's the best way to do this. I have a
Field('myfield','list:reference another_table',default=[0]). I want to
represent the field with a multi-select pull-down type of widget
instead of the default multi-select list widget. I want to bind an
ajax function to it as well, if possible. Can someone list or point me
to a cookbook example? Thanks.


[web2py] Re: help: how can I select from list:string

2011-06-19 Thread hywang
thank you :-)

On 6月19日, 下午12时20分, Anthony abasta...@gmail.com wrote:
 db(db.testtable.name.contains('kate')).select()

 Seehttp://web2py.com/book/default/chapter/06#Many-to-Many,-list:type,-and-contains
 .

 Anthony







 On Sunday, June 19, 2011 12:10:14 AM UTC-4, hywang wrote:
  db.define_table(testtable,
      Field(name, list:string)
  )

  table contents are as following:

  
  id            name
  
  1         [jim, kate]
  ---
  2         [tim, kate]
  ---
  3         [tim, kate, green]
  ---

  I want to select rows where name containing kate, how should I write
  the the sql using DAL ?

  thank you


Re: Re : Re: Re : Re: Re : Re: [web2py] Re: Email invitation

2011-06-19 Thread Massimo Di Pierro
OK try this:

def invitation():
form = SQLFORM.factory(Field('email',requires=IS_EMAIL()))
if form.accepts(request):
db.invitation.insert(token = form.vars.email)
MESSAGE = 'click %s to register'
url = URL('user/register',host=request.env.http_host)
mail.send(to=form.vars.email, message=MESSAGE % url)
redirect('success_invitation'))
return dict(message=('Invitation to be sent'),
form=form,address=form.vars.email)

auth.settings.register_onvalidation.append(lambda form:
db.invitation(token=form.vars.email) or
form.errors.update({'email','not allowed'}))
auth.settings.register_onaccept.append(lambda form:
db(db.invitation.token==form.vars.email).delete())


On Jun 4, 9:28 am, Dwayne Blind dwaynebl...@gmail.com wrote:
 Can somebody please help me ? I would really want this to work.

 I customized db.auth_user, as described in the book, to add a 'token'
 field. I just added : Field('token', writable=False, readable=False,
 default='').

 Then, in the controllers, I modified default.py :

 def user():
     db.auth_user.insert(token=request.args(1))
     return dict(form=auth())

 Then in the models, I modified db.py :

 def my_auth_processing(form):
     if db(db.auth_user.token!='')
 (db.invitation.token==db.auth_user.token):
         return True
     else :
         return False

 auth.settings.register_onvalidation.append(lambda form:
 my_auth_processing(form))

 But unfortunately no one is prevented from registering... So this does
 not work.

 Dwayne

 On 2 juin, 02:31, pbreit pbreitenb...@gmail.com wrote:







  Oops. For registration, you use 
  this:http://web2py.com/book/default/chapter/08?search=register_onvalidation


[web2py] Re: list: reference multiselect

2011-06-19 Thread weheh
This is one way it used to be done: 
http://web2pyslices.com/main/slices/take_slice/70

There is also plugin wiki.

Question is, which is the preferred method these days?


[web2py] web2py with Eclipse -- still lots of undefined stuff

2011-06-19 Thread weheh
I'm using web2py 1.96.4 with Eclipse. I put
from gluon import *
in a model I was debugging. Eclipse still shows all the web2py stuff
like db, DIV, session, T, etc. as being undefined variables. What am I
doing wrong?


Re: [web2py] web2py with Eclipse -- still lots of undefined stuff

2011-06-19 Thread Pierre Thibault
2011/6/19 weheh richard_gor...@verizon.net

 I'm using web2py 1.96.4 with Eclipse. I put
from gluon import *
 in a model I was debugging. Eclipse still shows all the web2py stuff
 like db, DIV, session, T, etc. as being undefined variables. What am I
 doing wrong?


All these things are magically imported by web2py. This is not standard
Python programming.

Here a few pointers:

http://pierrethibault.posterous.com/?tag=eclipsepage=2

http://pierrethibault.posterous.com/tag/eclipse

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
YouTube page 
(http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2


[web2py] Re: web2py with Eclipse -- still lots of undefined stuff

2011-06-19 Thread weheh
Hi Pierre, I've read your excellent pages and followed your
instructions before, to good effect. Of course, the downside is that
one ends up with a lot of junk code in the beginning of one's files. I
was under the impression that the latest version of web2py bypassed
all that with a simple 1-liner: from gluon import *  but this doesn't
seem to be the case as it doesn't work for me. Hence, my question and
this thread. Thanks for the quick response!


On Jun 20, 12:16 am, Pierre Thibault pierre.thibau...@gmail.com
wrote:
 2011/6/19 weheh richard_gor...@verizon.net

  I'm using web2py 1.96.4 with Eclipse. I put
     from gluon import *
  in a model I was debugging. Eclipse still shows all the web2py stuff
  like db, DIV, session, T, etc. as being undefined variables. What am I
  doing wrong?

 All these things are magically imported by web2py. This is not standard
 Python programming.

 Here a few pointers:

 http://pierrethibault.posterous.com/?tag=eclipsepage=2

 http://pierrethibault.posterous.com/tag/eclipse

 --

 A+

 -
 Pierre
 My blog and profile
 (http://pierrethibault.posterous.com)http://pierrethibault.posterous.com
 YouTube page 
 (http://www.youtube.com/user/tubetib)http://www.youtube.com/user/tubetib
 Twitter (http://twitter.com/pierreth2) http://twitter.com/pierreth2