[web2py] Re: Catch auto-login event

2010-05-20 Thread Adi
Sure. Thanks for the update.

On May 21, 9:34 am, mdipierro  wrote:
> need to work on this. On the case but being distracted sorry.
>
> On May 20, 10:50 pm, Adi  wrote:
>
>
>
> > Any help on this?
>
> > On May 20, 3:45 pm, Adi  wrote:
>
> > > Hi,
>
> > > I use the "Remember me for 30 days" feature in our app. I used a
> > > custom auth_table with a column "last_login" to update every time a
> > > user logs into the application.
>
> > > Currently I update it in a function call like this:
> > > ---
> > > def updateLastLogin(form):
>
> > > db(db.auth_user.id==auth.user.id).update(last_login=datetime.datetime.now()
> > >  )
>
> > > auth.settings.login_onaccept = updateLastLogin
>
> > > --
>
> > > However if a user chooses to "remember me for 30 days" then there's no
> > > actual login action. What is the way to track last_login for such
> > > users who visit the app but don't actually login? I basically need it
> > > for analytics.
>
> > > Thanks,
> > > Aditya


[web2py] Re: Debian Packaging

2010-05-20 Thread Trollkarlen
For packaging i sugest using the http://build.opensuse.org.
Its a service where you can package for all mager distros, and have
them all in se same repo.

/T

On 18 Maj, 08:42, José L.  wrote:
> On 17 mayo, 17:32, Mark Breedveld  wrote:
>
>
>
>
>
> > I've been through the material and it's quite straight forward.
> > So we could keep the current packaging system like it's now.
>
> > But we both now that it ain't suitable for debian packaging system.
> > So I have a tiny idea.
>
> > We start working with a major and a tiny release.
> > The major release will not be up to date, but a proven version.
> > And released every quarter or half a year. Just like ubuntu.
>
> > This we make it easier for companies to offer long term support.
> > Which is an important issue for customers.
>
> > It also shows that web2py has reached the status of an mature
> > webserver/framework.
>
> > My excuse for the long waiting for my answer, but I starting my own
> > business.
> > While I'm also busy with school.
>
> > But I've made request on Hogeschool Rotterdam to support web2py.
> > And they where very positieve, so I keep you all posted.
>
> > regards Mark Breedveld,
>
> > On Apr 20, 7:06 pm, Mark Breedveld  wrote:
>
> > > Thank you very much,
> > > This are some of the answers I was looking for.
>
> > > I'll dive into it, tomorrow.
> > > But this gives me an idea about how the release cicle is done.
> > > And how we could implement thedebianpackages in it.
>
> > > Which has been discussed in an 
> > > earlier.http://groups.google.com/group/web2py/browse_frm/thread/51b731d9abb52...
> > > This might give an idea why we want to package web2py.
>
> > > And the reason I started this post was because I had the same
> > > questions as you.
> > > The frequent releases of Massimo etc.
> > > More than enough to discuss,
> > > but first I'll study the answer you give me and come up with an idea
> > > == more questions :p.
>
> > > regards
>
> > > Mark Breedveld,
>
> I've found this thread of discussion today. I'am an official Debian
> developer and was thinking also of packaging web2py for Debian, but
> I've begun to use web2py only a few weeks ago and I prefer to know
> more the framework before trying to package it.
> Anyway, if I've understood it correctly, I've read in this thread that
> you're planning to add the debianization to the web2py sources, so the
> package can be created easily. That's a bad practice from the Debian
> point of view, and package maintainers encourage upstream not to do
> it, unless upstream is the package maintainer. In fact, it's very
> usual that, if upstream sources contain a debian directory, the
> maintainer removes it before adding the definitive one.
>
> The oficial maintainer must know and modify the debianization all the
> time, so he (or they) are who must write it, not upstream. It's the
> maintainer responsability having it in a good shape inside the debian
> repository.
>
> On the other hand, I've also read that you plan to recheck the package
> every quarter of a year. That's not a good practice either, the
> package should be checked when it's needed. I.e: everytime a new
> upstream version is released, on when a bug in the packaging is
> discovered.
>
> If you want to do the Debian package for web2py I recommend you fill a
> ITP (Intend to Package) bug in bugs.debian.org, so you'll be the
> official maintainer of it, and do all the packaging in Debian. Doing
> it in that way, web2py will be in the Debian archive and,
> automatically, in all its derivatives, as Ubuntu.
>
> If you need any help, I can lend you a hand, or even do the
> maintaining of web2py together, but for that, I need more time to know
> the insides of web2py before feeling I can do a good work with it.
>
> Regards.
> José L.


[web2py] Re: Catch auto-login event

2010-05-20 Thread mdipierro
need to work on this. On the case but being distracted sorry.

On May 20, 10:50 pm, Adi  wrote:
> Any help on this?
>
> On May 20, 3:45 pm, Adi  wrote:
>
> > Hi,
>
> > I use the "Remember me for 30 days" feature in our app. I used a
> > custom auth_table with a column "last_login" to update every time a
> > user logs into the application.
>
> > Currently I update it in a function call like this:
> > ---
> > def updateLastLogin(form):
>
> > db(db.auth_user.id==auth.user.id).update(last_login=datetime.datetime.now() 
> > )
>
> > auth.settings.login_onaccept = updateLastLogin
>
> > --
>
> > However if a user chooses to "remember me for 30 days" then there's no
> > actual login action. What is the way to track last_login for such
> > users who visit the app but don't actually login? I basically need it
> > for analytics.
>
> > Thanks,
> > Aditya


[web2py] Re: crud.search()

2010-05-20 Thread mdipierro
def index():
  form,rows = crud.search(db.person)
  return dict(form=form,rows=rows)

On May 20, 9:21 pm, greenpoise  wrote:
> what is the crud.search() about?? I see it as part of the new release.
> Any examples?
>
> thanks


[web2py] Re: Drop Down alternative

2010-05-20 Thread mdipierro
yes.

from gluon.sqlhtml import AutocompleteWidget

db.define_table('mytable',
   Field('person',db.person,requires=IS_IN_DB(db,db.person.id,'%
(name)s')),
   ...)

db.mytable.person.widget=AutocompleteWidget(request,db.person.name,db.person.id,orderby=db.person.name)

On May 20, 9:16 pm, greenpoise  wrote:
> Is there an alternative to drop down? a type ahead type of widget?


[web2py] Re: Script to generate schema (models) from mysql

2010-05-20 Thread mdipierro
Thank you. I will not be able to look at this until tomorrow but I
will.

On May 20, 6:37 pm, Alexandre Andrade 
wrote:
> Some time ago I talk about to do it.
>
> Finally I have to do it.
>
> It can be improved to a form in appadmin, use the model to another db
> (postgresql, etc), and generate the file in /models.
>
> You can see the code below:
>
> --
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> #script to generate schemas from dbs
> #by Alexandre Andrade alexandrema...@gmail.com
> #www.hipercenter.com
>
> #config it here
> passwd="mypass"
> user="myuser"
> host="localhost"
> db = 'mydb'
> port='3306'
>
> def query(bd,sql):
>     bd.query(sql)
>     r = bd.store_result()
>     rows = r.fetch_row(maxrows=0,how=1)
>     return rows
>
> def get_tables():
>     rows = query(bd,'show tables')
>     tables=[]
>     for row in rows:
>         tables.append(row['Tables_in_'+db])
>     return tables
>
> #tables()
>
> def get_fields(table):
>     print table
>     rows = query(bd,'show fields from '+ table)
>     fields=[]
>     for row in rows:
>         #print row
>         fields.append(row)
>     return fields
>
> def field_type(field):
>     if field['Type'][0:7]=='varchar':
>         tipo = ",'string'"
>     elif field['Type'][:8]=='longtext':
>         tipo = ",'text'"
>     elif field['Type'][:3]=='int':
>         tipo = ",'integer'"
>     elif field['Type'][:4]=='date':
>         tipo = ",'date'"
>     elif field['Type'][:7]=='tinyint':
>         tipo = ",'int'"
>     elif field['Type'][:11]=='mediumtext':
>         tipo = ",'text'"
>     elif field['Type'][:4]=='char':
>         tipo = ",'text'"
>     else:
>         print  field['Type'][0:10]
>     return tipo
>
> def primarykey(field):
>     if field['Extra']=='auto_increment':
>         pk = True
>     else:
>         pk = False
>     return pk
>
> def define_table(table):
>     fields =  get_fields(table)
>     result = []
>     head = 'db = DAL("mysql://'+ user+ ':'+passwd+'@'+host+':'+port+'/'+db+'",
> pool_size=10)\r\r'
>
>     line = "db.define_table('"+table+"'"
>     result.append(line)
>     for field in fields:
>         if primarykey(field) == True:
>             pk =field['Field']
>             #print pk
>         tipo = field_type(field)
>         line = "    Field('"+field['Field']+"'"+tipo+")"
>         result.append(line)
>         line
>     try:
>         line = "    primarykey=['"+pk+"']"
>         result.append(line)
>     except:
>         pass
>     out = ',\r'.join(result)
>     output = head + out + '\r)'
>     print output
>     return output
>
> def define_db():
>     tables = get_tables()
>     r = []
>     for table in tables:
>         r.append(define_table(table))
>     result = '\r \r'.join(r)
>     return result
>
> r = define_db()
> f = open('db_'+db+'.py', 'w')
> f.write(r)
> f.close()
>
> ---
>
> --
> Atenciosamente
>
> --
> =
> Alexandre Andrade
> Hipercenter.com
>
>  importdb.py
> 3KViewDownload


[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

2010-05-20 Thread Jason Lotz
Alright now I see a little better what is going. Last night I wasn't
able to check what the jqgrid_editable_plugin really was. To my
surprise it is a very nice web2py plugin. My appologise for pushing
the jqgrid_plugin from web2py/plugins. Although a nice plugin this is
a very feature rich ready plugin.

Anyways, I slightly revised the plugin so that this will work for you.
I will mail it to your private mail.

Once you have replaced the new plugin files you should be able to use
it by implementing the following code.

## controller
def index():
return
dict(jqgrid_table=plugin_editable_jqgrid(db.test,grid_name='grid_test',db_name='db',grid_load=URL(r=request,c='default',f='form'),target='my_form')))

def form():
id = request.args[0]
form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
 
TR("Admin",INPUT(_type="checkbox",_name="admin")),
TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
 
TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
TR("",INPUT(_type="submit",_value="SUBMIT"
if form.accepts(request.vars,session):
response.flash="form accepted"
elif form.errors:
response.flash="form is invalid"
else:
response.flash="please fill the form"
return dict(form=form,vars=form.vars)


## view
{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}
{{=LOAD('default','details',args=1,ajax=True,target='my_form')}}


// Notice the two extra options (grid_load='URL(...)',target='id') in
the controller default/index.
grid_load = url to the form controller function
target = This should match the LOAD(target='id')

Hope this works for you.. :)


On May 21, 1:43 am, Jason Lotz  wrote:
> Can you explain a liitle more? You are actually seeing two forms in  
> the browser?
>
> If I understand you correctly upon first loading the page you get the  
> grid and a form with default id. When you select a row in the grid the  
> default form is not reloaded with the new id but a second form  
> appears. You see a grid and two forms. Is that right?
>
> Double check your id's. It could be that adding the extra jQuery
> ("#grid_id").jqGrid({ onSelectRow:  }) in the view is conflicting  
> with a function in the plugin. I would try making a quick test using  
> the web2py jqgrid_plugin (which is a very nicely integrated plugin )  
> and see if you get the same issue. If not then it is a conflict with  
> your plugin script.
>
> It's passing 1:45am here so I will take a look at this editable_plugin  
> tomorrow morning and see if I can find something, if you haven't  
> solved it by then.
>
> On May 21, 2010, at 0:50, AsmanCom  wrote:
>
>
>
> > You helped me a lot, man!
>
> > i´ve tried like you suggested, i only keeped the LOAD, but it´s the
> > same...
> > Page is loading the Grid, underneath the Grid rises "loading" and then
> > a new layer pops up with with the form in the default Template (Its
> > showed twice).
>
> > I´ve checked:
> >www.web2py.com/AlterEgo/default/show/252
>
> > But it doesent´t helped very much.
>
> > It seems I am stucked, right before finish... ;-(
>
> > Any help is appreciated, would so cool if I could get this done today.
>
> > Dieter Asman
>
> > On 20 Mai, 17:23, Jason Lotz  wrote:
> >> web2py LOAD function will create generate  >> id="target">Loading... and fills your component. I'm sorry I  
> >> can't
> >> test it right now but it seems that by adding the  in your
> >> view and including the LOAD you are creating two form. Maybe try  
> >> remove
> >> your div and only keep the  LOAD.
>
> >> {{extend 'layout.html'}}
> >> This is the default/test.html template
> >> {{=jqgrid_table}}
> >> 
> >> jQuery(document).ready(function()
> >> {jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
> >> {web2py_ajax_page('get','/myapp/default/form/'+
> >> (postdata),null,'my_form');}});
> >> 
> >> {{=LOAD('default','form',args=1,ajax=True,target='my_form')}}
>
> >> check out LOAD function dochttp://www.web2py.com/AlterEgo/default/
> >> show/252
>
> >> On 05/21/2010 12:09 AM, AsmanCom wrote:
>
> >>> Many thanks, it go�s in the right direction now.
>
> >>> I am using thehttp://app.ebansoftware.net/editable_jqgrid/default/
> >>> show_example
> >>> , but it is quite similar.
>
> >>> Now the is loaded is loaded with the default template and then a
> >>> second layer covers it with the form and the default Template(loaded
> >>> twice)
>
> >>> The code so far:
>
> >>> View:
>
> >>> {{extend 'layout.html'}}
> >>> This is the default/test.html template
> >>> {{=jqgrid_table}}
> >>> 
> >>> jQuery(document).ready(function()
> >>> {jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
> >>> {web2py_ajax_page('get','/myapp/default/form/'+
> >>> (postdata),null,'my_form');}});
> >>> 
> >>> 
> >>> {{=LOAD('default','form',args=1,ajax=Tru

[web2py] Re: Catch auto-login event

2010-05-20 Thread Adi
Any help on this?

On May 20, 3:45 pm, Adi  wrote:
> Hi,
>
> I use the "Remember me for 30 days" feature in our app. I used a
> custom auth_table with a column "last_login" to update every time a
> user logs into the application.
>
> Currently I update it in a function call like this:
> ---
> def updateLastLogin(form):
>
> db(db.auth_user.id==auth.user.id).update(last_login=datetime.datetime.now() )
>
> auth.settings.login_onaccept = updateLastLogin
>
> --
>
> However if a user chooses to "remember me for 30 days" then there's no
> actual login action. What is the way to track last_login for such
> users who visit the app but don't actually login? I basically need it
> for analytics.
>
> Thanks,
> Aditya


[web2py] crud.search()

2010-05-20 Thread greenpoise
what is the crud.search() about?? I see it as part of the new release.
Any examples?


thanks



[web2py] Drop Down alternative

2010-05-20 Thread greenpoise
Is there an alternative to drop down? a type ahead type of widget?




[web2py] Script to generate schema (models) from mysql

2010-05-20 Thread Alexandre Andrade
Some time ago I talk about to do it.

Finally I have to do it.

It can be improved to a form in appadmin, use the model to another db
(postgresql, etc), and generate the file in /models.

You can see the code below:

--

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#script to generate schemas from dbs
#by Alexandre Andrade alexandrema...@gmail.com
#www.hipercenter.com

#config it here
passwd="mypass"
user="myuser"
host="localhost"
db = 'mydb'
port='3306'


def query(bd,sql):
bd.query(sql)
r = bd.store_result()
rows = r.fetch_row(maxrows=0,how=1)
return rows

def get_tables():
rows = query(bd,'show tables')
tables=[]
for row in rows:
tables.append(row['Tables_in_'+db])
return tables

#tables()

def get_fields(table):
print table
rows = query(bd,'show fields from '+ table)
fields=[]
for row in rows:
#print row
fields.append(row)
return fields

def field_type(field):
if field['Type'][0:7]=='varchar':
tipo = ",'string'"
elif field['Type'][:8]=='longtext':
tipo = ",'text'"
elif field['Type'][:3]=='int':
tipo = ",'integer'"
elif field['Type'][:4]=='date':
tipo = ",'date'"
elif field['Type'][:7]=='tinyint':
tipo = ",'int'"
elif field['Type'][:11]=='mediumtext':
tipo = ",'text'"
elif field['Type'][:4]=='char':
tipo = ",'text'"
else:
print  field['Type'][0:10]
return tipo

def primarykey(field):
if field['Extra']=='auto_increment':
pk = True
else:
pk = False
return pk

def define_table(table):
fields =  get_fields(table)
result = []
head = 'db = DAL("mysql://'+ user+ ':'+passwd+'@'+host+':'+port+'/'+db+'",
pool_size=10)\r\r'

line = "db.define_table('"+table+"'"
result.append(line)
for field in fields:
if primarykey(field) == True:
pk =field['Field']
#print pk
tipo = field_type(field)
line = "Field('"+field['Field']+"'"+tipo+")"
result.append(line)
line
try:
line = "primarykey=['"+pk+"']"
result.append(line)
except:
pass
out = ',\r'.join(result)
output = head + out + '\r)'
print output
return output

def define_db():
tables = get_tables()
r = []
for table in tables:
r.append(define_table(table))
result = '\r \r'.join(r)
return result

r = define_db()
f = open('db_'+db+'.py', 'w')
f.write(r)
f.close()

---

-- 
Atenciosamente

-- 
=
Alexandre Andrade
Hipercenter.com
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#script to generate schemas from dbs
#by Alexandre Andrade alexandrema...@gmail.com
#www.hipercenter.com

#place your config here
passwd="mypass"
user="myuser"
host="localhost"
db = 'mydb'
port='3306'

import MySQLdb
bd=MySQLdb.connect(host=host,user=user,passwd=passwd,db = db, use_unicode=True)

def query(bd,sql):
bd.query(sql)
r = bd.store_result()
rows = r.fetch_row(maxrows=0,how=1)
return rows

def get_tables():
rows = query(bd,'show tables')
tables=[]
for row in rows:
tables.append(row['Tables_in_'+db])
return tables

#tables()

def get_fields(table):
print table
rows = query(bd,'show fields from '+ table)
fields=[]
for row in rows:
#print row
fields.append(row)
return fields

def field_type(field):
if field['Type'][0:7]=='varchar':
tipo = ",'string'"
elif field['Type'][:8]=='longtext':
tipo = ",'text'"
elif field['Type'][:3]=='int':
tipo = ",'integer'"
elif field['Type'][:4]=='date':
tipo = ",'date'"
elif field['Type'][:7]=='tinyint':
tipo = ",'int'"
elif field['Type'][:11]=='mediumtext':
tipo = ",'text'"
elif field['Type'][:4]=='char':
tipo = ",'text'"
else:
print  field['Type'][0:10]
return tipo

def primarykey(field):
if field['Extra']=='auto_increment':
pk = True
else:
pk = False
return pk

def define_table(table):
fields =  get_fields(table)
result = []
head = 'db = DAL("mysql://'+ user+ ':'+passwd+'@'+host+':'+port+'/'+db+'", pool_size=10)\r\r'

line = "db.define_table('"+table+"'"
result.append(line)  
for field in fields:
if primarykey(field) == True:
pk =field['Field']
#print pk
tipo = field_type(field)
line = "Field('"+field['Field']+"'"+tipo+")"
result.append(line)
line
try:
line = "primarykey=['"+pk+"']"
result.append(line)
except:
pass
out = ',\r'.join(result)
output = head + out + '\r)'
print output
return output

def define_db():
tables = get_tables()
r = []
for table in tables:
r.append(define_table(table))

[web2py] Re: google fonts

2010-05-20 Thread Christopher Steel
Wow, I like.

On May 20, 2:28 pm, Yarko Tymciurak 
wrote:
> to see what it looks like on a browser that does not support this, get
> Opera - that will help you with development, so that you can satisfy
> yourself with how you handle / see results if you _do_ use this, and
> someone uses an unsupported browser.
>
> On May 20, 10:39 am, Thadeus Burgess  wrote:
>
> > everyone should have please upgrade browser links anyways, unless
> > their using software that requires IE 5... *curses blackboard and
> > mathlab*
>
> > --
> > Thadeus
>
> > On Thu, May 20, 2010 at 9:20 AM, Albert Abril  
> > wrote:
>
> > > On Thu, May 20, 2010 at 3:50 PM, Jonathan Lundell 
> > > wrote:
>
> > >> On May 20, 2010, at 5:51 AM, Albert Abril wrote:
>
> > >> Woow! Nice.
>
> > >> As said in the FAQ:
> > >> All the fonts in the Google Font Directory are licensed under open source
> > >> licenses that let you use them on any website
>
> > >> ...as long as it's being viewed with a browser that supports 
> > >> @font-face...
>
> > > Like:
>
> > > Google Chrome: version 4.249.4+
> > > Mozilla Firefox: version: 3.5+
> > > Apple Safari: version 3.1+
> > > Microsoft Internet Explorer: version 6+
>
> > > If someone using an unsupported browser visits a page that uses the Font
> > > API, then the text is displayed using the next available font in your CSS
> > > font stack.
>
> > >> On Thu, May 20, 2010 at 2:35 PM,
> > >> mdipierro  wrote:
>
> > >>>http://code.google.com/webfonts/preview


[web2py] Re: "SSL is OFF" error message when starting the server

2010-05-20 Thread OMAR
Tim, you were very close.

libssl-dev

-

Massimo,

I went the route of installing distutils so I could easy_install, but
once again was met with an error:

sudo easy_install ssl
Processing ssl
error: Couldn't find a setup script in ssl

Thank you for the suggestions.
I see where plenty of other people had the same problem getting SSL
support in python.
Should I opt to compile python with SSL support to begin with, as this
page suggests? http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/

Perhaps a distro other than Debian?

Perhaps I should give up trying to use the included CherryPy server,
and use Cherokee or another web server instead?

This is very frustrating, and for the most part has nothing to do with
web2py.
Sorry to clutter the board.





[web2py] Re: How do I make web2py speak JSONP?

2010-05-20 Thread mdipierro
look at generic.json, copy into default/youraction.jsonp and add the
padding.

On May 20, 2:47 pm, Pystar  wrote:
> Hi guys, I need to do some cross domain communication using web2py and
> the only sane way I can do that is using JSONP (JSON + padding). My
> question is how do I make web2py speak JSONP?
> Pystar


[web2py] Re: displaying associated name.

2010-05-20 Thread mdipierro
>>> db.define_table('me',Field('mom','reference me'),Field('name'))
>>> me=db.me.insert(name='Kim')
>>> me.mom=me
>>> print me.mom.mom.mom.mom.mom.name
Kim





On May 20, 1:14 pm, Yanni  wrote:
> Yes that worked. Kinda weird :)
>
> pet.category.category_name worked.
>
> Thank you very much.
>
> Yanni.
>
> On May 20, 11:06 am, "mr.freeze"  wrote:
>
> > It will do it automatically. You should be able to do:
> > pet.category.name
>
> > On May 20, 12:58 pm, Yanni  wrote:
>
> > > I'm slightly confused as to how to reference a field when I have the
> > > foreign key.
>
> > > table pets:
> > > pets.id
> > > name
> > > category (foreign key category.id)
> > > description
>
> > > table category:
> > > category.id
> > > category_name
>
> > > I am trying to show the category name, in my show page/function,
> > > instead of a number.
>
> > > In the controller, I do a
> > > show():
> > > id=request.vars.id
> > > pet=db(db.pets.id==id).select()
> > > return dict(pet=pet[0])
>
> > > In the view, among other things, I have {{=pet.category}}
> > > Which of course returns a number.
>
> > > At which point am I supposed to join the category table and the pet
> > > table, to do a lookup for the category name?
> > > What does the code for that look like? Does it have to be a join?
>
> > > Thank you very much.
> > > Yanni.


[web2py] How do I make web2py speak JSONP?

2010-05-20 Thread Pystar
Hi guys, I need to do some cross domain communication using web2py and
the only sane way I can do that is using JSONP (JSON + padding). My
question is how do I make web2py speak JSONP?
Pystar


[web2py] Re: nice slides on postgresql vs nodb

2010-05-20 Thread szimszon
Nice

On máj. 20, 19:52, mdipierro  wrote:
> http://www.scribd.com/doc/31669670/PostgreSQL-and-NoSQL


[web2py] Re: Auth.profile() allow change email used as username

2010-05-20 Thread GoldenTiger

On 20 mayo, 03:24, mdipierro  wrote:
> def user():
>       db.auth_user.email.writable=(request.args(0)!='profile')
>       return dict(form=auth())


I am a novice,

1) is that way better than creating a custom form ?

2) and how about changing permissions of email record after
registration?


[web2py] Re: google fonts

2010-05-20 Thread Yarko Tymciurak
to see what it looks like on a browser that does not support this, get
Opera - that will help you with development, so that you can satisfy
yourself with how you handle / see results if you _do_ use this, and
someone uses an unsupported browser.

On May 20, 10:39 am, Thadeus Burgess  wrote:
> everyone should have please upgrade browser links anyways, unless
> their using software that requires IE 5... *curses blackboard and
> mathlab*
>
> --
> Thadeus
>
> On Thu, May 20, 2010 at 9:20 AM, Albert Abril  wrote:
>
> > On Thu, May 20, 2010 at 3:50 PM, Jonathan Lundell 
> > wrote:
>
> >> On May 20, 2010, at 5:51 AM, Albert Abril wrote:
>
> >> Woow! Nice.
>
> >> As said in the FAQ:
> >> All the fonts in the Google Font Directory are licensed under open source
> >> licenses that let you use them on any website
>
> >> ...as long as it's being viewed with a browser that supports @font-face...
>
> > Like:
>
> > Google Chrome: version 4.249.4+
> > Mozilla Firefox: version: 3.5+
> > Apple Safari: version 3.1+
> > Microsoft Internet Explorer: version 6+
>
> > If someone using an unsupported browser visits a page that uses the Font
> > API, then the text is displayed using the next available font in your CSS
> > font stack.
>
> >> On Thu, May 20, 2010 at 2:35 PM,
> >> mdipierro  wrote:
>
> >>>http://code.google.com/webfonts/preview


[web2py] Re: displaying associated name.

2010-05-20 Thread Yanni
Yes that worked. Kinda weird :)

pet.category.category_name worked.

Thank you very much.

Yanni.

On May 20, 11:06 am, "mr.freeze"  wrote:
> It will do it automatically. You should be able to do:
> pet.category.name
>
> On May 20, 12:58 pm, Yanni  wrote:
>
> > I'm slightly confused as to how to reference a field when I have the
> > foreign key.
>
> > table pets:
> > pets.id
> > name
> > category (foreign key category.id)
> > description
>
> > table category:
> > category.id
> > category_name
>
> > I am trying to show the category name, in my show page/function,
> > instead of a number.
>
> > In the controller, I do a
> > show():
> > id=request.vars.id
> > pet=db(db.pets.id==id).select()
> > return dict(pet=pet[0])
>
> > In the view, among other things, I have {{=pet.category}}
> > Which of course returns a number.
>
> > At which point am I supposed to join the category table and the pet
> > table, to do a lookup for the category name?
> > What does the code for that look like? Does it have to be a join?
>
> > Thank you very much.
> > Yanni.
>
>


[web2py] Re: creating background process with multiprocessing spawns new instance of web2py

2010-05-20 Thread Yarko Tymciurak

On May 19, 6:18 pm, Yarko Tymciurak 
wrote:
> On May 19, 5:41 pm, amoygard  wrote:
>

>
> So - in general, you do not start subprocesses - with the exception of
> cron.   Seehttp://www.web2py.com/book/default/section/4/17

I might better have said you do not _want_ to be starting subprocesses
- besides the cost (compute time, memory, etc.), if you generally did
this.   This (the inneficiency of spawning subrocesses) is why
stackless  was created - and (among other things) used in a a very
busy online game.  A lot of thought went into avoiding the costs of
spawning subprocesses.

If you haven't heard of it, stackless is an implementation of python
that does not use the traditional "C" stack for local variables,
etc.   Among other things, it has added "tasklets" to the language, so
you can create and schedule tasks - without the overhead of doing so
in your operating system.   There is a lot of discussion of benefit,
efficiency.   Although there might be some discussion questioning the
approach, other alternative approaches, one thing is clear:  the
motivation to stay away from creating threads / subprocesses, and the
costs involved.  it might be interesting to read up on it.

- Yarko
>
> - Yarko
>


[web2py] Re: displaying associated name.

2010-05-20 Thread mr.freeze
It will do it automatically. You should be able to do:
pet.category.name

On May 20, 12:58 pm, Yanni  wrote:
> I'm slightly confused as to how to reference a field when I have the
> foreign key.
>
> table pets:
> pets.id
> name
> category (foreign key category.id)
> description
>
> table category:
> category.id
> category_name
>
> I am trying to show the category name, in my show page/function,
> instead of a number.
>
> In the controller, I do a
> show():
> id=request.vars.id
> pet=db(db.pets.id==id).select()
> return dict(pet=pet[0])
>
> In the view, among other things, I have {{=pet.category}}
> Which of course returns a number.
>
> At which point am I supposed to join the category table and the pet
> table, to do a lookup for the category name?
> What does the code for that look like? Does it have to be a join?
>
> Thank you very much.
> Yanni.


[web2py] Re: creating background process with multiprocessing spawns new instance of web2py

2010-05-20 Thread Yarko Tymciurak
You might also look at how services are setup: 
http://www.web2py.com/book/default/section/9/2

On May 20, 11:58 am, amoygard  wrote:
> Thanks for the helpful answer!
>
> On 20 Mai, 01:18, Yarko Tymciurak  wrote:
>
> > On May 19, 5:41 pm, amoygard  wrote:
>
> > > Thanks for the answer - I was aware that I don't have to do this to
> > > handle ajax requests in general. The application I'm building needs to
> > > send and receive a sequence of messages from the client in a specific
> > > order, so I thought it would be easier to handle it in one thread/
> > > process. It is however probably better to do it statelessly as you
> > > say, so I'll probably have to rewrite the code somewhat.
>
> > > Out of curiosity though, what is the right way to start a subprocess
> > > in web2py?
> > On Wed, May 19, 2010 at 10:41 PM, amoygard  wrote:
>
> > Thanks for the answer - I was aware that I don't have to do this to
> > handle ajax requests in general. The application I'm building needs to
> > send and receive a sequence of messages from the client in a specific
> > order, so I thought it would be easier to handle it in one thread/
> > process. It is however probably better to do it statelessly as you
> > say, so I'll probably have to rewrite the code somewhat.
>
> > Out of curiosity though, what is the right way to start a subprocess
> > in web2py?
>
> > In general, you don't - unless you have a long-running process that is
> > divorced from http requests coming in from the network (for long
> > running processes, there is a sort of "cron" facility).
>
> > In a hosting environment, you have apache/wsgi (for example) running a
> > wsgi-thred that is web2py - that (main and the stuff in gluon) is your
> > long-running process (er, thread).   To restart web2py, with wsgi, you
> > would do what is normal (touch a file) to cause apache to re-start
> > that wsgi thread.  Other than from something like a terminal on your
> > server, you do not do this (it would not be uncommon for this to run
> > year-long without a restart).
>
> > Within web2py, you have a number of threads:  db connection pools, and
> > application threads;   again, these respond to requests, and are
> > spawned off by web2py (not you) - Massimo, or someone who has dug into
> > this recently could comment on how that works - but frankly, that is
> > not important.
>
> > Your web app _is_ running in a stateless environment:  web requests.
> > You have a way to "capture" some state on your own:  sessions.
>
> > I only know of one framework that uses the tasklet facility of
> > stackless, and that's nagare ---  it seems to use a tasklet to wait
> > for a return so that you seem to generate a view inline in your
> > code.   In web2py, your (for example)  default/index()  controller is
> > typically called multiple times, and decides (though it's mostly
> > masked from you)  through logic if it's an initial request, or a
> > response --- i.e., when you call something with a form, there is a
> > check by means of form.accepts()  to see if the response variables are
> > populated, and (somewhat behind the scenes) all the stacks of
> > appropriate validators are run.   This is why you see things like
> > form.accepts()  success or fail conditions, and fall thru if neither
> > (i.e. not a response yet).
>
> > So - in general, you do not start subprocesses - with the exception of
> > cron.   Seehttp://www.web2py.com/book/default/section/4/17
>
> > - Yarko
>
> > > On 19 Mai, 22:00, Yarko Tymciurak  wrote:
>
> > > > On May 19, 2:14 pm, amoygard  wrote:
>
> > > > > Hi,
>
> > > > > I'm pretty new to web2py and web application frameworks. I'm trying to
> > > > > create a new background process in controller to handle incoming ajax
> > > > > data from a user.
>
> > > > You are trying to do too much:  remember:  the web is "stateless" ---
> > > > when _anything_ comes in from a client that gets directed to your URL,
> > > > (this is just an example flow, so you can get the general idea):
>
> > > > - somewhere, a DNS server replaces the URI  name with a destination
> > > > address;
> > > > - the destination server (let's say apache)  tries to sort out, and
> > > > direct to the correct app (in this case, web2py);
> > > > - web2py's main() parses the path part of the URI to decide how to
> > > > route internally
> > > > - if it finds a matching app/controller, main() will set up the
> > > > execution environment to prepare the call:
> > > >   - i.e.,  your models are "executed" so that the table definitions,
> > > > etc. are all in the environment, and then your controller file
> > > >   -  the function in your controller is called with this execution
> > > > environment (this is the thread that you are trying to make, and
> > > > should not bother)
>
> > > > The controller function does it's stuff with the request, and returns
> > > > (to main())  the response - sometimes nothing, sometimes a dict. of
> > > > stuff;
> > > > Main takes the return values from the controller, 

[web2py] displaying associated name.

2010-05-20 Thread Yanni
I'm slightly confused as to how to reference a field when I have the
foreign key.

table pets:
pets.id
name
category (foreign key category.id)
description

table category:
category.id
category_name

I am trying to show the category name, in my show page/function,
instead of a number.

In the controller, I do a
show():
id=request.vars.id
pet=db(db.pets.id==id).select()
return dict(pet=pet[0])

In the view, among other things, I have {{=pet.category}}
Which of course returns a number.

At which point am I supposed to join the category table and the pet
table, to do a lookup for the category name?
What does the code for that look like? Does it have to be a join?

Thank you very much.
Yanni.



[web2py] nice slides on postgresql vs nodb

2010-05-20 Thread mdipierro
http://www.scribd.com/doc/31669670/PostgreSQL-and-NoSQL


[web2py] Re: creating background process with multiprocessing spawns new instance of web2py

2010-05-20 Thread amoygard
Thanks for the helpful answer!

On 20 Mai, 01:18, Yarko Tymciurak  wrote:
> On May 19, 5:41 pm, amoygard  wrote:
>
> > Thanks for the answer - I was aware that I don't have to do this to
> > handle ajax requests in general. The application I'm building needs to
> > send and receive a sequence of messages from the client in a specific
> > order, so I thought it would be easier to handle it in one thread/
> > process. It is however probably better to do it statelessly as you
> > say, so I'll probably have to rewrite the code somewhat.
>
> > Out of curiosity though, what is the right way to start a subprocess
> > in web2py?
> On Wed, May 19, 2010 at 10:41 PM, amoygard  wrote:
>
> Thanks for the answer - I was aware that I don't have to do this to
> handle ajax requests in general. The application I'm building needs to
> send and receive a sequence of messages from the client in a specific
> order, so I thought it would be easier to handle it in one thread/
> process. It is however probably better to do it statelessly as you
> say, so I'll probably have to rewrite the code somewhat.
>
> Out of curiosity though, what is the right way to start a subprocess
> in web2py?
>
> In general, you don't - unless you have a long-running process that is
> divorced from http requests coming in from the network (for long
> running processes, there is a sort of "cron" facility).
>
> In a hosting environment, you have apache/wsgi (for example) running a
> wsgi-thred that is web2py - that (main and the stuff in gluon) is your
> long-running process (er, thread).   To restart web2py, with wsgi, you
> would do what is normal (touch a file) to cause apache to re-start
> that wsgi thread.  Other than from something like a terminal on your
> server, you do not do this (it would not be uncommon for this to run
> year-long without a restart).
>
> Within web2py, you have a number of threads:  db connection pools, and
> application threads;   again, these respond to requests, and are
> spawned off by web2py (not you) - Massimo, or someone who has dug into
> this recently could comment on how that works - but frankly, that is
> not important.
>
> Your web app _is_ running in a stateless environment:  web requests.
> You have a way to "capture" some state on your own:  sessions.
>
> I only know of one framework that uses the tasklet facility of
> stackless, and that's nagare ---  it seems to use a tasklet to wait
> for a return so that you seem to generate a view inline in your
> code.   In web2py, your (for example)  default/index()  controller is
> typically called multiple times, and decides (though it's mostly
> masked from you)  through logic if it's an initial request, or a
> response --- i.e., when you call something with a form, there is a
> check by means of form.accepts()  to see if the response variables are
> populated, and (somewhat behind the scenes) all the stacks of
> appropriate validators are run.   This is why you see things like
> form.accepts()  success or fail conditions, and fall thru if neither
> (i.e. not a response yet).
>
> So - in general, you do not start subprocesses - with the exception of
> cron.   Seehttp://www.web2py.com/book/default/section/4/17
>
> - Yarko
>
>
>
>
>
> > On 19 Mai, 22:00, Yarko Tymciurak  wrote:
>
> > > On May 19, 2:14 pm, amoygard  wrote:
>
> > > > Hi,
>
> > > > I'm pretty new to web2py and web application frameworks. I'm trying to
> > > > create a new background process in controller to handle incoming ajax
> > > > data from a user.
>
> > > You are trying to do too much:  remember:  the web is "stateless" ---
> > > when _anything_ comes in from a client that gets directed to your URL,
> > > (this is just an example flow, so you can get the general idea):
>
> > > - somewhere, a DNS server replaces the URI  name with a destination
> > > address;
> > > - the destination server (let's say apache)  tries to sort out, and
> > > direct to the correct app (in this case, web2py);
> > > - web2py's main() parses the path part of the URI to decide how to
> > > route internally
> > > - if it finds a matching app/controller, main() will set up the
> > > execution environment to prepare the call:
> > >   - i.e.,  your models are "executed" so that the table definitions,
> > > etc. are all in the environment, and then your controller file
> > >   -  the function in your controller is called with this execution
> > > environment (this is the thread that you are trying to make, and
> > > should not bother)
>
> > > The controller function does it's stuff with the request, and returns
> > > (to main())  the response - sometimes nothing, sometimes a dict. of
> > > stuff;
> > > Main takes the return values from the controller, and processes
> > > appropriately, most often getting the view, parsing the template,
> > > creating the resulting view, and sending it back to the client.
>
> > > When an ajax call is made, you can see an example 
> > > athttp://www.web2py.com/book/default/section/10/3,  and explanat

Re: [web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

2010-05-20 Thread Jason Lotz
Can you explain a liitle more? You are actually seeing two forms in  
the browser?


If I understand you correctly upon first loading the page you get the  
grid and a form with default id. When you select a row in the grid the  
default form is not reloaded with the new id but a second form  
appears. You see a grid and two forms. Is that right?


Double check your id's. It could be that adding the extra jQuery 
("#grid_id").jqGrid({ onSelectRow:  }) in the view is conflicting  
with a function in the plugin. I would try making a quick test using  
the web2py jqgrid_plugin (which is a very nicely integrated plugin )  
and see if you get the same issue. If not then it is a conflict with  
your plugin script.


It's passing 1:45am here so I will take a look at this editable_plugin  
tomorrow morning and see if I can find something, if you haven't  
solved it by then.




On May 21, 2010, at 0:50, AsmanCom  wrote:


You helped me a lot, man!

i´ve tried like you suggested, i only keeped the LOAD, but it´s the
same...
Page is loading the Grid, underneath the Grid rises "loading" and then
a new layer pops up with with the form in the default Template (Its
showed twice).

I´ve checked:
www.web2py.com/AlterEgo/default/show/252

But it doesent´t helped very much.

It seems I am stucked, right before finish... ;-(

Any help is appreciated, would so cool if I could get this done today.

Dieter Asman

On 20 Mai, 17:23, Jason Lotz  wrote:

web2py LOAD function will create generate id="target">Loading... and fills your component. I'm sorry I  
can't

test it right now but it seems that by adding the  in your
view and including the LOAD you are creating two form. Maybe try  
remove

your div and only keep the  LOAD.

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}

jQuery(document).ready(function()
{jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');}});

{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}

check out LOAD function dochttp://www.web2py.com/AlterEgo/default/ 
show/252


On 05/21/2010 12:09 AM, AsmanCom wrote:


Many thanks, it go�s in the right direction now.


I am using thehttp://app.ebansoftware.net/editable_jqgrid/default/ 
show_example

, but it is quite similar.



Now the is loaded is loaded with the default template and then a
second layer covers it with the form and the default Template(loaded
twice)



The code so far:



View:



{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}

jQuery(document).ready(function()
{jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');}});


{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}



Controller:



def jqgrid_table_test():
 return
dict(jqgrid_table=plugin_editable_jqgrid 
(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))



def form():
 #id = request.args[0]
 form = SQLFORM(db.jqgrid_table)
 if form.accepts(request.vars, session):
 response.flash = 'form accepted'
 elif form.errors:
 response.flash = 'form has errors'
 else:
 response.flash = 'please fill out the form'
 return dict(form=form)



On 20 Mai, 16:55, Jason Lotz  wrote:



Are you using the web2py jqgrid_plugin?



http://web2py.com/plugins/default/jqgrid



On 05/20/2010 11:53 PM, AsmanCom wrote:



can this be caused by the function, which set in /static/
plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:



 onSelectRow: function(id){
   if(id&&lastSel!=''&&id!==lastSel){
  jQuery(grid_name).restoreRow(lastSel);
   }
   lastSel=id;
   jQuery(grid_name).editRow(id, true, '', '', '', '',
function(rowid, resultText){reload(grid_name,rowid,  
resultText);});

 },
  colNames:col_names,
  colModel:col_models,
  pager: pager,
  rowNum:10,
  rowList:[10,100,1000],
  sortorder: 'desc',
  multiselect: true,
  multiboxonly:true,
  viewrecords: true,
  editurl:edit_url,
  caption: caption
});



Thank  you in advance.



Dieter Asman



On 20 Mai, 15:52, Jason Lotzwrote:



Try



{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
   onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+ (postdata),null,'my_form');}});




On 05/20/2010 10:45 PM, AsmanCom wrote:



Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach,  
controlling the

form.



May i missed something..?
Could you tell me how to set up the form?



should the view look something like that?:



{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
   onSelectRow: function(postdata) {
 

[web2py] Re: creating background process with multiprocessing spawns new instance of web2py

2010-05-20 Thread Candid
Here is how I did it:

#in controller action
import subprocess
subprocess.Popen(r"python applications/{0}/modules/
run.py".format(request.application), shell=True)

On May 19, 6:41 pm, amoygard  wrote:
> Thanks for the answer - I was aware that I don't have to do this to
> handle ajax requests in general. The application I'm building needs to
> send and receive a sequence of messages from the client in a specific
> order, so I thought it would be easier to handle it in one thread/
> process. It is however probably better to do it statelessly as you
> say, so I'll probably have to rewrite the code somewhat.
>
> Out of curiosity though, what is the right way to start a subprocess
> in web2py?
>
> On 19 Mai, 22:00, Yarko Tymciurak  wrote:
>
>
>
> > On May 19, 2:14 pm, amoygard  wrote:
>
> > > Hi,
>
> > > I'm pretty new to web2py and web application frameworks. I'm trying to
> > > create a new background process in controller to handle incoming ajax
> > > data from a user.
>
> > You are trying to do too much:  remember:  the web is "stateless" ---
> > when _anything_ comes in from a client that gets directed to your URL,
> > (this is just an example flow, so you can get the general idea):
>
> > - somewhere, a DNS server replaces the URI  name with a destination
> > address;
> > - the destination server (let's say apache)  tries to sort out, and
> > direct to the correct app (in this case, web2py);
> > - web2py's main() parses the path part of the URI to decide how to
> > route internally
> > - if it finds a matching app/controller, main() will set up the
> > execution environment to prepare the call:
> >   - i.e.,  your models are "executed" so that the table definitions,
> > etc. are all in the environment, and then your controller file
> >   -  the function in your controller is called with this execution
> > environment (this is the thread that you are trying to make, and
> > should not bother)
>
> > The controller function does it's stuff with the request, and returns
> > (to main())  the response - sometimes nothing, sometimes a dict. of
> > stuff;
> > Main takes the return values from the controller, and processes
> > appropriately, most often getting the view, parsing the template,
> > creating the resulting view, and sending it back to the client.
>
> > When an ajax call is made, you can see an example 
> > athttp://www.web2py.com/book/default/section/10/3,  and explanation of
> > what this does.
>
> > The general point:   you call a controller with a request (even in the
> > case of an ajax call);
> > The response goes back to the  caller.
>
> > Lots of stuff happens for you - you don't need to write the entire web
> > server underpinnings;  just worry about the logic you want to
> > implement so server and client can converse / exchange information.
>
> > Hope this helps.
>
> > Regards,
> > - Yarko
>
> > > I'm using the module multiprocessing for this.
> > > However, when I start the new process, a new instance of web2py server
> > > is started? I'm assuming this has something to do with forking (which
> > > I don't know much about). Is there an easy workaround? Or should I
> > > preferrably do this some other way, for instance with threads?
>
> > > Code is as follows (controller calls function 'someinit' in a module
> > > in module-folder):
>
> > > def tekstpr(mstring,conn):
> > >   print mstring
> > >   conn.send("hello")
>
> > > def someinit(userid):
> > >   from multiprocessing import Pipe, Process
> > >   parent_conn, child_conn = Pipe()
> > >   p = Process(target=tekstpr,args=("I'm alive!",child_conn))
> > >   session.procpipe = parent_conn
> > >   p.start()
> > >   session.procpipe.poll(300)
> > >   return session.procpipe.recv()


[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

2010-05-20 Thread AsmanCom
You helped me a lot, man!

i´ve tried like you suggested, i only keeped the LOAD, but it´s the
same...
Page is loading the Grid, underneath the Grid rises "loading" and then
a new layer pops up with with the form in the default Template (Its
showed twice).

I´ve checked:
www.web2py.com/AlterEgo/default/show/252

But it doesent´t helped very much.

It seems I am stucked, right before finish... ;-(

Any help is appreciated, would so cool if I could get this done today.

Dieter Asman

On 20 Mai, 17:23, Jason Lotz  wrote:
> web2py LOAD function will create generate  id="target">Loading... and fills your component. I'm sorry I can't
> test it right now but it seems that by adding the  in your
> view and including the LOAD you are creating two form. Maybe try remove
> your div and only keep the  LOAD.
>
> {{extend 'layout.html'}}
> This is the default/test.html template
> {{=jqgrid_table}}
> 
> jQuery(document).ready(function()
> {jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
> {web2py_ajax_page('get','/myapp/default/form/'+
> (postdata),null,'my_form');}});
> 
> {{=LOAD('default','form',args=1,ajax=True,target='my_form')}}
>
> check out LOAD function dochttp://www.web2py.com/AlterEgo/default/show/252
>
> On 05/21/2010 12:09 AM, AsmanCom wrote:
>
> > Many thanks, it go�s in the right direction now.
>
> > I am using 
> > thehttp://app.ebansoftware.net/editable_jqgrid/default/show_example
> > , but it is quite similar.
>
> > Now the is loaded is loaded with the default template and then a
> > second layer covers it with the form and the default Template(loaded
> > twice)
>
> > The code so far:
>
> > View:
>
> > {{extend 'layout.html'}}
> > This is the default/test.html template
> > {{=jqgrid_table}}
> > 
> > jQuery(document).ready(function()
> > {jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
> > {web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');}});
> > 
> > 
> > {{=LOAD('default','form',args=1,ajax=True,target='my_form')}}
>
> > Controller:
>
> > def jqgrid_table_test():
> >      return
> > dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))
>
> > def form():
> >      #id = request.args[0]
> >      form = SQLFORM(db.jqgrid_table)
> >      if form.accepts(request.vars, session):
> >          response.flash = 'form accepted'
> >      elif form.errors:
> >          response.flash = 'form has errors'
> >      else:
> >          response.flash = 'please fill out the form'
> >      return dict(form=form)
>
> > On 20 Mai, 16:55, Jason Lotz  wrote:
>
> >> Are you using the web2py jqgrid_plugin?
>
> >>http://web2py.com/plugins/default/jqgrid
>
> >> On 05/20/2010 11:53 PM, AsmanCom wrote:
>
> >>> can this be caused by the function, which set in /static/
> >>> plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:
>
> >>>      onSelectRow: function(id){
> >>>        if(id&&    lastSel!=''&&    id!==lastSel){
> >>>           jQuery(grid_name).restoreRow(lastSel);
> >>>        }
> >>>        lastSel=id;
> >>>        jQuery(grid_name).editRow(id, true, '', '', '', '',
> >>> function(rowid, resultText){reload(grid_name,rowid, resultText);});
> >>>      },
> >>>       colNames:col_names,
> >>>       colModel:col_models,
> >>>       pager: pager,
> >>>       rowNum:10,
> >>>       rowList:[10,100,1000],
> >>>       sortorder: 'desc',
> >>>       multiselect: true,
> >>>       multiboxonly:true,
> >>>       viewrecords: true,
> >>>       editurl:edit_url,
> >>>       caption: caption
> >>>     });
>
> >>> Thank  you in advance.
>
> >>> Dieter Asman
>
> >>> On 20 Mai, 15:52, Jason Lotz    wrote:
>
>  Try
>
>  {{=jqgrid_table}}
>  
>  jQuery(document).ready(function(){
>  jQuery("#grid_id").jqGrid({
>         onSelectRow: function(postdata) {
>  web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});
>  
>
>  On 05/20/2010 10:45 PM, AsmanCom wrote:
>
> > Thanks for your effort, but it gives an empty page..
> > I will use two or more Grids at least one of them must keep the
> > "editable" behaveure.
> > But in this case it should work like your approach, controlling the
> > form.
>
> > May i missed something..?
> > Could you tell me how to set up the form?
>
> > should the view look something like that?:
>
> > {{=jqgrid_table}}
> > 
> > jQuery("#grid_id").jqGrid({
> >        onSelectRow: function(postdata) {
> >                web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >        }
>
> > });
> > 
> > 
> > {{=form}}
>
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 20 Mai, 14:54, Jason Lotz      wrote:
>
> >> You could try passing SCRIPT from the controller.
>
> >> ## View
> >> {{extend 'layout.html'}}
> >> This is the default/test.html template
> >> {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >> table',db_nam

Re: [web2py] google fonts

2010-05-20 Thread Thadeus Burgess
everyone should have please upgrade browser links anyways, unless
their using software that requires IE 5... *curses blackboard and
mathlab*

--
Thadeus





On Thu, May 20, 2010 at 9:20 AM, Albert Abril  wrote:
>
>
> On Thu, May 20, 2010 at 3:50 PM, Jonathan Lundell 
> wrote:
>>
>> On May 20, 2010, at 5:51 AM, Albert Abril wrote:
>>
>> Woow! Nice.
>>
>> As said in the FAQ:
>> All the fonts in the Google Font Directory are licensed under open source
>> licenses that let you use them on any website
>>
>> ...as long as it's being viewed with a browser that supports @font-face...
>
> Like:
>
> Google Chrome: version 4.249.4+
> Mozilla Firefox: version: 3.5+
> Apple Safari: version 3.1+
> Microsoft Internet Explorer: version 6+
>
> If someone using an unsupported browser visits a page that uses the Font
> API, then the text is displayed using the next available font in your CSS
> font stack.
>
>
>
>>
>> On Thu, May 20, 2010 at 2:35 PM,
>> mdipierro  wrote:
>>>
>>> http://code.google.com/webfonts/preview
>>
>>
>>
>
>


Re: [web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

2010-05-20 Thread Jason Lotz
web2py LOAD function will create generate id="target">Loading... and fills your component. I'm sorry I can't 
test it right now but it seems that by adding the  in your 
view and including the LOAD you are creating two form. Maybe try remove 
your div and only keep the  LOAD.


{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}

jQuery(document).ready(function()
{jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');}});

{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}


check out LOAD function doc
http://www.web2py.com/AlterEgo/default/show/252



On 05/21/2010 12:09 AM, AsmanCom wrote:

Many thanks, it go´s in the right direction now.

I am using the http://app.ebansoftware.net/editable_jqgrid/default/show_example
, but it is quite similar.

Now the is loaded is loaded with the default template and then a
second layer covers it with the form and the default Template(loaded
twice)

The code so far:

View:

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}

jQuery(document).ready(function()
{jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');}});


{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}

Controller:

def jqgrid_table_test():
 return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))

def form():
 #id = request.args[0]
 form = SQLFORM(db.jqgrid_table)
 if form.accepts(request.vars, session):
 response.flash = 'form accepted'
 elif form.errors:
 response.flash = 'form has errors'
 else:
 response.flash = 'please fill out the form'
 return dict(form=form)

On 20 Mai, 16:55, Jason Lotz  wrote:
   

Are you using the web2py jqgrid_plugin?

http://web2py.com/plugins/default/jqgrid

On 05/20/2010 11:53 PM, AsmanCom wrote:

 

can this be caused by the function, which set in /static/
plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:
   
 

 onSelectRow: function(id){
   if(id&&lastSel!=''&&id!==lastSel){
  jQuery(grid_name).restoreRow(lastSel);
   }
   lastSel=id;
   jQuery(grid_name).editRow(id, true, '', '', '', '',
function(rowid, resultText){reload(grid_name,rowid, resultText);});
 },
  colNames:col_names,
  colModel:col_models,
  pager: pager,
  rowNum:10,
  rowList:[10,100,1000],
  sortorder: 'desc',
  multiselect: true,
  multiboxonly:true,
  viewrecords: true,
  editurl:edit_url,
  caption: caption
});
   
 

Thank  you in advance.
   
 

Dieter Asman
   
 

On 20 Mai, 15:52, Jason Lotzwrote:
   
 

Try
 
 

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
   onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});

 
 

On 05/20/2010 10:45 PM, AsmanCom wrote:
 
 

Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach, controlling the
form.
   
 

May i missed something..?
Could you tell me how to set up the form?
   
 

should the view look something like that?:
   
 

{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
   onSelectRow: function(postdata) {
   web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
   }
});


{{=form}}
   
 

Thank  you in advance.
   
 

Dieter Asman
   
 

On 20 Mai, 14:54, Jason Lotz  wrote:
   
 

You could try passing SCRIPT from the controller.
 
 

## View
{{extend 'layout.html'}}
This is the default/test.html template
{{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
table',db_name='db')}}
{{=script}}
 
 

## Controller
def jqgrid_table_test():
   script = """jQuery(document).ready(function(){
   jQuery("#grid_id").jqGrid({
   onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form'); }});"""
   return SCRIPT(script)
 
 

I haven't tested this so let me know if it works out for you.
 
 

I am only using a single grid for my app so I actually included the
onSel

[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

I meant:

The Grid is loaded with the default template and then a second layer
covers it with the form and the default Template(loaded twice)

;-)

On 20 Mai, 16:55, Jason Lotz  wrote:
> Are you using the web2py jqgrid_plugin?
>
> http://web2py.com/plugins/default/jqgrid
>
> On 05/20/2010 11:53 PM, AsmanCom wrote:
>
> > can this be caused by the function, which set in /static/
> > plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:
>
> >     onSelectRow: function(id){
> >       if(id&&  lastSel!=''&&  id!==lastSel){
> >          jQuery(grid_name).restoreRow(lastSel);
> >       }
> >       lastSel=id;
> >       jQuery(grid_name).editRow(id, true, '', '', '', '',
> > function(rowid, resultText){reload(grid_name,rowid, resultText);});
> >     },
> >      colNames:col_names,
> >      colModel:col_models,
> >      pager: pager,
> >      rowNum:10,
> >      rowList:[10,100,1000],
> >      sortorder: 'desc',
> >      multiselect: true,
> >      multiboxonly:true,
> >      viewrecords: true,
> >      editurl:edit_url,
> >      caption: caption
> >    });
>
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 20 Mai, 15:52, Jason Lotz  wrote:
>
> >> Try
>
> >> {{=jqgrid_table}}
> >> 
> >> jQuery(document).ready(function(){
> >> jQuery("#grid_id").jqGrid({
> >>       onSelectRow: function(postdata) {
> >> web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});
> >> 
>
> >> On 05/20/2010 10:45 PM, AsmanCom wrote:
>
> >>> Thanks for your effort, but it gives an empty page..
> >>> I will use two or more Grids at least one of them must keep the
> >>> "editable" behaveure.
> >>> But in this case it should work like your approach, controlling the
> >>> form.
>
> >>> May i missed something..?
> >>> Could you tell me how to set up the form?
>
> >>> should the view look something like that?:
>
> >>> {{=jqgrid_table}}
> >>> 
> >>> jQuery("#grid_id").jqGrid({
> >>>       onSelectRow: function(postdata) {
> >>>               web2py_ajax_page('get','/myapp/default/form/'+
> >>> (postdata),null,'my_form');
> >>>       }
>
> >>> });
> >>> 
> >>> 
> >>> {{=form}}
>
> >>> Thank  you in advance.
>
> >>> Dieter Asman
>
> >>> On 20 Mai, 14:54, Jason Lotz    wrote:
>
>  You could try passing SCRIPT from the controller.
>
>  ## View
>  {{extend 'layout.html'}}
>  This is the default/test.html template
>  {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
>  table',db_name='db')}}
>  {{=script}}
>
>  ## Controller
>  def jqgrid_table_test():
>        script = """jQuery(document).ready(function(){
>                        jQuery("#grid_id").jqGrid({
>                            onSelectRow: function(postdata)
>  {web2py_ajax_page('get','/myapp/default/form/'+
>  (postdata),null,'my_form'); }});"""
>        return SCRIPT(script)
>
>  I haven't tested this so let me know if it works out for you.
>
>  I am only using a single grid for my app so I actually included the
>  onSelectRow event to /models/jqgrid_plugin. The function
>  plugin_jqgrid() is where the default jqgrid script is retrieved when
>  the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
>  this way you will want to add it to the .jqGrid({ }) parameters not in
>  the 'navGrid', 'toolbar' or other extended option parameters.
>
>  Jay
>
>  On May 20, 8:47 pm, AsmanCom    wrote:
>
> > Could you help me setting this up too?
>
> > This is the view:
>
> > {{extend 'layout.html'}}
> > This is the default/test.html template
> > {{=jqgrid_table}}
> > jQuery("#grid_id").jqGrid({
> >       onSelectRow: function(postdata) {
> >               web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >       }
>
> > });
>
> > This is the Controller:
>
> > def jqgrid_table_test():
> >       return
> > dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >  table',db_name='db'))
>
> > def form():
> >       id = request.args[0]
> >       form=FORM(TABLE(TR("Your
> > name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
> >                       TR("Your
> > email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
> >                       TR("Admin",INPUT(_type="checkbox",_name="admin")),
>
> > TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no']))
> >  ),
> >                       TR("Profile",TEXTAREA(_name="profile",value="write
> > something here")),
> >                       TR("",INPUT(_type="submit",_value="SUBMIT"
> >       if form.accepts(request.vars,session):
> >           response.flash="form accepted"
> >       elif form.errors:
> >           response.flash="form is invalid"
> >       else:
> >           response.flash="please fill the form"
> >       return dict(form=form,vars=form.vars)
>
> > ##

[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

Many thanks, it go´s in the right direction now.

I am using the http://app.ebansoftware.net/editable_jqgrid/default/show_example
, but it is quite similar.

Now the is loaded is loaded with the default template and then a
second layer covers it with the form and the default Template(loaded
twice)

The code so far:

View:

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}

jQuery(document).ready(function()
{jQuery("#grid_id").jqGrid({onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');}});


{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}

Controller:

def jqgrid_table_test():
return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))

def form():
#id = request.args[0]
form = SQLFORM(db.jqgrid_table)
if form.accepts(request.vars, session):
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill out the form'
return dict(form=form)

On 20 Mai, 16:55, Jason Lotz  wrote:
> Are you using the web2py jqgrid_plugin?
>
> http://web2py.com/plugins/default/jqgrid
>
> On 05/20/2010 11:53 PM, AsmanCom wrote:
>
> > can this be caused by the function, which set in /static/
> > plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:
>
> >     onSelectRow: function(id){
> >       if(id&&  lastSel!=''&&  id!==lastSel){
> >          jQuery(grid_name).restoreRow(lastSel);
> >       }
> >       lastSel=id;
> >       jQuery(grid_name).editRow(id, true, '', '', '', '',
> > function(rowid, resultText){reload(grid_name,rowid, resultText);});
> >     },
> >      colNames:col_names,
> >      colModel:col_models,
> >      pager: pager,
> >      rowNum:10,
> >      rowList:[10,100,1000],
> >      sortorder: 'desc',
> >      multiselect: true,
> >      multiboxonly:true,
> >      viewrecords: true,
> >      editurl:edit_url,
> >      caption: caption
> >    });
>
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 20 Mai, 15:52, Jason Lotz  wrote:
>
> >> Try
>
> >> {{=jqgrid_table}}
> >> 
> >> jQuery(document).ready(function(){
> >> jQuery("#grid_id").jqGrid({
> >>       onSelectRow: function(postdata) {
> >> web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});
> >> 
>
> >> On 05/20/2010 10:45 PM, AsmanCom wrote:
>
> >>> Thanks for your effort, but it gives an empty page..
> >>> I will use two or more Grids at least one of them must keep the
> >>> "editable" behaveure.
> >>> But in this case it should work like your approach, controlling the
> >>> form.
>
> >>> May i missed something..?
> >>> Could you tell me how to set up the form?
>
> >>> should the view look something like that?:
>
> >>> {{=jqgrid_table}}
> >>> 
> >>> jQuery("#grid_id").jqGrid({
> >>>       onSelectRow: function(postdata) {
> >>>               web2py_ajax_page('get','/myapp/default/form/'+
> >>> (postdata),null,'my_form');
> >>>       }
>
> >>> });
> >>> 
> >>> 
> >>> {{=form}}
>
> >>> Thank  you in advance.
>
> >>> Dieter Asman
>
> >>> On 20 Mai, 14:54, Jason Lotz    wrote:
>
>  You could try passing SCRIPT from the controller.
>
>  ## View
>  {{extend 'layout.html'}}
>  This is the default/test.html template
>  {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
>  table',db_name='db')}}
>  {{=script}}
>
>  ## Controller
>  def jqgrid_table_test():
>        script = """jQuery(document).ready(function(){
>                        jQuery("#grid_id").jqGrid({
>                            onSelectRow: function(postdata)
>  {web2py_ajax_page('get','/myapp/default/form/'+
>  (postdata),null,'my_form'); }});"""
>        return SCRIPT(script)
>
>  I haven't tested this so let me know if it works out for you.
>
>  I am only using a single grid for my app so I actually included the
>  onSelectRow event to /models/jqgrid_plugin. The function
>  plugin_jqgrid() is where the default jqgrid script is retrieved when
>  the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
>  this way you will want to add it to the .jqGrid({ }) parameters not in
>  the 'navGrid', 'toolbar' or other extended option parameters.
>
>  Jay
>
>  On May 20, 8:47 pm, AsmanCom    wrote:
>
> > Could you help me setting this up too?
>
> > This is the view:
>
> > {{extend 'layout.html'}}
> > This is the default/test.html template
> > {{=jqgrid_table}}
> > jQuery("#grid_id").jqGrid({
> >       onSelectRow: function(postdata) {
> >               web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >       }
>
> > });
>
> > This is the Controller:
>
> > def jqgrid_table_test():
> >       return
> > dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >  table',db_name='db'))
>
> > def form

Re: [web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component


Are you using the web2py jqgrid_plugin?

http://web2py.com/plugins/default/jqgrid



On 05/20/2010 11:53 PM, AsmanCom wrote:

can this be caused by the function, which set in /static/
plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:

onSelectRow: function(id){
  if(id&&  lastSel!=''&&  id!==lastSel){
 jQuery(grid_name).restoreRow(lastSel);
  }
  lastSel=id;
  jQuery(grid_name).editRow(id, true, '', '', '', '',
function(rowid, resultText){reload(grid_name,rowid, resultText);});
},
 colNames:col_names,
 colModel:col_models,
 pager: pager,
 rowNum:10,
 rowList:[10,100,1000],
 sortorder: 'desc',
 multiselect: true,
 multiboxonly:true,
 viewrecords: true,
 editurl:edit_url,
 caption: caption
   });

Thank  you in advance.

Dieter Asman

On 20 Mai, 15:52, Jason Lotz  wrote:
   

Try

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});


On 05/20/2010 10:45 PM, AsmanCom wrote:

 

Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach, controlling the
form.
   
 

May i missed something..?
Could you tell me how to set up the form?
   
 

should the view look something like that?:
   
 

{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
  web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
  }
});


{{=form}}
   
 

Thank  you in advance.
   
 

Dieter Asman
   
 

On 20 Mai, 14:54, Jason Lotzwrote:
   
 

You could try passing SCRIPT from the controller.
 
 

## View
{{extend 'layout.html'}}
This is the default/test.html template
{{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
table',db_name='db')}}
{{=script}}
 
 

## Controller
def jqgrid_table_test():
  script = """jQuery(document).ready(function(){
  jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form'); }});"""
  return SCRIPT(script)
 
 

I haven't tested this so let me know if it works out for you.
 
 

I am only using a single grid for my app so I actually included the
onSelectRow event to /models/jqgrid_plugin. The function
plugin_jqgrid() is where the default jqgrid script is retrieved when
the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
this way you will want to add it to the .jqGrid({ }) parameters not in
the 'navGrid', 'toolbar' or other extended option parameters.
 
 

Jay
 
 

On May 20, 8:47 pm, AsmanComwrote:
 
 

Could you help me setting this up too?
   
 

This is the view:
   
 

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}
jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
  web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
  }
   
 

});
   
 

This is the Controller:
   
 

def jqgrid_table_test():
  return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_ 
table',db_name='db'))
   
 

def form():
  id = request.args[0]
  form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
  TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
  TR("Admin",INPUT(_type="checkbox",_name="admin")),
   
 

TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
  TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
  TR("",INPUT(_type="submit",_value="SUBMIT"
  if form.accepts(request.vars,session):
  response.flash="form accepted"
  elif form.errors:
  response.flash="form is invalid"
  else:
  response.flash="please fill the form"
  return dict(form=form,vars=form.vars)
   
 


   
 

The JQGrid works, but underneath the Grid i only see the following
text:
jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
{ web2py_ajax_page('get','/core/default/form/'+
(postdata),null,'my_form'); } });
   
 

It would be very nice if you could help me gettin this to work.
Thank  you in advance.
   
 

Dieter Asman
   
   

[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

can this be caused by the function, which set in /static/
plugin_editable_jqgrid/plugin_editable_jqgrid.js ?:

   onSelectRow: function(id){
 if(id && lastSel!='' && id!==lastSel){
jQuery(grid_name).restoreRow(lastSel);
 }
 lastSel=id;
 jQuery(grid_name).editRow(id, true, '', '', '', '',
function(rowid, resultText){reload(grid_name,rowid, resultText);});
   },
colNames:col_names,
colModel:col_models,
pager: pager,
rowNum:10,
rowList:[10,100,1000],
sortorder: 'desc',
multiselect: true,
multiboxonly:true,
viewrecords: true,
editurl:edit_url,
caption: caption
  });

Thank  you in advance.

Dieter Asman

On 20 Mai, 15:52, Jason Lotz  wrote:
> Try
>
> {{=jqgrid_table}}
> 
> jQuery(document).ready(function(){
> jQuery("#grid_id").jqGrid({
>      onSelectRow: function(postdata) {
> web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});
> 
>
> On 05/20/2010 10:45 PM, AsmanCom wrote:
>
> > Thanks for your effort, but it gives an empty page..
> > I will use two or more Grids at least one of them must keep the
> > "editable" behaveure.
> > But in this case it should work like your approach, controlling the
> > form.
>
> > May i missed something..?
> > Could you tell me how to set up the form?
>
> > should the view look something like that?:
>
> > {{=jqgrid_table}}
> > 
> > jQuery("#grid_id").jqGrid({
> >      onSelectRow: function(postdata) {
> >              web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >      }
>
> > });
> > 
> > 
> > {{=form}}
>
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 20 Mai, 14:54, Jason Lotz  wrote:
>
> >> You could try passing SCRIPT from the controller.
>
> >> ## View
> >> {{extend 'layout.html'}}
> >> This is the default/test.html template
> >> {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >> table',db_name='db')}}
> >> {{=script}}
>
> >> ## Controller
> >> def jqgrid_table_test():
> >>      script = """jQuery(document).ready(function(){
> >>                      jQuery("#grid_id").jqGrid({
> >>                          onSelectRow: function(postdata)
> >> {web2py_ajax_page('get','/myapp/default/form/'+
> >> (postdata),null,'my_form'); }});"""
> >>      return SCRIPT(script)
>
> >> I haven't tested this so let me know if it works out for you.
>
> >> I am only using a single grid for my app so I actually included the
> >> onSelectRow event to /models/jqgrid_plugin. The function
> >> plugin_jqgrid() is where the default jqgrid script is retrieved when
> >> the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
> >> this way you will want to add it to the .jqGrid({ }) parameters not in
> >> the 'navGrid', 'toolbar' or other extended option parameters.
>
> >> Jay
>
> >> On May 20, 8:47 pm, AsmanCom  wrote:
>
> >>> Could you help me setting this up too?
>
> >>> This is the view:
>
> >>> {{extend 'layout.html'}}
> >>> This is the default/test.html template
> >>> {{=jqgrid_table}}
> >>> jQuery("#grid_id").jqGrid({
> >>>      onSelectRow: function(postdata) {
> >>>              web2py_ajax_page('get','/myapp/default/form/'+
> >>> (postdata),null,'my_form');
> >>>      }
>
> >>> });
>
> >>> This is the Controller:
>
> >>> def jqgrid_table_test():
> >>>      return
> >>> dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >>>  table',db_name='db'))
>
> >>> def form():
> >>>      id = request.args[0]
> >>>      form=FORM(TABLE(TR("Your
> >>> name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
> >>>                      TR("Your
> >>> email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
> >>>                      TR("Admin",INPUT(_type="checkbox",_name="admin")),
>
> >>> TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no']))
> >>>  ),
> >>>                      TR("Profile",TEXTAREA(_name="profile",value="write
> >>> something here")),
> >>>                      TR("",INPUT(_type="submit",_value="SUBMIT"
> >>>      if form.accepts(request.vars,session):
> >>>          response.flash="form accepted"
> >>>      elif form.errors:
> >>>          response.flash="form is invalid"
> >>>      else:
> >>>          response.flash="please fill the form"
> >>>      return dict(form=form,vars=form.vars)
>
> >>> 
>
> >>> The JQGrid works, but underneath the Grid i only see the following
> >>> text:
> >>> jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
> >>> { web2py_ajax_page('get','/core/default/form/'+
> >>> (postdata),null,'my_form'); } });
>
> >>> It would be very nice if you could help me gettin this to work.
> >>> Thank  you in advance.
>
> >>> Dieter Asman
>
> >>> On 17 Mai, 08:22, Jason Lotz  wrote:
>
>  Thanks mdipierro!!
>
>  I actually saw that in the header of the generated page but didn't put
>  it together. For what ever reason, trying to call web2py_component
>  from another function

Re: [web2py] Re: "SSL is OFF" error message when starting the server

The output you show is that it's trying to compile openssl into the ssl 
module.  You'll need to install the openssl headers.  The debian package 
name is probably something like "openssl-dev".


-tim

On 5/19/2010 5:30 PM, OMAR wrote:

Tim, thanks for the speedy reply. Sorry to say I'm still stuck.

I downloaded the ssl1.5 package and unpacked it.

I figured the next step would be, "python setup.py install"

Here was the output:

looking for /usr/include/openssl/ssl.h
looking for /usr/local/ssl/include/openssl/ssl.h
looking for /usr/contrib/ssl/include/openssl/ssl.h
Traceback (most recent call last):
   File "setup.py", line 167, in
 ssl_incs, ssl_libs, libs = find_ssl()
   File "setup.py", line 142, in find_ssl
 raise Exception("No SSL support found")
Exception: No SSL support found


Everything on this Debian box was installed via the aptitude package
manager.
Is the conflict here that it's looking for directories that would be
there had I installed from source?
That's just my wild guess.
Any ideas?
Help would be greatly appreciated.


   




Re: [web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component


What do you mean the form doesn't show?

Do you have a DIV for the form to load in your view?

{{=LOAD('default','form',args=1,ajax=True,target='my_form')}}

Does this not reload as you select a row from from the grid?




On 05/20/2010 11:40 PM, AsmanCom wrote:

I tried like that:

View:

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {web2py_ajax_page('get','/myapp/
default/form/'+(postdata),null,'my_form');}});


Controller:

def jqgrid_table_test():
 return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))

def form():
 #id = request.args[0]
 form = SQLFORM(db.jqgrid_table)
 if form.accepts(request.vars, session):
 response.flash = 'form accepted'
 elif form.errors:
 response.flash = 'form has errors'
 else:
 response.flash = 'please fill out the form'
 return dict(form=form)

##

Now the Grid is showed, but no form.

do you have any further suggestions?

Thank  you in advance.

Dieter Asman

On 20 Mai, 15:52, Jason Lotz  wrote:
   

Try

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});


On 05/20/2010 10:45 PM, AsmanCom wrote:

 

Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach, controlling the
form.
   
 

May i missed something..?
Could you tell me how to set up the form?
   
 

should the view look something like that?:
   
 

{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
  web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
  }
});


{{=form}}
   
 

Thank  you in advance.
   
 

Dieter Asman
   
 

On 20 Mai, 14:54, Jason Lotzwrote:
   
 

You could try passing SCRIPT from the controller.
 
 

## View
{{extend 'layout.html'}}
This is the default/test.html template
{{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
table',db_name='db')}}
{{=script}}
 
 

## Controller
def jqgrid_table_test():
  script = """jQuery(document).ready(function(){
  jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form'); }});"""
  return SCRIPT(script)
 
 

I haven't tested this so let me know if it works out for you.
 
 

I am only using a single grid for my app so I actually included the
onSelectRow event to /models/jqgrid_plugin. The function
plugin_jqgrid() is where the default jqgrid script is retrieved when
the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
this way you will want to add it to the .jqGrid({ }) parameters not in
the 'navGrid', 'toolbar' or other extended option parameters.
 
 

Jay
 
 

On May 20, 8:47 pm, AsmanComwrote:
 
 

Could you help me setting this up too?
   
 

This is the view:
   
 

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}
jQuery("#grid_id").jqGrid({
  onSelectRow: function(postdata) {
  web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
  }
   
 

});
   
 

This is the Controller:
   
 

def jqgrid_table_test():
  return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_ 
table',db_name='db'))
   
 

def form():
  id = request.args[0]
  form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
  TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
  TR("Admin",INPUT(_type="checkbox",_name="admin")),
   
 

TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
  TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
  TR("",INPUT(_type="submit",_value="SUBMIT"
  if form.accepts(request.vars,session):
  response.flash="form accepted"
  elif form.errors:
  response.flash="form is invalid"
  else:
  response.flash="please fill the form"
  return dict(form=form,vars=form.vars)
   
 


   
 

The JQGrid works, but underneath the Grid i only see the following

[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

I tried like that:

View:

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
 onSelectRow: function(postdata) {web2py_ajax_page('get','/myapp/
default/form/'+(postdata),null,'my_form');}});


Controller:

def jqgrid_table_test():
return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))

def form():
#id = request.args[0]
form = SQLFORM(db.jqgrid_table)
if form.accepts(request.vars, session):
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill out the form'
return dict(form=form)

##

Now the Grid is showed, but no form.

do you have any further suggestions?

Thank  you in advance.

Dieter Asman

On 20 Mai, 15:52, Jason Lotz  wrote:
> Try
>
> {{=jqgrid_table}}
> 
> jQuery(document).ready(function(){
> jQuery("#grid_id").jqGrid({
>      onSelectRow: function(postdata) {
> web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});
> 
>
> On 05/20/2010 10:45 PM, AsmanCom wrote:
>
> > Thanks for your effort, but it gives an empty page..
> > I will use two or more Grids at least one of them must keep the
> > "editable" behaveure.
> > But in this case it should work like your approach, controlling the
> > form.
>
> > May i missed something..?
> > Could you tell me how to set up the form?
>
> > should the view look something like that?:
>
> > {{=jqgrid_table}}
> > 
> > jQuery("#grid_id").jqGrid({
> >      onSelectRow: function(postdata) {
> >              web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >      }
>
> > });
> > 
> > 
> > {{=form}}
>
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 20 Mai, 14:54, Jason Lotz  wrote:
>
> >> You could try passing SCRIPT from the controller.
>
> >> ## View
> >> {{extend 'layout.html'}}
> >> This is the default/test.html template
> >> {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >> table',db_name='db')}}
> >> {{=script}}
>
> >> ## Controller
> >> def jqgrid_table_test():
> >>      script = """jQuery(document).ready(function(){
> >>                      jQuery("#grid_id").jqGrid({
> >>                          onSelectRow: function(postdata)
> >> {web2py_ajax_page('get','/myapp/default/form/'+
> >> (postdata),null,'my_form'); }});"""
> >>      return SCRIPT(script)
>
> >> I haven't tested this so let me know if it works out for you.
>
> >> I am only using a single grid for my app so I actually included the
> >> onSelectRow event to /models/jqgrid_plugin. The function
> >> plugin_jqgrid() is where the default jqgrid script is retrieved when
> >> the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
> >> this way you will want to add it to the .jqGrid({ }) parameters not in
> >> the 'navGrid', 'toolbar' or other extended option parameters.
>
> >> Jay
>
> >> On May 20, 8:47 pm, AsmanCom  wrote:
>
> >>> Could you help me setting this up too?
>
> >>> This is the view:
>
> >>> {{extend 'layout.html'}}
> >>> This is the default/test.html template
> >>> {{=jqgrid_table}}
> >>> jQuery("#grid_id").jqGrid({
> >>>      onSelectRow: function(postdata) {
> >>>              web2py_ajax_page('get','/myapp/default/form/'+
> >>> (postdata),null,'my_form');
> >>>      }
>
> >>> });
>
> >>> This is the Controller:
>
> >>> def jqgrid_table_test():
> >>>      return
> >>> dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> >>>  table',db_name='db'))
>
> >>> def form():
> >>>      id = request.args[0]
> >>>      form=FORM(TABLE(TR("Your
> >>> name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
> >>>                      TR("Your
> >>> email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
> >>>                      TR("Admin",INPUT(_type="checkbox",_name="admin")),
>
> >>> TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no']))
> >>>  ),
> >>>                      TR("Profile",TEXTAREA(_name="profile",value="write
> >>> something here")),
> >>>                      TR("",INPUT(_type="submit",_value="SUBMIT"
> >>>      if form.accepts(request.vars,session):
> >>>          response.flash="form accepted"
> >>>      elif form.errors:
> >>>          response.flash="form is invalid"
> >>>      else:
> >>>          response.flash="please fill the form"
> >>>      return dict(form=form,vars=form.vars)
>
> >>> 
>
> >>> The JQGrid works, but underneath the Grid i only see the following
> >>> text:
> >>> jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
> >>> { web2py_ajax_page('get','/core/default/form/'+
> >>> (postdata),null,'my_form'); } });
>
> >>> It would be very nice if you could help me gettin this to work.
> >>> Thank  you in advance.
>
> >>> Dieter Asman
>
> >>> On 17 Mai, 08:22, Jason Lotz  wrote:
>
>  Thanks mdipierro!!
>
>  I 

Re: [web2py] Re: new in Django

Hi Pepe,

I did not mean that in a negative tone, I do respect designers a great
deal, they have a gift that seems to allude me =)

I have strong feelings towards my < > <= signs... its just a part of
programming, why change the standard? I won't use MongoDB either
because they use the same $lt $gte syntax.

Then again, I miss c-style pointers with asterisks... so maybe I'm
just an odd ball for liking symbolic languages.

When I said django is not catching up, to compete with web2py they
need to satisfy the part of me that likes using symbols instead of
text to represent something.

You said your a designer, I might need you for some projects! =)

--
Thadeus





On Thu, May 20, 2010 at 12:43 AM, Pepe  wrote:
> Thadeus, What is your problem with designers, men?
>
> I'm designer and use web2py because i don't like django... I've learnt
> to programming in my school and my partners (today doctors, lawyers,
> biochemicals) know to programming too (the logic, obviously, I'm sure
> they forget all the rest, haha!), and I'm sure that they love to read
> a really good syntax-code and not an aberration like "__lte=5" .
>
> Obviously, I don't know and i don't have all the knowledge that a
> developer have, and I respect them all.
>
> Please, don't generalize. I respect you and I greatly appreciate your
> contributions, really!
>
> Best regards,
>
> Pepe.
>
> On May 18, 5:19 pm, Thadeus Burgess  wrote:
>> Polls.objects.get(order__lte=5)
>>
>> No... no their not.
>>
>> Still a designer based framework, and developer limiting.
>>
>> --
>> Thadeus
>>
>> On Tue, May 18, 2010 at 4:11 PM, Kuba Kucharski
>>
>>
>>
>>  wrote:
>> >http://docs.djangoproject.com/en/dev/releases/1.2/
>>
>> > "Support for multiple database connections in a single Django instance."
>>
>> > django is catching up ;)
>>
>> > --
>> > Kuba
>


Re: [web2py] google fonts

On Thu, May 20, 2010 at 3:50 PM, Jonathan Lundell wrote:

> On May 20, 2010, at 5:51 AM, Albert Abril wrote:
>
> Woow! Nice.
>
> As said in the FAQ:
> *All the fonts in the Google Font Directory
>  are licensed under open source licenses that let you use them on any
> website*
>
>
> ...as long as it's being viewed with a browser that supports @font-face...
>

Like:

   - Google Chrome: version 4.249.4+
   - Mozilla Firefox: version: 3.5+
   - Apple Safari: version 3.1+
   - Microsoft Internet Explorer: version 6+

If someone using an unsupported browser visits a page that uses the Font
API, then the text is displayed using the next available font in your CSS
font stack.





>
>
> On Thu, May 20, 2010 at 2:35 PM, mdipierro 
> wrote:
>
>> http://code.google.com/webfonts/preview
>>
>
>
>
>


[web2py] Re: Upload Pic into web2py

Thanks  mdipierro   for your help

On May 20, 5:17 pm, mdipierro  wrote:
> Yes:
>
> Field('file','upoad',requires=IS_LENGTH(500*1024))
>
> should do the trick.
>
> On May 20, 9:02 am, Neveen Adel  wrote:
>
> > Hello,
>
> > how can i limit uploaded pic size to be not exceed  500 kB?
>
> > My mainly problem is that all uploaded pics saved into folder uploads
> > and by the time that will cause system failure (because of space)??
>
> > If there is any solution to this problem ?and if the first question
> > fix this problem?
>
> > Thanks
>
> > Neveen


[web2py] Re: Upload Pic into web2py

Yes:

Field('file','upoad',requires=IS_LENGTH(500*1024))

should do the trick.

On May 20, 9:02 am, Neveen Adel  wrote:
> Hello,
>
> how can i limit uploaded pic size to be not exceed  500 kB?
>
> My mainly problem is that all uploaded pics saved into folder uploads
> and by the time that will cause system failure (because of space)??
>
> If there is any solution to this problem ?and if the first question
> fix this problem?
>
> Thanks
>
> Neveen


[web2py] Re: "SSL is OFF" error message when starting the server

try

apt-get install python-openssl
apt-get install python-distutil
easy_install ssl



On May 20, 9:00 am, OMAR  wrote:
> Yes, I understand. I already downloaded package ssl 1.15
>
> However, I was unable to install the module. See the listing of errors
> posted above.
>
> I don't mean to clutter this group with questions not directly related
> to web2py. I'm currently stuck because I do not understand how to
> install the ssl module, not because of some web2py bug.
>
> However, I feel this is still related to the installation and
> operation of web2py. So far, I've been unable to use web2py, despite
> claims that one could start working immediately.
>
> I was drawn to the idea that web2py "does not require installation or
> configuration"  Apparently, some configuration and additional
> installation of dependencies is needed for web2py operation on a
> remote server.
>
> While my own limitations in python, linux, etc., may be seen as the
> problem here, it speaks to a larger point about web2py. The popularity
> and acceptance of this program may be hurt by others having similar
> problems. I was not able to upload web2py to my remote server, and
> begin working. First, I had to configure the SSH tunnel, and now I
> find the built-in web2py server requires installation of additional
> python modules before one can access the admin features.
>
> I will figure this out (with some help, most likely) and look forward
> to exploring web2py.


[web2py] Upload Pic into web2py

Hello,

how can i limit uploaded pic size to be not exceed  500 kB?

My mainly problem is that all uploaded pics saved into folder uploads
and by the time that will cause system failure (because of space)??


If there is any solution to this problem ?and if the first question
fix this problem?


Thanks

Neveen


[web2py] Re: "SSL is OFF" error message when starting the server

Yes, I understand. I already downloaded package ssl 1.15

However, I was unable to install the module. See the listing of errors
posted above.

I don't mean to clutter this group with questions not directly related
to web2py. I'm currently stuck because I do not understand how to
install the ssl module, not because of some web2py bug.

However, I feel this is still related to the installation and
operation of web2py. So far, I've been unable to use web2py, despite
claims that one could start working immediately.

I was drawn to the idea that web2py "does not require installation or
configuration"  Apparently, some configuration and additional
installation of dependencies is needed for web2py operation on a
remote server.

While my own limitations in python, linux, etc., may be seen as the
problem here, it speaks to a larger point about web2py. The popularity
and acceptance of this program may be hurt by others having similar
problems. I was not able to upload web2py to my remote server, and
begin working. First, I had to configure the SSH tunnel, and now I
find the built-in web2py server requires installation of additional
python modules before one can access the admin features.

I will figure this out (with some help, most likely) and look forward
to exploring web2py.











Re: [web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component


Try

{{=jqgrid_table}}

jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
onSelectRow: function(postdata) { web2py_ajax_page('get','/myapp/default/form/'+(postdata),null,'my_form');}});




On 05/20/2010 10:45 PM, AsmanCom wrote:

Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach, controlling the
form.

May i missed something..?
Could you tell me how to set up the form?

should the view look something like that?:

{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
 onSelectRow: function(postdata) {
 web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
 }

});


{{=form}}

Thank  you in advance.

Dieter Asman

On 20 Mai, 14:54, Jason Lotz  wrote:
   

You could try passing SCRIPT from the controller.

## View
{{extend 'layout.html'}}
This is the default/test.html template
{{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
table',db_name='db')}}
{{=script}}

## Controller
def jqgrid_table_test():
 script = """jQuery(document).ready(function(){
 jQuery("#grid_id").jqGrid({
 onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form'); }});"""
 return SCRIPT(script)

I haven't tested this so let me know if it works out for you.

I am only using a single grid for my app so I actually included the
onSelectRow event to /models/jqgrid_plugin. The function
plugin_jqgrid() is where the default jqgrid script is retrieved when
the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
this way you will want to add it to the .jqGrid({ }) parameters not in
the 'navGrid', 'toolbar' or other extended option parameters.

Jay

On May 20, 8:47 pm, AsmanCom  wrote:

 

Could you help me setting this up too?
   
 

This is the view:
   
 

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}
jQuery("#grid_id").jqGrid({
 onSelectRow: function(postdata) {
 web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
 }
   
 

});
   
 

This is the Controller:
   
 

def jqgrid_table_test():
 return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_ 
table',db_name='db'))
   
 

def form():
 id = request.args[0]
 form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
 TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
 TR("Admin",INPUT(_type="checkbox",_name="admin")),
   
 

TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
 TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
 TR("",INPUT(_type="submit",_value="SUBMIT"
 if form.accepts(request.vars,session):
 response.flash="form accepted"
 elif form.errors:
 response.flash="form is invalid"
 else:
 response.flash="please fill the form"
 return dict(form=form,vars=form.vars)
   
 


   
 

The JQGrid works, but underneath the Grid i only see the following
text:
jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
{ web2py_ajax_page('get','/core/default/form/'+
(postdata),null,'my_form'); } });
   
 

It would be very nice if you could help me gettin this to work.
Thank  you in advance.
   
 

Dieter Asman
   
 

On 17 Mai, 08:22, Jason Lotz  wrote:
   
 

Thanks mdipierro!!
 
 

I actually saw that in the header of the generated page but didn't put
it together. For what ever reason, trying to call web2py_component
from another function wouldn't work, but calling web2py_ajax_page
directly worked!
 
 

Working code:
 
 

jQuery("#grid_id").jqGrid({
 onSelectRow: function(postdata) {
 web2py_ajax_page('get','/Test/default/a_form/'+
(postdata),null,'my_form');
 }
 
 

});
 
 

Jay
 
 

On May 17, 2:35 pm, mdipierro  wrote:
 
 

This is the definition of web2py_component
   
 

function web2py_component(action,target)
{
 jQuery(document).ready(function()
{ web2py_ajax_page('get',action,null,target); });
   
 

}
   
 

I think you just want to call web2py_ajax_page instead of
web2py_component.
   
 

On May 16, 11:50 pm, Jason Lotz  wrote:
   
 

I was using an iframe to show the details of a selected row from
jqgrid. Which worked. However I realized that it is a pain to get
iframe to recognize parent size so resizing produces an awkward
looking form. I came across web2py LO

Re: [web2py] google fonts

On May 20, 2010, at 5:51 AM, Albert Abril wrote:

> Woow! Nice.
> 
> As said in the FAQ: 
> All the fonts in the Google Font Directory are licensed under open source 
> licenses that let you use them on any website

...as long as it's being viewed with a browser that supports @font-face...

> 
> On Thu, May 20, 2010 at 2:35 PM, mdipierro  wrote:
> http://code.google.com/webfonts/preview
> 




[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

Thanks for your effort, but it gives an empty page..
I will use two or more Grids at least one of them must keep the
"editable" behaveure.
But in this case it should work like your approach, controlling the
form.

May i missed something..?
Could you tell me how to set up the form?

should the view look something like that?:

{{=jqgrid_table}}

jQuery("#grid_id").jqGrid({
onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
}

});


{{=form}}

Thank  you in advance.

Dieter Asman

On 20 Mai, 14:54, Jason Lotz  wrote:
> You could try passing SCRIPT from the controller.
>
> ## View
> {{extend 'layout.html'}}
> This is the default/test.html template
> {{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
> table',db_name='db')}}
> {{=script}}
>
> ## Controller
> def jqgrid_table_test():
>     script = """jQuery(document).ready(function(){
>                     jQuery("#grid_id").jqGrid({
>                         onSelectRow: function(postdata)
> {web2py_ajax_page('get','/myapp/default/form/'+
> (postdata),null,'my_form'); }});"""
>     return SCRIPT(script)
>
> I haven't tested this so let me know if it works out for you.
>
> I am only using a single grid for my app so I actually included the
> onSelectRow event to /models/jqgrid_plugin. The function
> plugin_jqgrid() is where the default jqgrid script is retrieved when
> the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
> this way you will want to add it to the .jqGrid({ }) parameters not in
> the 'navGrid', 'toolbar' or other extended option parameters.
>
> Jay
>
> On May 20, 8:47 pm, AsmanCom  wrote:
>
> > Could you help me setting this up too?
>
> > This is the view:
>
> > {{extend 'layout.html'}}
> > This is the default/test.html template
> > {{=jqgrid_table}}
> > jQuery("#grid_id").jqGrid({
> >     onSelectRow: function(postdata) {
> >             web2py_ajax_page('get','/myapp/default/form/'+
> > (postdata),null,'my_form');
> >     }
>
> > });
>
> > This is the Controller:
>
> > def jqgrid_table_test():
> >     return
> > dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_ 
> > table',db_name='db'))
>
> > def form():
> >     id = request.args[0]
> >     form=FORM(TABLE(TR("Your
> > name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
> >                     TR("Your
> > email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
> >                     TR("Admin",INPUT(_type="checkbox",_name="admin")),
>
> > TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) 
> > ),
> >                     TR("Profile",TEXTAREA(_name="profile",value="write
> > something here")),
> >                     TR("",INPUT(_type="submit",_value="SUBMIT"
> >     if form.accepts(request.vars,session):
> >         response.flash="form accepted"
> >     elif form.errors:
> >         response.flash="form is invalid"
> >     else:
> >         response.flash="please fill the form"
> >     return dict(form=form,vars=form.vars)
>
> > 
>
> > The JQGrid works, but underneath the Grid i only see the following
> > text:
> > jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
> > { web2py_ajax_page('get','/core/default/form/'+
> > (postdata),null,'my_form'); } });
>
> > It would be very nice if you could help me gettin this to work.
> > Thank  you in advance.
>
> > Dieter Asman
>
> > On 17 Mai, 08:22, Jason Lotz  wrote:
>
> > > Thanks mdipierro!!
>
> > > I actually saw that in the header of the generated page but didn't put
> > > it together. For what ever reason, trying to call web2py_component
> > > from another function wouldn't work, but calling web2py_ajax_page
> > > directly worked!
>
> > > Working code:
>
> > > jQuery("#grid_id").jqGrid({
> > >     onSelectRow: function(postdata) {
> > >             web2py_ajax_page('get','/Test/default/a_form/'+
> > > (postdata),null,'my_form');
> > >     }
>
> > > });
>
> > > Jay
>
> > > On May 17, 2:35 pm, mdipierro  wrote:
>
> > > > This is the definition of web2py_component
>
> > > > function web2py_component(action,target)
> > > > {
> > > >     jQuery(document).ready(function()
> > > > { web2py_ajax_page('get',action,null,target); });
>
> > > > }
>
> > > > I think you just want to call web2py_ajax_page instead of
> > > > web2py_component.
>
> > > > On May 16, 11:50 pm, Jason Lotz  wrote:
>
> > > > > I was using an iframe to show the details of a selected row from
> > > > > jqgrid. Which worked. However I realized that it is a pain to get
> > > > > iframe to recognize parent size so resizing produces an awkward
> > > > > looking form. I came across web2py LOAD helper and thought it to be a
> > > > > good fix to my frame resizing issue.
>
> > > > > I'm trying to change a LOAD(form) based on the row_id from a selected
> > > > > row in jqgrid. Using the jqgrid event onSelectRow I'm trying to
> > > > > trigger web2py_compone

[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

You could try passing SCRIPT from the controller.

## View
{{extend 'layout.html'}}
This is the default/test.html template
{{=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_
table',db_name='db')}}
{{=script}}


## Controller
def jqgrid_table_test():
script = """jQuery(document).ready(function(){
jQuery("#grid_id").jqGrid({
onSelectRow: function(postdata)
{web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form'); }});"""
return SCRIPT(script)


I haven't tested this so let me know if it works out for you.

I am only using a single grid for my app so I actually included the
onSelectRow event to /models/jqgrid_plugin. The function
plugin_jqgrid() is where the default jqgrid script is retrieved when
the {{=plugin_jqgrid(db.table,columns=[...])}} is called. If you do it
this way you will want to add it to the .jqGrid({ }) parameters not in
the 'navGrid', 'toolbar' or other extended option parameters.


Jay


On May 20, 8:47 pm, AsmanCom  wrote:
> Could you help me setting this up too?
>
> This is the view:
>
> {{extend 'layout.html'}}
> This is the default/test.html template
> {{=jqgrid_table}}
> jQuery("#grid_id").jqGrid({
>     onSelectRow: function(postdata) {
>             web2py_ajax_page('get','/myapp/default/form/'+
> (postdata),null,'my_form');
>     }
>
> });
>
> This is the Controller:
>
> def jqgrid_table_test():
>     return
> dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_ 
> table',db_name='db'))
>
> def form():
>     id = request.args[0]
>     form=FORM(TABLE(TR("Your
> name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
>                     TR("Your
> email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
>                     TR("Admin",INPUT(_type="checkbox",_name="admin")),
>
> TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no'])) ),
>                     TR("Profile",TEXTAREA(_name="profile",value="write
> something here")),
>                     TR("",INPUT(_type="submit",_value="SUBMIT"
>     if form.accepts(request.vars,session):
>         response.flash="form accepted"
>     elif form.errors:
>         response.flash="form is invalid"
>     else:
>         response.flash="please fill the form"
>     return dict(form=form,vars=form.vars)
>
> 
>
> The JQGrid works, but underneath the Grid i only see the following
> text:
> jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
> { web2py_ajax_page('get','/core/default/form/'+
> (postdata),null,'my_form'); } });
>
> It would be very nice if you could help me gettin this to work.
> Thank  you in advance.
>
> Dieter Asman
>
> On 17 Mai, 08:22, Jason Lotz  wrote:
>
>
>
> > Thanks mdipierro!!
>
> > I actually saw that in the header of the generated page but didn't put
> > it together. For what ever reason, trying to call web2py_component
> > from another function wouldn't work, but calling web2py_ajax_page
> > directly worked!
>
> > Working code:
>
> > jQuery("#grid_id").jqGrid({
> >     onSelectRow: function(postdata) {
> >             web2py_ajax_page('get','/Test/default/a_form/'+
> > (postdata),null,'my_form');
> >     }
>
> > });
>
> > Jay
>
> > On May 17, 2:35 pm, mdipierro  wrote:
>
> > > This is the definition of web2py_component
>
> > > function web2py_component(action,target)
> > > {
> > >     jQuery(document).ready(function()
> > > { web2py_ajax_page('get',action,null,target); });
>
> > > }
>
> > > I think you just want to call web2py_ajax_page instead of
> > > web2py_component.
>
> > > On May 16, 11:50 pm, Jason Lotz  wrote:
>
> > > > I was using an iframe to show the details of a selected row from
> > > > jqgrid. Which worked. However I realized that it is a pain to get
> > > > iframe to recognize parent size so resizing produces an awkward
> > > > looking form. I came across web2py LOAD helper and thought it to be a
> > > > good fix to my frame resizing issue.
>
> > > > I'm trying to change a LOAD(form) based on the row_id from a selected
> > > > row in jqgrid. Using the jqgrid event onSelectRow I'm trying to
> > > > trigger web2py_component to reload the form.
>
> > > > I came up with a test link to update the form, which worked.
>
> > > >     > > > onclick="web2py_component('{{=URL(...)}}','my_form');">Load Page 3
> > > >    {{=LOAD('default','a_form/1',ajax=True,target='my_form')}}
>
> > > > If possible I would like to get jqgrid to trigger the same
> > > > web2py_component feature.
>
> > > > My latest failed attempt was something like
>
> > > > jQuery(document.ready(function(){
> > > >     onSelectRow: function()
> > > > { jQuery("#my_form").trigger('web2py_component',['/Test/default/
> > > > a_form/'+(postdata),'my_form']);}
> > > > ;})
>
> > > > Is it possible to trigger web2py_component function or LOAD helper
> > > > without an action input (button or link)?
>
> > > > Jay


Re: [web2py] google fonts

Woow! Nice.

As said in the FAQ:
*All the fonts in the Google Font
Directoryare licensed under open
source licenses that let you use them on any website
*

On Thu, May 20, 2010 at 2:35 PM, mdipierro  wrote:

> http://code.google.com/webfonts/preview
>


[web2py] google fonts

http://code.google.com/webfonts/preview


[web2py] Re: new in Django

Hi Pepe,

I am sure Thadeus did not mean it is a negative sense. I am personally
envious of designer given my total lack of artistic skills.

I think what Thadeus means by Django is a "designer based framework"
is that they assume that designers cannot program and program and do
not allow them to put real python code in views. We do not make that
assumptions here and we are fully aware that the distinction between a
programmer and a designer is not very clear cut.

Massimo


On May 20, 12:43 am, Pepe  wrote:
> Thadeus, What is your problem with designers, men?
>
> I'm designer and use web2py because i don't like django... I've learnt
> to programming in my school and my partners (today doctors, lawyers,
> biochemicals) know to programming too (the logic, obviously, I'm sure
> they forget all the rest, haha!), and I'm sure that they love to read
> a really good syntax-code and not an aberration like "__lte=5" .
>
> Obviously, I don't know and i don't have all the knowledge that a
> developer have, and I respect them all.
>
> Please, don't generalize. I respect you and I greatly appreciate your
> contributions, really!
>
> Best regards,
>
> Pepe.
>
> On May 18, 5:19 pm, Thadeus Burgess  wrote:
>
> > Polls.objects.get(order__lte=5)
>
> > No... no their not.
>
> > Still a designer based framework, and developer limiting.
>
> > --
> > Thadeus
>
> > On Tue, May 18, 2010 at 4:11 PM, Kuba Kucharski
>
> >  wrote:
> > >http://docs.djangoproject.com/en/dev/releases/1.2/
>
> > > "Support for multiple database connections in a single Django instance."
>
> > > django is catching up ;)
>
> > > --
> > > Kuba


[web2py] Charset problem

Hi,

In reference to thread:
http://groups.google.com/group/web2py/browse_thread/thread/424731b5f6449513/e5bab3ec6e68a505

So far, the application was a series of reports, but now I need to
write to the database.
The charset of the database is latin1, and my db object I define it as
follows:
db = DAL ("mssql ://..., db_codec = 'latin1')

As I said in another thread with the parameter db_codec = 'latin1' I
can see the contents of the database correctly.

The problem I have is when I write, it seems not to respect the
db_codec latin1 and use another.

How do I fix this problem?

Jose


[web2py] Re: [SOLVED] jqgrid onSelectRow trigger web2py_component

Could you help me setting this up too?

This is the view:

{{extend 'layout.html'}}
This is the default/test.html template
{{=jqgrid_table}}
jQuery("#grid_id").jqGrid({
onSelectRow: function(postdata) {
web2py_ajax_page('get','/myapp/default/form/'+
(postdata),null,'my_form');
}

});

This is the Controller:

def jqgrid_table_test():
return
dict(jqgrid_table=plugin_editable_jqgrid(db.jqgrid_table,grid_name='jqgrid_table',db_name='db'))

def form():
id = request.args[0]
form=FORM(TABLE(TR("Your
name:",INPUT(_type="text",_name="name",requires=IS_NOT_EMPTY())),
TR("Your
email:",INPUT(_type="text",_name="email",requires=IS_EMAIL())),
TR("Admin",INPUT(_type="checkbox",_name="admin")),
 
TR("Sure?",SELECT('yes','no',_name="sure",requires=IS_IN_SET(['yes','no']))),
TR("Profile",TEXTAREA(_name="profile",value="write
something here")),
TR("",INPUT(_type="submit",_value="SUBMIT"
if form.accepts(request.vars,session):
response.flash="form accepted"
elif form.errors:
response.flash="form is invalid"
else:
response.flash="please fill the form"
return dict(form=form,vars=form.vars)




The JQGrid works, but underneath the Grid i only see the following
text:
jQuery("#grid_id").jqGrid({ onSelectRow: function(postdata)
{ web2py_ajax_page('get','/core/default/form/'+
(postdata),null,'my_form'); } });


It would be very nice if you could help me gettin this to work.
Thank  you in advance.

Dieter Asman



On 17 Mai, 08:22, Jason Lotz  wrote:
> Thanks mdipierro!!
>
> I actually saw that in the header of the generated page but didn't put
> it together. For what ever reason, trying to call web2py_component
> from another function wouldn't work, but calling web2py_ajax_page
> directly worked!
>
> Working code:
>
> jQuery("#grid_id").jqGrid({
>     onSelectRow: function(postdata) {
>             web2py_ajax_page('get','/Test/default/a_form/'+
> (postdata),null,'my_form');
>     }
>
> });
>
> Jay
>
> On May 17, 2:35 pm, mdipierro  wrote:
>
> > This is the definition of web2py_component
>
> > function web2py_component(action,target)
> > {
> >     jQuery(document).ready(function()
> > { web2py_ajax_page('get',action,null,target); });
>
> > }
>
> > I think you just want to call web2py_ajax_page instead of
> > web2py_component.
>
> > On May 16, 11:50 pm, Jason Lotz  wrote:
>
> > > I was using an iframe to show the details of a selected row from
> > > jqgrid. Which worked. However I realized that it is a pain to get
> > > iframe to recognize parent size so resizing produces an awkward
> > > looking form. I came across web2py LOAD helper and thought it to be a
> > > good fix to my frame resizing issue.
>
> > > I'm trying to change a LOAD(form) based on the row_id from a selected
> > > row in jqgrid. Using the jqgrid event onSelectRow I'm trying to
> > > trigger web2py_component to reload the form.
>
> > > I came up with a test link to update the form, which worked.
>
> > >     > > onclick="web2py_component('{{=URL(...)}}','my_form');">Load Page 3
> > >    {{=LOAD('default','a_form/1',ajax=True,target='my_form')}}
>
> > > If possible I would like to get jqgrid to trigger the same
> > > web2py_component feature.
>
> > > My latest failed attempt was something like
>
> > > jQuery(document.ready(function(){
> > >     onSelectRow: function()
> > > { jQuery("#my_form").trigger('web2py_component',['/Test/default/
> > > a_form/'+(postdata),'my_form']);}
> > > ;})
>
> > > Is it possible to trigger web2py_component function or LOAD helper
> > > without an action input (button or link)?
>
> > > Jay
>
>


[web2py] Re: Support Pycharm support for Web2py

on a second look, seems to be payed...

On May 20, 12:10 pm, blackthorne  wrote:
> wow,
> that is a charming project. I think this is a must!
>
> On May 19, 1:23 am, Richard  wrote:
>
>
>
> > has a YouTrack issue been created?
>
> > On May 18, 12:37 pm, mikech  wrote:
>
> > >http://www.jetbrains.net/devnet/message/5263114#5263114


[web2py] Re: Support Pycharm support for Web2py

wow,
that is a charming project. I think this is a must!

On May 19, 1:23 am, Richard  wrote:
> has a YouTrack issue been created?
>
> On May 18, 12:37 pm, mikech  wrote:
>
>
>
> >http://www.jetbrains.net/devnet/message/5263114#5263114


[web2py] Catch auto-login event

Hi,

I use the "Remember me for 30 days" feature in our app. I used a
custom auth_table with a column "last_login" to update every time a
user logs into the application.

Currently I update it in a function call like this:
---
def updateLastLogin(form):
 
db(db.auth_user.id==auth.user.id).update(last_login=datetime.datetime.now())

auth.settings.login_onaccept = updateLastLogin

--

However if a user chooses to "remember me for 30 days" then there's no
actual login action. What is the way to track last_login for such
users who visit the app but don't actually login? I basically need it
for analytics.

Thanks,
Aditya


[web2py] Re: hide id field in update or read-only forms

Thanks guys, I knew it would be a simple one. I need to remember to
set email updates when I post a new thread.


[web2py] Re: Display reference fields in read-only form

yes with Andrew Buchan tip of leaving out the requires it worked for
me too, however the solution was rather unintuitive
tnx to everybody for taking time to check this problem

On May 19, 1:00 pm, mdipierro  wrote:
> For me this works
>
> db.define_table('person',
>         Field('name'),
>         format = "%(name)s",
>         )
> db.define_table('contributers',
>         Field('person', db.person), # <<< requires not necessary
>         )
>
> def edit_contributer():
>   db.contributers.person.writable = False
>   record = request.args(0) #  0 not 1
>   form = crud.update(db.contributers, record)
>   return dict(form = form)
>
> On May 18, 5:45 am, selecta  wrote:
>
>
>
> > I have a similar problem
>
> > db.define_table('person',
> >         Field('name'),
> >         format = "%(name)s",
> >         )
> > db.define_table('contributers',
> >         Field('person', db.person, requires = IS_IN_DB(db,
> > 'person.id', '%(name)s')),
> >         )
>
> > def edit_contributer():
> >   db.contributers.person.writable = False
> >   record = request.args(1)
> >   form = crud.update(db.contributers, record)
> >   return dict(form = form)
>
> > the update form will only display the id not the name field :(
>
> > On May 17, 11:17 pm, howesc  wrote:
>
> > > Hi, i have this defined as a model:
>
> > > db.define_table('question',
> > >   Field('question', 'string', length=1056, notnull=True, unique=True,
> > >         requires=[IS_NOT_EMPTY(),
> > >                   IS_NOT_IN_DB(db,'question.question')]),
> > >   #version info
> > >   Field('created_by', db.auth_user, default=auth.user_id,
> > > writable=False),
> > >   Field('created_on','datetime', default=request.now,writable=False),
> > >   Field('updated_by',db.auth_user,
> > >         default=auth.user_id,update=auth.user_id,writable=False),
> > >   Field('updated_on','datetime',
> > >         default=request.now,update=request.now,writable=False),
> > >   migrate=migrate,
> > >   format='%(question)s (%(id)s)')
>
> > > then, in tables that reference it, when the reference field is not
> > > writable it uses the format string set at the end of the table
> > > definition instead of just the ID.
>
> > > hope that helps,
>
> > > cfh
>
> > > On May 17, 10:20 am, mdipierro  wrote:
>
> > > > yes. I misread the previous emails so my answer was wrong.
>
> > > > On May 17, 11:22 am, Iceberg  wrote:
>
> > > > > Not sure. Can't Field(..., writable=False) do the trick?
>
> > > > > On May17, 5:44pm, Andrew Buchan  wrote:
>
> > > > > > Hi all,
> > > > > > If I have a referenced field where I specify which field in the 
> > > > > > referenced table to display, like so:
> > > > > > Field('To_Department', requires = IS_IN_DB(db, db.department.id, 
> > > > > > '%(Department_Name)s')),
> > > > > > SQLFORM generates a form with a drop-down box showing me the 
> > > > > > Department_Name of the departments, but only if it is an INSERT or 
> > > > > > UPDATE form.
> > > > > > My question is, how do I get a read-only form to display the 
> > > > > > Department_Name instead of the id of the referenced record?
> > > > > > Can't seem to find an example or answer on the web, but there must 
> > > > > > surely be an easy way...
> > > > > > Thanks,Andy.
>
> > > > > > _http://clk.atdmt.com/UKM/go/19780/direct/01/
> > > > > > Do you have a story that started on Hotmail? Tell us now