[web2py:19006] Re: Writing a Book

2009-04-03 Thread LordMax

HI to all

On 2 Apr, 17:53, Álvaro Justen [Turicas] alvarojus...@gmail.com
wrote:

 Nice! I prefer the option long in-depth book. A quick-guide already

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



[web2py:19008] Re: DAL problem

2009-04-03 Thread TheDude

So, any suggestions?

On Apr 2, 6:42 pm, TheDude officed...@gmail.com wrote:
 Sorry, it's in my views :)

 {{extend 'layout.html'}}
 h2Message Boards/h2
 table align=center width=90% cellspacing=1 cellpadding=3
 class=data
 tr
 thBoard/th
 thThreads/th
 thPosts/th
 thLast Topic/th
 /tr
 {{for board in query:}}
 tr
 td{{=A(board.mb_boards.name, _href=URL(r=request, f='view',
 args=board.mb_boards.id))}}br /{{=board.mb_boards.description}}/td
 td{{=board.mb_boards.mb_posts.count()}}/td
 td{{=board.mb_boards.keys()}}/td
 td/td
 /tr
 {{pass}}
 /table

 On Apr 2, 6:38 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  what is board?

  On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:

   SQL Works! However...

   {{=board.mb_boards.keys()}}
   brings up:
   ['update_record', 'mb_posts', 'description', 'id', 'name']

   As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
   either). So, I said to myself may be it's because of the .ALL within
   the select. Still no go.

   On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

ry

def index():
    rows = (db.mb_posts.board_id==db.mb_boards.id)
(db.mb_posts.reply_to==0)
    mb_posts2 = db.mb_posts.with_alias(mb_posts2)
    rows2 = (mb_posts2.board_id==db.mb_boards.id)
    query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
(rows2)), groupby=db.mb_boards.id)
    return dict(query=query)

On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

 should be

 def index():
     rows = (db.mb_posts.board_id==db.mb_boards.id)
 (db.mb_posts.reply_to==0)
     mb_posts2 = db.mb_posts.with_alias(mb_posts2)
     rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
     query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
 db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
 (rows2)), groupby=db.mb_boards.id)
     return dict(query=query)

 On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

  def index():
      rows = (db.mb_posts.board_id==db.mb_boards.id)
  (db.mb_posts.reply_to==0)
      rows2 = (db.mb_posts.board_id==db.mb_boards.id)
      mb_posts2 = db.mb_posts.with_alias(mb_posts2)
      query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
  db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
  (rows2)), groupby=db.mb_boards.id)
      return dict(query=query)

  gives me
  OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19010] appengine error

2009-04-03 Thread Joseph Jude

Hi all,
I'm not sure if anyone of you got this error while running on
appengine (locally, using appengine launcher).

type 'exceptions.IOError': [Errno 13] file not accessible

going through the err pg, I see this at the end.

   web2py_path = os.environ.get('web2py_path', os.getcwd())
   web2py_version = open(os.path.join(web2py_path, 'VERSION'),
'r').read()

Don't know how to resolve this. Any idea?

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



[web2py:19012] Re: Writing a Book

2009-04-03 Thread TheDude

In response to cadrentes and to elaborate on the project more...

The book will be made for people who don't have a lot of time on their
hands and would like to get their hands dirty with Web2Py as fast as
possible. Most of the book will contain links to resources and guides,
including videos, recipes, plugins, and etc. It will help you migrate
into the Web2Py community easily and understand all of the jargon used
within Web2Py (which isn't a lot).

The only thing I'd be worried about is what cadrentes said, he doesn't
know much about programming but the web2py book assumes he does. The
thing is, web2py book is about..well learning web2py not programming.
There are many other excellent resources for learning python. In
Massimo's book, it seems like he does teach a bare-bones-minimum
python programming to get you by on what you need. So cadrentes, what
were some of the things that you found troubling in the Web2Py Manual
book?

Overall, I think I'll be writing a lot of versions of the book online
and keep improving on it, and then eventually publishing it once I
feel the book has matured enough.

Thanks for all of your help guys. :)

On Apr 3, 9:53 am, cadrentes cadren...@gmail.com wrote:
 I'm 38. I've been running Linux for a few years but I have no
 programming experience ecxept; copy and past some VBA in Excel, a few
 shell scripts, and a brief attempt at figuring out CakePHP.  I've had
 a copy of Massimo's book for about a month and it is great!   I've
 already put together a productivity application for my position at
 work.  But what really helps someone like me, who has about 20 minutes
 a day to study these things, are working examples and the vimeo's he
 put's out.  I find that applying a solution helps my understanding of
 the programming concept, which comes later.

 One thing I've noticed is that the programming community assumes I
 know much more about programming concepts than I actually do.  Having
 examples with links to elaboration would be ideal.

 On Apr 1, 12:28 pm, TheDude officed...@gmail.com wrote:

  (This isn't an April Fool's Joke)

  So, I've been writing a book for Web2Py, but recently came towards a
  new direction...we already have a great in-depth book writeen by
  Massimo so I was wondering...

  Would you guys be interested in a book for web2py like 250 pages long
  that goes in-depth? Or, a nice little quick start guide :D here's the
  thing, BOTH will be able to teach you the fundamentals that you'll
  need to create 80%+ web applications. One will just tell you how to do
  things, but then link you to the documentation page available on
  web2py.com for more information.

  Examples:
  (QuickStart)
  In order to create a table for our database, we'll need to bdefine/
  b our table.
  code:
  db.define_table('tablename',
  SQLField('fieldname','string', notnull=True)
  SQLField('fieldname2','integer', notnull=True),
  )

  Let's say we wanted to have a table reference the tablename table.
  db.define_table('table2',
  SQLField('tablename_id', db.tablename),
  SQLField('imafield','boolean'),
  )

  explain how the reference key works briefly then provide a link to
  the DAL explantion page for all options

  I think the quick-start guide will really help boost the web2py
  community and get people started on a project. It's similar to the
  Dojo, but a bit different since it'll go more in-depth than the Dojo
  but at the same time you don't have to  learn everything. :) It will
  skip things like What is MVC? and Why Web2Py framework etc. I
  believe Massimo has already full-filled that information.

  The book will be available online (HTML) and PDF as well as a
  published book.

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



[web2py:19015] Re: DAL problem

2009-04-03 Thread mdipierro

try:
{{=board.mb_boards.keys()}}
{{=board._extra}}

On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:
 SQL Works! However...

 {{=board.mb_boards.keys()}}
 brings up:
 ['update_record', 'mb_posts', 'description', 'id', 'name']

 As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
 either). So, I said to myself may be it's because of the .ALL within
 the select. Still no go.

 On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  ry

  def index():
      rows = (db.mb_posts.board_id==db.mb_boards.id)
  (db.mb_posts.reply_to==0)
      mb_posts2 = db.mb_posts.with_alias(mb_posts2)
      rows2 = (mb_posts2.board_id==db.mb_boards.id)
      query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
  mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
  (rows2)), groupby=db.mb_boards.id)
      return dict(query=query)

  On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

   should be

   def index():
       rows = (db.mb_posts.board_id==db.mb_boards.id)
   (db.mb_posts.reply_to==0)
       mb_posts2 = db.mb_posts.with_alias(mb_posts2)
       rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
       query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
   db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
   (rows2)), groupby=db.mb_boards.id)
       return dict(query=query)

   On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

def index():
    rows = (db.mb_posts.board_id==db.mb_boards.id)
(db.mb_posts.reply_to==0)
    rows2 = (db.mb_posts.board_id==db.mb_boards.id)
    mb_posts2 = db.mb_posts.with_alias(mb_posts2)
    query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
(rows2)), groupby=db.mb_boards.id)
    return dict(query=query)

gives me
OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19016] Re: T3 errors

2009-04-03 Thread mdipierro

The URI string in

db=SQLDB(mysql://root:localhost/db) # WRONG

is wrong. Should be

db=SQLDB(mysql://root:passw...@localhost/db) # RIGHT

You can find examples on

http://www.web2py.com/examples/default/dal



On Apr 3, 7:56 am, dbb debe...@yahoo.com wrote:
 To Prof.  Massimo : I have errors related to the database used in T3,
 I used mysql, then I get errors. The trace is pasted below. --
 Massimo, my ambition is to have a T3 pages  which can connect to
 different databases in the same applications. My pressing question now
 is , does T3 connect to other databases?

 Ticket 127.0.0.1.2009-04-03.08-47-27.8058e2e3-c31a-43bd-af62-
 bf042f0f38b9

 Error traceback
 1.2.3.4.5.6.7. Traceback (most recent call last):  File C:\web2py
 \gluon\restricted.py, line 98, in restricted  File C:/web2py59/
 applications/plugin_t3/models/db.py, line 10, in module    db=SQLDB
 (mysql://root:localhost/db)         # if not, use SQLite or other
 DB  File C:\web2py\gluon\sql.py, line 609, in
 __init__AttributeError: 'NoneType' object has no attribute 'group'

 In file: C:\web2py59\applications\plugin_t3/models/db.py
 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.101.102.103.104.105.106.107.108.109.110.111.112.113.114.115.116.117.118.119.120.121.122.123.124.125.126.127.128.129.130.131.132.133.134.135.136.137.138.139.140.141.142.143.144.145.146.147.148.149.150.151.
  connect to
 databaseimport os, traceback,
 datetimetry:    from gluon.contrib.gql import *         # if running
 on Google App Engineexcept:    db=SQLDB(mysql://root:localhost/
 db)         # if not, use SQLite or other DBelse:    db=GQLDB
 ()                              # connect to Google BigTable
 session.connect(request,response,db=db) # and store sessions
 there###
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:19017] Re: appengine error

2009-04-03 Thread mdipierro

Did you edit the app.yaml file? It does not see to be uploading the
VERSION file.

On Apr 3, 8:24 am, Joseph Jude ceph...@gmail.com wrote:
 Hi all,
 I'm not sure if anyone of you got this error while running on
 appengine (locally, using appengine launcher).

 type 'exceptions.IOError': [Errno 13] file not accessible

 going through the err pg, I see this at the end.

    web2py_path = os.environ.get('web2py_path', os.getcwd())
    web2py_version = open(os.path.join(web2py_path, 'VERSION'),
 'r').read()

 Don't know how to resolve this. Any idea?

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



[web2py:19018] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread Fran

On Apr 3, 1:06 pm, Timmie timmichel...@gmx-topmail.de wrote:
 * Is there someone working on a site with Geographical data or GIS
 capabilities

Yes, but not generalised:
http://trac.sahanapy.org/wiki/BluePrintGeographicInformationSystems

Am keen to collaborate where possible :)

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



[web2py:19019] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread mdipierro

You want to look into this and talk to authors:

http://trac.sahanapy.org/browser/models/_gis.py
http://trac.sahanapy.org/browser/controllers/gis.py

Massimo


On Apr 3, 6:06 am, Timmie timmichel...@gmx-topmail.de wrote:
 Dear web2py users/developers,
 I am mostly using python for scientific data processing.
 I would like to take my scripts to an internet/intranet site for a
 larger audience to benefit. Therefore I am evaluating python web
 frameworks.
 So far, the web2py approach is apealing most to me. Clean and easy to
 lean and administer.

 But for a choice it is also important what existing extensions exist.

 Here my questions:
 * Is there someone working on a site with Geographical data or GIS
 capabilities (e. g.:http://geo.turbogears.org/samplemap)?
     = I found the following threads:
         - Validators: IS_LAT  IS_LON [1]
         - Using stored procedures [2]
     = I didn't see any appliance (http://mdp.cti.depaul.edu/
 appliances) of
 such nature.
 * How hard would it be port the existing extensions from Turbogears of
 Django over? [3], [4]
 * Is there anyone using web2py for web based number crunching stuff?

 A statement on the capabilities and activities of web2py regarding the
 above mentioned requirements would be welcome.

 Regards,
 Timmie

 [1]http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
 [2]http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
 [3]http://geo.turbogears.org/
 [4]http://geodjango.org/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:19020] Re: DAL problem

2009-04-03 Thread TheDude

RIght tried those already...
.keys() brings up ['update_record', 'mb_posts', 'description', 'id',
'name']
board._extra = no xml error

I tried listing keys() and dir() mb_posts (see if it was somehow
placed in there but it isn't).

However, {{=query}} brings this...
mb_boards.idmb_boards.name  mb_boards.description   COUNT(mb_posts.id)
COUNT(mb_posts2.id)
1   Announcements   All important...1   1
2   General Discu...General talk ...1   1
3   Suggestions/B...Report any bu...0   0
4   Off-Topic   Not everythin...0   0


On Apr 3, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:
 try:
 {{=board.mb_boards.keys()}}
 {{=board._extra}}

 On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:

  SQL Works! However...

  {{=board.mb_boards.keys()}}
  brings up:
  ['update_record', 'mb_posts', 'description', 'id', 'name']

  As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
  either). So, I said to myself may be it's because of the .ALL within
  the select. Still no go.

  On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   ry

   def index():
       rows = (db.mb_posts.board_id==db.mb_boards.id)
   (db.mb_posts.reply_to==0)
       mb_posts2 = db.mb_posts.with_alias(mb_posts2)
       rows2 = (mb_posts2.board_id==db.mb_boards.id)
       query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
   mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
   (rows2)), groupby=db.mb_boards.id)
       return dict(query=query)

   On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

should be

def index():
    rows = (db.mb_posts.board_id==db.mb_boards.id)
(db.mb_posts.reply_to==0)
    mb_posts2 = db.mb_posts.with_alias(mb_posts2)
    rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
    query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
(rows2)), groupby=db.mb_boards.id)
    return dict(query=query)

On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

 def index():
     rows = (db.mb_posts.board_id==db.mb_boards.id)
 (db.mb_posts.reply_to==0)
     rows2 = (db.mb_posts.board_id==db.mb_boards.id)
     mb_posts2 = db.mb_posts.with_alias(mb_posts2)
     query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
 db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
 (rows2)), groupby=db.mb_boards.id)
     return dict(query=query)

 gives me
 OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19021] Re: Error message css style

2009-04-03 Thread Vidul Petrov

Finally managed to change the error messages format -
file: gluon/html.py
class:INPUT
method: xml

On Apr 3, 5:33 pm, Vidul Petrov vidul.r...@gmail.com wrote:
 Hi,

 I cannot find a way to resize the error message, the recaptcha is
 500px and the other input fields are only 210px, so the error message
 becomes 500px and I want it to be 210px for all but recaptcha. Any
 ideas?

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



[web2py:19022] Re: DAL problem

2009-04-03 Thread mdipierro

{{=board._extra[mb_posts2.id.count()]}} ?

On Apr 3, 10:01 am, TheDude officed...@gmail.com wrote:
 RIght tried those already...
 .keys() brings up ['update_record', 'mb_posts', 'description', 'id',
 'name']
 board._extra = no xml error

 I tried listing keys() and dir() mb_posts (see if it was somehow
 placed in there but it isn't).

 However, {{=query}} brings this...
 mb_boards.idmb_boards.name  mb_boards.description   COUNT(mb_posts.id)
 COUNT(mb_posts2.id)
 1   Announcements   All important...1   1
 2   General Discu...General talk ...1   1
 3   Suggestions/B...Report any bu...0   0
 4   Off-Topic   Not everythin...0   0

 On Apr 3, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:

  try:
  {{=board.mb_boards.keys()}}
  {{=board._extra}}

  On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:

   SQL Works! However...

   {{=board.mb_boards.keys()}}
   brings up:
   ['update_record', 'mb_posts', 'description', 'id', 'name']

   As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
   either). So, I said to myself may be it's because of the .ALL within
   the select. Still no go.

   On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

ry

def index():
rows = (db.mb_posts.board_id==db.mb_boards.id)
(db.mb_posts.reply_to==0)
mb_posts2 = db.mb_posts.with_alias(mb_posts2)
rows2 = (mb_posts2.board_id==db.mb_boards.id)
query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
(rows2)), groupby=db.mb_boards.id)
return dict(query=query)

On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

 should be

 def index():
 rows = (db.mb_posts.board_id==db.mb_boards.id)
 (db.mb_posts.reply_to==0)
 mb_posts2 = db.mb_posts.with_alias(mb_posts2)
 rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
 query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
 db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
 (rows2)), groupby=db.mb_boards.id)
 return dict(query=query)

 On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

  def index():
  rows = (db.mb_posts.board_id==db.mb_boards.id)
  (db.mb_posts.reply_to==0)
  rows2 = (db.mb_posts.board_id==db.mb_boards.id)
  mb_posts2 = db.mb_posts.with_alias(mb_posts2)
  query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
  db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
  (rows2)), groupby=db.mb_boards.id)
  return dict(query=query)

  gives me
  OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19023] Re: Error message css style

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 10:36 AM, Vidul Petrov vidul.r...@gmail.com wrote:


 Finally managed to change the error messages format -
 file: gluon/html.py
 class:INPUT
 method: xml


which uses  div.errors, so were you able to change format in
static/style.css?
Or did you do something else?

Just wondering...



 On Apr 3, 5:33 pm, Vidul Petrov vidul.r...@gmail.com wrote:
  Hi,
 
  I cannot find a way to resize the error message, the recaptcha is
  500px and the other input fields are only 210px, so the error message
  becomes 500px and I want it to be 210px for all but recaptcha. Any
  ideas?
 
  Thank you.
 


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



[web2py:19024] Re: DAL problem

2009-04-03 Thread TheDude

THat didn't work but..

{{=board._extra.keys()}} brings up ['COUNT(mb_posts.id)', 'COUNT
(mb_posts2.id)']

So I did {{=board._extra['COUNT(mb_posts2.id)']}} and it works!

Now, the only problem I have with this, is that it doesn't make to
much logical sense to do things this way (it doesn't seem like a
framework way more like a quick hack). Will there be any modifications
within this area in 1.6?

On Apr 3, 11:55 am, mdipierro mdipie...@cs.depaul.edu wrote:
 {{=board._extra[mb_posts2.id.count()]}} ?

 On Apr 3, 10:01 am, TheDude officed...@gmail.com wrote:

  RIght tried those already...
  .keys() brings up ['update_record', 'mb_posts', 'description', 'id',
  'name']
  board._extra = no xml error

  I tried listing keys() and dir() mb_posts (see if it was somehow
  placed in there but it isn't).

  However, {{=query}} brings this...
  mb_boards.id    mb_boards.name  mb_boards.description   COUNT(mb_posts.id)
  COUNT(mb_posts2.id)
  1       Announcements   All important...        1       1
  2       General Discu...        General talk ...        1       1
  3       Suggestions/B...        Report any bu...        0       0
  4       Off-Topic       Not everythin...        0       0

  On Apr 3, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:

   try:
   {{=board.mb_boards.keys()}}
   {{=board._extra}}

   On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:

SQL Works! However...

{{=board.mb_boards.keys()}}
brings up:
['update_record', 'mb_posts', 'description', 'id', 'name']

As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
either). So, I said to myself may be it's because of the .ALL within
the select. Still no go.

On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 ry

 def index():
     rows = (db.mb_posts.board_id==db.mb_boards.id)
 (db.mb_posts.reply_to==0)
     mb_posts2 = db.mb_posts.with_alias(mb_posts2)
     rows2 = (mb_posts2.board_id==db.mb_boards.id)
     query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
 mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
 (rows2)), groupby=db.mb_boards.id)
     return dict(query=query)

 On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

  should be

  def index():
      rows = (db.mb_posts.board_id==db.mb_boards.id)
  (db.mb_posts.reply_to==0)
      mb_posts2 = db.mb_posts.with_alias(mb_posts2)
      rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
      query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
  db.mb_posts2.id.count(), left=(db.mb_posts.on(rows),db.mb_posts2.on
  (rows2)), groupby=db.mb_boards.id)
      return dict(query=query)

  On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

   def index():
       rows = (db.mb_posts.board_id==db.mb_boards.id)
   (db.mb_posts.reply_to==0)
       rows2 = (db.mb_posts.board_id==db.mb_boards.id)
       mb_posts2 = db.mb_posts.with_alias(mb_posts2)
       query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
   db.mb_posts2.id.count(), 
   left=(db.mb_posts.on(rows),db.mb_posts2.on
   (rows2)), groupby=db.mb_boards.id)
       return dict(query=query)

   gives me
   OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19025] Re: T3 errors

2009-04-03 Thread dbb

Thank you Prof. I have been using mysql with web2py many times, just
slipped from my finger. Sory for taking your precious time for this
kind of issue.I have been saving my life line for big problem. I hope
this one will notaffect my life line.

Best Regards:

Debebe Asefa

On Apr 3, 8:56 am, dbb debe...@yahoo.com wrote:
 To Prof.  Massimo : I have errors related to the database used in T3,
 I used mysql, then I get errors. The trace is pasted below. --
 Massimo, my ambition is to have a T3 pages  which can connect to
 different databases in the same applications. My pressing question now
 is , does T3 connect to other databases?

 Ticket 127.0.0.1.2009-04-03.08-47-27.8058e2e3-c31a-43bd-af62-
 bf042f0f38b9

 Error traceback
 1.2.3.4.5.6.7. Traceback (most recent call last):  File C:\web2py
 \gluon\restricted.py, line 98, in restricted  File C:/web2py59/
 applications/plugin_t3/models/db.py, line 10, in module    db=SQLDB
 (mysql://root:localhost/db)         # if not, use SQLite or other
 DB  File C:\web2py\gluon\sql.py, line 609, in
 __init__AttributeError: 'NoneType' object has no attribute 'group'

 In file: C:\web2py59\applications\plugin_t3/models/db.py
 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.­29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.­54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.­79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.101.102.­103.104.105.106.107.108.109.110.111.112.113.114.115.116.117.118.119.120.121­.122.123.124.125.126.127.128.129.130.131.132.133.134.135.136.137.138.139.14­0.141.142.143.144.145.146.147.148.149.150.151.
  connect to
 databaseimport os, traceback,
 datetimetry:    from gluon.contrib.gql import *         # if running
 on Google App Engineexcept:    db=SQLDB(mysql://root:localhost/
 db)         # if not, use SQLite or other DBelse:    db=GQLDB
 ()                              # connect to Google BigTable
 session.connect(request,response,db=db) # and store sessions
 there###
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:19026] Re: DAL problem

2009-04-03 Thread mdipierro

There is a logic and these two

{{=board._extra['COUNT(mb_posts2.id)']}}
{{=board._extra[mb_posts2.id.count()]}}
should be equivalent, in fact {{=mb_posts2.id.count()}} should be
'COUNT(mb_posts2.id)'.

The rationale is that rows=db(...).select
(table.field,table.field.aggregate())

table field goes in rows[i].table.field
while aggregates are not fields so they go in rows[i]._extra
[table.field.aggregate()]

Massimo




On Apr 3, 11:37 am, TheDude officed...@gmail.com wrote:
 THat didn't work but..

 {{=board._extra.keys()}} brings up ['COUNT(mb_posts.id)', 'COUNT
 (mb_posts2.id)']

 So I did {{=board._extra['COUNT(mb_posts2.id)']}} and it works!

 Now, the only problem I have with this, is that it doesn't make to
 much logical sense to do things this way (it doesn't seem like a
 framework way more like a quick hack). Will there be any modifications
 within this area in 1.6?

 On Apr 3, 11:55 am, mdipierro mdipie...@cs.depaul.edu wrote:

  {{=board._extra[mb_posts2.id.count()]}} ?

  On Apr 3, 10:01 am, TheDude officed...@gmail.com wrote:

   RIght tried those already...
   .keys() brings up ['update_record', 'mb_posts', 'description', 'id',
   'name']
   board._extra = no xml error

   I tried listing keys() and dir() mb_posts (see if it was somehow
   placed in there but it isn't).

   However, {{=query}} brings this...
   mb_boards.idmb_boards.name  mb_boards.description   COUNT(mb_posts.id)
   COUNT(mb_posts2.id)
   1   Announcements   All important...1   1
   2   General Discu...General talk ...1   1
   3   Suggestions/B...Report any bu...0   0
   4   Off-Topic   Not everythin...0   0

   On Apr 3, 10:34 am, mdipierro mdipie...@cs.depaul.edu wrote:

try:
{{=board.mb_boards.keys()}}
{{=board._extra}}

On Apr 2, 5:20 pm, TheDude officed...@gmail.com wrote:

 SQL Works! However...

 {{=board.mb_boards.keys()}}
 brings up:
 ['update_record', 'mb_posts', 'description', 'id', 'name']

 As you can see, no mb_posts2 (mb_posts does not contain mb_posts2
 either). So, I said to myself may be it's because of the .ALL within
 the select. Still no go.

 On Apr 2, 2:56 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  ry

  def index():
  rows = (db.mb_posts.board_id==db.mb_boards.id)
  (db.mb_posts.reply_to==0)
  mb_posts2 = db.mb_posts.with_alias(mb_posts2)
  rows2 = (mb_posts2.board_id==db.mb_boards.id)
  query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
  mb_posts2.id.count(), left=(db.mb_posts.on(rows),mb_posts2.on
  (rows2)), groupby=db.mb_boards.id)
  return dict(query=query)

  On Apr 2, 8:08 am, mdipierro mdipie...@cs.depaul.edu wrote:

   should be

   def index():
   rows = (db.mb_posts.board_id==db.mb_boards.id)
   (db.mb_posts.reply_to==0)
   mb_posts2 = db.mb_posts.with_alias(mb_posts2)
   rows2 = (db.mb_posts2.board_id==db.mb_boards.id)
   query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(),
   db.mb_posts2.id.count(), 
   left=(db.mb_posts.on(rows),db.mb_posts2.on
   (rows2)), groupby=db.mb_boards.id)
   return dict(query=query)

   On Apr 1, 11:13 pm, TheDude officed...@gmail.com wrote:

def index():
rows = (db.mb_posts.board_id==db.mb_boards.id)
(db.mb_posts.reply_to==0)
rows2 = (db.mb_posts.board_id==db.mb_boards.id)
mb_posts2 = db.mb_posts.with_alias(mb_posts2)
query = db().select(db.mb_boards.ALL, 
db.mb_posts.id.count(),
db.mb_posts2.id.count(), 
left=(db.mb_posts.on(rows),db.mb_posts2.on
(rows2)), groupby=db.mb_boards.id)
return dict(query=query)

gives me
OperationalError: (1066, Not unique table/alias: 'mb_posts')

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



[web2py:19027] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread AchipA

Geodjango seemed pretty deeply rooted in django (in terms of the
models/ORM) so my impression was it would be more of a rewrite than a
port. The turbogears solution seemed more of an 'addon' which just
links other GIS components like openlayers/mapfish for a more
convenient use from within TG, but didn't look like a, how should I
put it, web gis framework. They had ambitious plans for google summer
of code regargding this. My Django and Turbogears expertise is limited
though, so take all this with a grain of salt and feel free to report
back if you find out something I said here does dot check out.

In any case, it would be cool to have a plugin (in a sense like t2)
which would be a GIS toolbox for apps utilizing Tilecache and/or
Mapfish (or openlayers directly).

On Apr 3, 1:06 pm, Timmie timmichel...@gmx-topmail.de wrote:
 Dear web2py users/developers,
 I am mostly using python for scientific data processing.
 I would like to take my scripts to an internet/intranet site for a
 larger audience to benefit. Therefore I am evaluating python web
 frameworks.
 So far, the web2py approach is apealing most to me. Clean and easy to
 lean and administer.

 But for a choice it is also important what existing extensions exist.

 Here my questions:
 * Is there someone working on a site with Geographical data or GIS
 capabilities (e. g.:http://geo.turbogears.org/samplemap)?
     = I found the following threads:
         - Validators: IS_LAT  IS_LON [1]
         - Using stored procedures [2]
     = I didn't see any appliance (http://mdp.cti.depaul.edu/
 appliances) of
 such nature.
 * How hard would it be port the existing extensions from Turbogears of
 Django over? [3], [4]
 * Is there anyone using web2py for web based number crunching stuff?

 A statement on the capabilities and activities of web2py regarding the
 above mentioned requirements would be welcome.

 Regards,
 Timmie

 [1]http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
 [2]http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
 [3]http://geo.turbogears.org/
 [4]http://geodjango.org/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:19028] Re: Writing a Book

2009-04-03 Thread Álvaro Justen [Turicas]

On Fri, Apr 3, 2009 at 11:26 AM, TheDude officed...@gmail.com wrote:
 Overall, I think I'll be writing a lot of versions of the book online
 and keep improving on it, and then eventually publishing it once I
 feel the book has matured enough.

 Thanks for all of your help guys. :)

Send news to us. :-)

-- 
 Álvaro Justen
 Peta5 - Telecomunicações e Software Livre
 21 3021-6001 / 9898-0141
 http://www.peta5.com.br/

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



[web2py:19029] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread dbb

We know we can get the longtitude and latitude of an address using
web2py, what we need here is to make these points map to x,y
coordinate and map the points on google map. Can Prof.Massimo directus
how to convert lo,la to x,y, and map the points ( x,y) on google map
in web2py world.

Best regards:

dbb

On Apr 3, 10:42 am, mdipierro mdipie...@cs.depaul.edu wrote:
 You want to look into this and talk to authors:

 http://trac.sahanapy.org/browser/models/_gis.pyhttp://trac.sahanapy.org/browser/controllers/gis.py

 Massimo

 On Apr 3, 6:06 am, Timmie timmichel...@gmx-topmail.de wrote:



  Dear web2py users/developers,
  I am mostly using python for scientific data processing.
  I would like to take my scripts to an internet/intranet site for a
  larger audience to benefit. Therefore I am evaluating python web
  frameworks.
  So far, the web2py approach is apealing most to me. Clean and easy to
  lean and administer.

  But for a choice it is also important what existing extensions exist.

  Here my questions:
  * Is there someone working on a site with Geographical data or GIS
  capabilities (e. g.:http://geo.turbogears.org/samplemap)?
      = I found the following threads:
          - Validators: IS_LAT  IS_LON [1]
          - Using stored procedures [2]
      = I didn't see any appliance (http://mdp.cti.depaul.edu/
  appliances) of
  such nature.
  * How hard would it be port the existing extensions from Turbogears of
  Django over? [3], [4]
  * Is there anyone using web2py for web based number crunching stuff?

  A statement on the capabilities and activities of web2py regarding the
  above mentioned requirements would be welcome.

  Regards,
  Timmie

  [1]http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
  [2]http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
  [3]http://geo.turbogears.org/
  [4]http://geodjango.org/- Hide quoted text -

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



[web2py:19032] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread Yarko Tymciurak
You can use google maps -
An example output:

https://us.pycon.org/2009/register/default/maps

The code to accomplish (collect coordinates):

def maps():   in
http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/controllers/default.py

and:

http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/views/default/maps.html

You can loose a few hours here:
http://code.google.com/apis/maps/documentation/

Have fun!

On Fri, Apr 3, 2009 at 1:35 PM, dbb debe...@yahoo.com wrote:


 We know we can get the longtitude and latitude of an address using
 web2py, what we need here is to make these points map to x,y
 coordinate and map the points on google map. Can Prof.Massimo directus
 how to convert lo,la to x,y, and map the points ( x,y) on google map
 in web2py world.

 Best regards:

 dbb

 On Apr 3, 10:42 am, mdipierro mdipie...@cs.depaul.edu wrote:
  You want to look into this and talk to authors:
 
 
 http://trac.sahanapy.org/browser/models/_gis.pyhttp://trac.sahanapy.org/browser/controllers/gis.py
 
  Massimo
 
  On Apr 3, 6:06 am, Timmie timmichel...@gmx-topmail.de wrote:
 
 
 
   Dear web2py users/developers,
   I am mostly using python for scientific data processing.
   I would like to take my scripts to an internet/intranet site for a
   larger audience to benefit. Therefore I am evaluating python web
   frameworks.
   So far, the web2py approach is apealing most to me. Clean and easy to
   lean and administer.
 
   But for a choice it is also important what existing extensions exist.
 
   Here my questions:
   * Is there someone working on a site with Geographical data or GIS
   capabilities (e. g.:http://geo.turbogears.org/samplemap)?
   = I found the following threads:
   - Validators: IS_LAT  IS_LON [1]
   - Using stored procedures [2]
   = I didn't see any appliance (http://mdp.cti.depaul.edu/
   appliances) of
   such nature.
   * How hard would it be port the existing extensions from Turbogears of
   Django over? [3], [4]
   * Is there anyone using web2py for web based number crunching stuff?
 
   A statement on the capabilities and activities of web2py regarding the
   above mentioned requirements would be welcome.
 
   Regards,
   Timmie
 
   [1]
 http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
   [2]
 http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
   [3]http://geo.turbogears.org/
   [4]http://geodjango.org/- Hide quoted text -
 
  - Show quoted text -
 


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



[web2py:19033] Input type button

2009-04-03 Thread r...@devshell.org

Hi there,

I was wondering about the button input type. I know it is recommended
to use a input submit type, however, if one were wanting to use a
button, how could I have web2py forward to another page with it?

ie. input type=button name=register/input --- I want that to
redirect to register/index.html in the VIEW.

Also, I found the epydoc request class to be missing the vars method
description, only get_vars is listed (which happens to be the same).
However, if I replace get_vars with just vars in the address bar, it
forwards me to the vars method description...its weird that it is not
listed as a method.

Lastly, is there a tutorial or anything about how to use CSS (classes
over ids) with the various HTML tags in web2py ie. FORMS, TABLE, TR,
TD, INPUT, etc.

Thanks!

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



[web2py:19034] Re: changed file name in file upload

2009-04-03 Thread bsnipes

On Feb 9, 3:00 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 For 3 reasons:
 1) avoid directory traversal attacks
 2) avoid conflicts (two files uploaded with same name)
 3) be able to identify which table and which record afilebelongs to
 from thefilename itself.

 Massimo

Is it possible to capture the original filename to the table and then
send it as back to the name back to the client when the client clicks
on a link to download the file?

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



[web2py:19035] MSSQL migrate error

2009-04-03 Thread DenesL

Changing a MSSQL table definition with migrate=True in the models
produces this error ('escalated' is the original field name in my
table):

ProgrammingError: ('42S22', [42S22] [Microsoft][ODBC SQL Server
Driver][SQL Server]Invalid column name 'escalated__tmp'. (207)
(SQLExecDirectW))

I traced down the error to sql.py, class SQLTable, function _migrate
where the following batch of statements is built:

ALTER TABLE calls ADD escalated__tmp DATETIME;
UPDATE calls SET escalated__tmp=escalated;
ALTER TABLE calls DROP COLUMN escalated;
ALTER TABLE calls ADD escalated DATETIME;
UPDATE calls SET escalated=escalated__tmp;
ALTER TABLE calls DROP COLUMN escalated__tmp;

The problem is that batches in MSSQL (2005) have these rules and the
batch above breaks rule number 2:

1) CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE,
CREATE TRIGGER, and CREATE VIEW statements cannot be combined with
other statements in a batch. The CREATE statement must start the
batch. All other statements that follow in that batch will be
interpreted as part of the definition of the first CREATE statement.

2) A table cannot be changed and then the new columns referenced in
the same batch.

3) If an EXECUTE statement is the first statement in a batch, the
EXECUTE keyword is not required. The EXECUTE keyword is required if
the EXECUTE statement is not the first statement in the batch.

The correct batch should be (note the GO on the second line, it has to
sit on a line by itself):

ALTER TABLE calls ADD escalated__tmp DATETIME;
GO
UPDATE calls SET escalated__tmp=escalated;
ALTER TABLE calls DROP COLUMN escalated;
ALTER TABLE calls ADD escalated DATETIME;
UPDATE calls SET escalated=escalated__tmp;
ALTER TABLE calls DROP COLUMN escalated__tmp;

The fix is apparently easy but I am not sure about the implications of
the other rules so I will leave it to Massimo.

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



[web2py:19036] Re: changed file name in file upload

2009-04-03 Thread bsnipes


 Is it possible to capture the original filename to the table and then
 send it as back to the name back to the client when the client clicks
 on a link to download the file?

Never mind... found some more info in another thread on it.

http://groups.google.com/group/web2py/browse_thread/thread/484a2d04bdd7606f/9015981068bfa6bc?lnk=gstq=file+upload+name#9015981068bfa6bc

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



[web2py:19037] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread mdipierro

http://bazaar.launchpad.net/%7Emdipierro/web2conf/devel/annotate/head%3A/views/default/maps.html

Please cod not call me Prof. makes me feel old. BTW. Are you one of my
students?

Massimo

On Apr 3, 1:35 pm, dbb debe...@yahoo.com wrote:
 We know we can get the longtitude and latitude of an address using
 web2py, what we need here is to make these points map to x,y
 coordinate and map the points on google map. Can Prof.Massimo directus
 how to convert lo,la to x,y, and map the points ( x,y) on google map
 in web2py world.

 Best regards:

 dbb

 On Apr 3, 10:42 am, mdipierro mdipie...@cs.depaul.edu wrote:

  You want to look into this and talk to authors:

 http://trac.sahanapy.org/browser/models/_gis.pyhttp://trac.sahanapy.o...

  Massimo

  On Apr 3, 6:06 am, Timmie timmichel...@gmx-topmail.de wrote:

   Dear web2py users/developers,
   I am mostly using python for scientific data processing.
   I would like to take my scripts to an internet/intranet site for a
   larger audience to benefit. Therefore I am evaluating python web
   frameworks.
   So far, the web2py approach is apealing most to me. Clean and easy to
   lean and administer.

   But for a choice it is also important what existing extensions exist.

   Here my questions:
   * Is there someone working on a site with Geographical data or GIS
   capabilities (e. g.:http://geo.turbogears.org/samplemap)?
   = I found the following threads:
   - Validators: IS_LAT  IS_LON [1]
   - Using stored procedures [2]
   = I didn't see any appliance (http://mdp.cti.depaul.edu/
   appliances) of
   such nature.
   * How hard would it be port the existing extensions from Turbogears of
   Django over? [3], [4]
   * Is there anyone using web2py for web based number crunching stuff?

   A statement on the capabilities and activities of web2py regarding the
   above mentioned requirements would be welcome.

   Regards,
   Timmie

   [1]http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
   [2]http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
   [3]http://geo.turbogears.org/
   [4]http://geodjango.org/-Hide quoted text -

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



[web2py:19039] Re: MSSQL migrate error

2009-04-03 Thread mdipierro

I do not see a problem with this but is GO a mssql only keyword?

On Apr 3, 3:29 pm, DenesL denes1...@yahoo.ca wrote:
 Changing a MSSQL table definition with migrate=True in the models
 produces this error ('escalated' is the original field name in my
 table):

 ProgrammingError: ('42S22', [42S22] [Microsoft][ODBC SQL Server
 Driver][SQL Server]Invalid column name 'escalated__tmp'. (207)
 (SQLExecDirectW))

 I traced down the error to sql.py, class SQLTable, function _migrate
 where the following batch of statements is built:

 ALTER TABLE calls ADD escalated__tmp DATETIME;
 UPDATE calls SET escalated__tmp=escalated;
 ALTER TABLE calls DROP COLUMN escalated;
 ALTER TABLE calls ADD escalated DATETIME;
 UPDATE calls SET escalated=escalated__tmp;
 ALTER TABLE calls DROP COLUMN escalated__tmp;

 The problem is that batches in MSSQL (2005) have these rules and the
 batch above breaks rule number 2:

 1) CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE,
 CREATE TRIGGER, and CREATE VIEW statements cannot be combined with
 other statements in a batch. The CREATE statement must start the
 batch. All other statements that follow in that batch will be
 interpreted as part of the definition of the first CREATE statement.

 2) A table cannot be changed and then the new columns referenced in
 the same batch.

 3) If an EXECUTE statement is the first statement in a batch, the
 EXECUTE keyword is not required. The EXECUTE keyword is required if
 the EXECUTE statement is not the first statement in the batch.

 The correct batch should be (note the GO on the second line, it has to
 sit on a line by itself):

 ALTER TABLE calls ADD escalated__tmp DATETIME;
 GO
 UPDATE calls SET escalated__tmp=escalated;
 ALTER TABLE calls DROP COLUMN escalated;
 ALTER TABLE calls ADD escalated DATETIME;
 UPDATE calls SET escalated=escalated__tmp;
 ALTER TABLE calls DROP COLUMN escalated__tmp;

 The fix is apparently easy but I am not sure about the implications of
 the other rules so I will leave it to Massimo.

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



[web2py:19040] important about ajax forms

2009-04-03 Thread mdipierro

There has been a lot of discussion in the past about forms that submit
via ajax and may or may not refresh the entire page. It is also useful
to be able to break html pages into modules or plugins or
components each with its own model, view, controller in such a way
that they communicate both serversize (by sharing session and
database) and clientsize (one boxed component should be able for
example to refresh the entire page or trigger a flash).

I have prototype application that does this.

http://www.web2py.com/examples/static/web2py.app.events.tar

It uses jquery publisher subscriber mechanism. All the code is in a
new web2py_ajax and a class call jDiv (similar to Rails Partial but
more powerful in my opinion) which I could include in html.py

It allows you to write code like this:

def index():
   return dict(partial1=jDiv('click me for text','mycallback1'),
   partial2=jDiv('click me for flash','mycallback2'),
   partial3=jDiv('click me to redirect','mycallback3'),
   partial4=jDiv('click me for form','mycallback4'))

def mycallback1():
   return 'hello world'

def mycallback2():
   return jDiv.flash('this is a test') # flash on the container page

def mycallback3():
   return jDiv.redirect('http://www.yahoo.com') # redirects entire
page

def mycallback4():
   form=FORM('your name:',
 INPUT(_name='name',requires=IS_NOT_EMPTY()),
 INPUT(_type='submit'))
   if form.accepts(request.vars):
   return jDiv.flash('hello '+form.vars.name)
   return form

Can you figure out what it does?
Not that the page is never reloaded. Only parts (partials, jDivs) of
the reloaded. Each jDiv lives in its own container, has one action,
can have a view, and can talk to each other.

This may require some more thought.

Comments?

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



[web2py:19041] Re: MSSQL migrate error

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 3:59 PM, mdipierro mdipie...@cs.depaul.edu wrote:


 I do not see a problem with this but is GO a mssql only keyword?


In MSSQL -  GO runs the accumulated batch of lines (it's like enter).

The problem is, I think, that you cannot depend on the order of statement
exectution when GO executes the SQL statements - so you must complete
table alterations before you use them, and the only way to be sure of it
is to break up the execution batches.



 On Apr 3, 3:29 pm, DenesL denes1...@yahoo.ca wrote:
  Changing a MSSQL table definition with migrate=True in the models
  produces this error ('escalated' is the original field name in my
  table):
 
  ProgrammingError: ('42S22', [42S22] [Microsoft][ODBC SQL Server
  Driver][SQL Server]Invalid column name 'escalated__tmp'. (207)
  (SQLExecDirectW))
 
  I traced down the error to sql.py, class SQLTable, function _migrate
  where the following batch of statements is built:
 
  ALTER TABLE calls ADD escalated__tmp DATETIME;
  UPDATE calls SET escalated__tmp=escalated;
  ALTER TABLE calls DROP COLUMN escalated;
  ALTER TABLE calls ADD escalated DATETIME;
  UPDATE calls SET escalated=escalated__tmp;
  ALTER TABLE calls DROP COLUMN escalated__tmp;
 
  The problem is that batches in MSSQL (2005) have these rules and the
  batch above breaks rule number 2:
 
  1) CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE,
  CREATE TRIGGER, and CREATE VIEW statements cannot be combined with
  other statements in a batch. The CREATE statement must start the
  batch. All other statements that follow in that batch will be
  interpreted as part of the definition of the first CREATE statement.
 
  2) A table cannot be changed and then the new columns referenced in
  the same batch.
 
  3) If an EXECUTE statement is the first statement in a batch, the
  EXECUTE keyword is not required. The EXECUTE keyword is required if
  the EXECUTE statement is not the first statement in the batch.
 
  The correct batch should be (note the GO on the second line, it has to
  sit on a line by itself):
 
  ALTER TABLE calls ADD escalated__tmp DATETIME;
  GO
  UPDATE calls SET escalated__tmp=escalated;
  ALTER TABLE calls DROP COLUMN escalated;
  ALTER TABLE calls ADD escalated DATETIME;
  UPDATE calls SET escalated=escalated__tmp;
  ALTER TABLE calls DROP COLUMN escalated__tmp;
 
  The fix is apparently easy but I am not sure about the implications of
  the other rules so I will leave it to Massimo.
 
  Denes.
 


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



[web2py:19042] Re: important about ajax forms

2009-04-03 Thread Yarko Tymciurak
I think this is not structured _enough_.
Looking at what has already been done in this area (see jsr portlets;  I do
not remember how dotnetnuke does the same with it's page components - but
that is definitely worth analyzing).

What we need is some general way that a

def index():  return something()

May be assigned to a portlet / window (say on a home page - with a read
more action), and
when read-more is selected, that same index() function may get it's own
entire page.

The point is this partials should not be knowledge within index(), rather
index should be encapsulated in something that handles this.

Keep thinking about this.


- Yarko

On Fri, Apr 3, 2009 at 4:08 PM, mdipierro mdipie...@cs.depaul.edu wrote:


 There has been a lot of discussion in the past about forms that submit
 via ajax and may or may not refresh the entire page. It is also useful
 to be able to break html pages into modules or plugins or
 components each with its own model, view, controller in such a way
 that they communicate both serversize (by sharing session and
 database) and clientsize (one boxed component should be able for
 example to refresh the entire page or trigger a flash).

 I have prototype application that does this.

http://www.web2py.com/examples/static/web2py.app.events.tar

 It uses jquery publisher subscriber mechanism. All the code is in a
 new web2py_ajax and a class call jDiv (similar to Rails Partial but
 more powerful in my opinion) which I could include in html.py

 It allows you to write code like this:

 def index():
   return dict(partial1=jDiv('click me for text','mycallback1'),
   partial2=jDiv('click me for flash','mycallback2'),
   partial3=jDiv('click me to redirect','mycallback3'),
   partial4=jDiv('click me for form','mycallback4'))

 def mycallback1():
   return 'hello world'

 def mycallback2():
   return jDiv.flash('this is a test') # flash on the container page

 def mycallback3():
   return jDiv.redirect('http://www.yahoo.com') # redirects entire
 page

 def mycallback4():
   form=FORM('your name:',
 INPUT(_name='name',requires=IS_NOT_EMPTY()),
 INPUT(_type='submit'))
   if form.accepts(request.vars):
   return jDiv.flash('hello '+form.vars.name)
   return form

 Can you figure out what it does?
 Not that the page is never reloaded. Only parts (partials, jDivs) of
 the reloaded. Each jDiv lives in its own container, has one action,
 can have a view, and can talk to each other.

 This may require some more thought.

 Comments?

 Massimo
 


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



[web2py:19043] Re: important about ajax forms

2009-04-03 Thread Yarko Tymciurak
another way to state this:  partials are language from one very (too) narrow
use case.
The general case is that page CONTAINERS manage output, and decay to one
container per page (or the partials sort of idea that were mentioned).

Now - controller logic is just engineering logic - implementation of
solution / output;

Containers, and the protocol to connect output (URI) to a container is view
logic...

This is important, because this is how outupt to one page (for example for
PyCon) can be collected from controller outupt from 2 frameworks (django or
web2py)

And this is where this concept shows the boundaries that are appropriate
(the other end of the boundary - even if you never want to combine output
from elsewhere, the point is still  that level of separation is desireable).

Come to think of it, another place to look is what do Yahoo Pipes do?   That
is 3 places to look, and gather ideas:  Yahoo Pipes, jsr Portlets,  .Net /
what dotnetnuke uses to implement application containers...

This last piece is where web2py can start:  think about how to have
portlets that can (for example) be connected to web2py application output.

I think this is more appropriate to think of as a general Python solution to
put in place

- Yarko

On Fri, Apr 3, 2009 at 4:28 PM, Yarko Tymciurak yark...@gmail.com wrote:

 I think this is not structured _enough_.
 Looking at what has already been done in this area (see jsr portlets;  I do
 not remember how dotnetnuke does the same with it's page components - but
 that is definitely worth analyzing).

 What we need is some general way that a

 def index():  return something()

 May be assigned to a portlet / window (say on a home page - with a read
 more action), and
 when read-more is selected, that same index() function may get it's own
 entire page.

 The point is this partials should not be knowledge within index(), rather
 index should be encapsulated in something that handles this.

 Keep thinking about this.


 - Yarko


 On Fri, Apr 3, 2009 at 4:08 PM, mdipierro mdipie...@cs.depaul.edu wrote:


 There has been a lot of discussion in the past about forms that submit
 via ajax and may or may not refresh the entire page. It is also useful
 to be able to break html pages into modules or plugins or
 components each with its own model, view, controller in such a way
 that they communicate both serversize (by sharing session and
 database) and clientsize (one boxed component should be able for
 example to refresh the entire page or trigger a flash).

 I have prototype application that does this.

http://www.web2py.com/examples/static/web2py.app.events.tar

 It uses jquery publisher subscriber mechanism. All the code is in a
 new web2py_ajax and a class call jDiv (similar to Rails Partial but
 more powerful in my opinion) which I could include in html.py

 It allows you to write code like this:

 def index():
   return dict(partial1=jDiv('click me for text','mycallback1'),
   partial2=jDiv('click me for flash','mycallback2'),
   partial3=jDiv('click me to redirect','mycallback3'),
   partial4=jDiv('click me for form','mycallback4'))

 def mycallback1():
   return 'hello world'

 def mycallback2():
   return jDiv.flash('this is a test') # flash on the container page

 def mycallback3():
   return jDiv.redirect('http://www.yahoo.com') # redirects entire
 page

 def mycallback4():
   form=FORM('your name:',
 INPUT(_name='name',requires=IS_NOT_EMPTY()),
 INPUT(_type='submit'))
   if form.accepts(request.vars):
   return jDiv.flash('hello '+form.vars.name)
   return form

 Can you figure out what it does?
 Not that the page is never reloaded. Only parts (partials, jDivs) of
 the reloaded. Each jDiv lives in its own container, has one action,
 can have a view, and can talk to each other.

 This may require some more thought.

 Comments?

 Massimo
 



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



[web2py:19044] Re: using web2py for Geo / GIS stuff

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 2:35 PM, Yarko Tymciurak yark...@gmail.com wrote:

 You can use google maps -
 An example output:

 https://us.pycon.org/2009/register/default/maps

 The code to accomplish (collect coordinates):

 def maps():   in
 http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/controllers/default.py

 and:


 http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/views/default/maps.html


You'll also find the piece that gets the lattitue and longitude from address
at the top this file, coordinates_by_address():

http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/models/db_utils.py

FYI - Massimo wrote / worked all this out (I just updated launchpad w/ the
latest of everyone's changes from launchpad, including my own).

Regards,
Yarko




 http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head:/applications/register/views/default/maps.html

 You can loose a few hours here:
 http://code.google.com/apis/maps/documentation/

 Have fun!


 On Fri, Apr 3, 2009 at 1:35 PM, dbb debe...@yahoo.com wrote:


 We know we can get the longtitude and latitude of an address using
 web2py, what we need here is to make these points map to x,y
 coordinate and map the points on google map. Can Prof.Massimo directus
 how to convert lo,la to x,y, and map the points ( x,y) on google map
 in web2py world.

 Best regards:

 dbb

 On Apr 3, 10:42 am, mdipierro mdipie...@cs.depaul.edu wrote:
  You want to look into this and talk to authors:
 
 
 http://trac.sahanapy.org/browser/models/_gis.pyhttp://trac.sahanapy.org/browser/controllers/gis.py
 
  Massimo
 
  On Apr 3, 6:06 am, Timmie timmichel...@gmx-topmail.de wrote:
 
 
 
   Dear web2py users/developers,
   I am mostly using python for scientific data processing.
   I would like to take my scripts to an internet/intranet site for a
   larger audience to benefit. Therefore I am evaluating python web
   frameworks.
   So far, the web2py approach is apealing most to me. Clean and easy to
   lean and administer.
 
   But for a choice it is also important what existing extensions exist.
 
   Here my questions:
   * Is there someone working on a site with Geographical data or GIS
   capabilities (e. g.:http://geo.turbogears.org/samplemap)?
   = I found the following threads:
   - Validators: IS_LAT  IS_LON [1]
   - Using stored procedures [2]
   = I didn't see any appliance (http://mdp.cti.depaul.edu/
   appliances) of
   such nature.
   * How hard would it be port the existing extensions from Turbogears of
   Django over? [3], [4]
   * Is there anyone using web2py for web based number crunching stuff?
 
   A statement on the capabilities and activities of web2py regarding the
   above mentioned requirements would be welcome.
 
   Regards,
   Timmie
 
   [1]
 http://groups.google.com/group/web2py/browse_thread/thread/9a11b8dfe3...
   [2]
 http://groups.google.com/group/web2py/browse_thread/thread/699409b6b4...
   [3]http://geo.turbogears.org/
   [4]http://geodjango.org/- Hide quoted text -
 
  - Show quoted text -
 



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



[web2py:19045] Re: Input type button

2009-04-03 Thread r...@devshell.org

I am trying to just understand where web2py stores the request data,
i.e. for various inputs and for buttons, how will I tell which button/
input is being activated by the user.

I am making a simple calculator, and I want some buttons to be
type=button, not type submit. However, once they are
type=button, what does web2py use to determine what it should do.

What I am looking for here is an example like:

default/index.html
input type=button name=sayhello/input

default/result/index.html
Hello World!

How do I get the button on the default/index.html page, to call the
default/result/index.html page, and call the helloworld() function in
the controller for that page?




On Apr 3, 1:58 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 normally what you do is:

 if form.accepts(request.vars): redirect(URL(r=request,f='index'))

 web2py uses postbacks. You do not have to but it makes your life much
 easier. Or are you trying to submit a web2py form to a non-web2py
 action?

 Massimo

 On Apr 3, 1:48 pm, r...@devshell.org roman.goldm...@gmail.com
 wrote:

  Hi there,

  I was wondering about the button input type. I know it is recommended
  to use a input submit type, however, if one were wanting to use a
  button, how could I have web2py forward to another page with it?

  ie. input type=button name=register/input --- I want that to
  redirect to register/index.html in the VIEW.

  Also, I found the epydoc request class to be missing the vars method
  description, only get_vars is listed (which happens to be the same).
  However, if I replace get_vars with just vars in the address bar, it
  forwards me to the vars method description...its weird that it is not
  listed as a method.

  Lastly, is there a tutorial or anything about how to use CSS (classes
  over ids) with the various HTML tags in web2py ie. FORMS, TABLE, TR,
  TD, INPUT, etc.

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



[web2py:19046] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-03 Thread seth

Hi Massimo,

Thanks for the quick response. I've since tried the same on another
machine (this time ubuntu linux) and am having the same trouble, this
time there is no dbhash error.

In case anyone wants to verify my troubles, here are the relevant
parts...

[web2py crontab] /applications/cronworks/cron/crontab
 */1*   *   *   *   root *default/crontest

[External crontab] crontab -e
0-59/1 * * * * cd /home/seth/web2py  python web2py.py -M -R
applications/cronworks/controllers/default.py -C -D 1  /tmp/
cronworks.output 21
I've tried with and without the -M and -R

[Model] db.py

  db.define_table('cron',
db.Field('word', 'string'))

[Controller] default.py - crontest()

  def crontest():
  print INSIDE CRONTEST
  db.cron.insert(word='thisisatest')


As with before, I can verify that the method is being run every
minute, and that the insert works when the method is called via the
url.

[cronworks.output]
  INFO:root:Hard cron daemon started
  DEBUG:root:External cron invocation
  DEBUG:root:WEB2PY CRON: Trying to acquire lock
  DEBUG:root:WEB2PY CRON: Locked
  INFO:root:WEB2PY CRON (ext): Application: cronworks executing
*default/crontest in /home/seth/web2py at 2009-04-04 00:35:02.115734
  DEBUG:root:WEB2PY CRON: Releasing cron lock
  DEBUG:root:WEB2PY CRON done
  INFO:root:WEB2PY CRON Call returned: default applications appear to
be installed already
  web2py Enterprise Web Framework
  Created by Massimo Di Pierro, Copyright 2007-2009
  Version 1.59 (2009-03-16 13:10:16)
  Database drivers available: SQLite3
  INSIDE CRONTEST
  None

Thank you kindly for your time, and keep up the great work with
web2py!

Cheers.
-Seth

On Apr 2, 5:06 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I do not know if this is related but sqlite that ships on python for
 macosx has known bugs. This would not be the only one. You should use
 the binary distribution on OSX which does not seem to have these
 problems.

 On Apr 2, 6:29 pm, seth seth.le...@gmail.com wrote:

  I'm having trouble doing a db.table.insert from an external cron on
  macosx.

  The system cron file

  0-59/1 * * * * cd /Users/username/Desktop/appname/web2py  python
  web2py.py -R applications/appname/controllers/test.py -C -D 1  /tmp/
  cron.output 21

  The crontab file in appname/cron directory

  */10    *       *       *       *       root *test/callcron

  I can see the callcron method is successfully being called every ten
  minutes from the cron.output file.

  But, in cron.output I get the following error
  WARNING:root:unable to import dbhash

  and none of the db.table.inserts put anything in the database.
  Although, when I hit the controller/action via the URL everything
  works fine and I get entries in the database.

  I've also tried the -S appname and -M switches, with no changes.

  I've followed the following posts

 http://groups.google.com/group/web2py/browse_thread/thread/cfe89bfa9d...

  and

 http://groups.google.com/group/web2py/browse_thread/thread/9acf0aae73...

  with the same results.

  I'm new to web2py so I may be missing something obvious :)

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



[web2py:19047] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-03 Thread mdipierro

can you try add

db.commit()

This is not necessary for normal controllers but perhaps it is
necessary for Cron.
@Achipa, could you clarify this aspect of cron?

Massimo

On Apr 3, 7:45 pm, seth seth.le...@gmail.com wrote:
 Hi Massimo,

 Thanks for the quick response. I've since tried the same on another
 machine (this time ubuntu linux) and am having the same trouble, this
 time there is no dbhash error.

 In case anyone wants to verify my troubles, here are the relevant
 parts...

 [web2py crontab] /applications/cronworks/cron/crontab
      */1        *       *       *       *       root *default/crontest

 [External crontab] crontab -e
     0-59/1 * * * * cd /home/seth/web2py  python web2py.py -M -R
 applications/cronworks/controllers/default.py -C -D 1  /tmp/
 cronworks.output 21
     I've tried with and without the -M and -R

 [Model] db.py

   db.define_table('cron',
     db.Field('word', 'string'))

 [Controller] default.py - crontest()

   def crontest():
       print INSIDE CRONTEST
       db.cron.insert(word='thisisatest')

 As with before, I can verify that the method is being run every
 minute, and that the insert works when the method is called via the
 url.

 [cronworks.output]
   INFO:root:Hard cron daemon started
   DEBUG:root:External cron invocation
   DEBUG:root:WEB2PY CRON: Trying to acquire lock
   DEBUG:root:WEB2PY CRON: Locked
   INFO:root:WEB2PY CRON (ext): Application: cronworks executing
 *default/crontest in /home/seth/web2py at 2009-04-04 00:35:02.115734
   DEBUG:root:WEB2PY CRON: Releasing cron lock
   DEBUG:root:WEB2PY CRON done
   INFO:root:WEB2PY CRON Call returned: default applications appear to
 be installed already
   web2py Enterprise Web Framework
   Created by Massimo Di Pierro, Copyright 2007-2009
   Version 1.59 (2009-03-16 13:10:16)
   Database drivers available: SQLite3
   INSIDE CRONTEST
   None

 Thank you kindly for your time, and keep up the great work with
 web2py!

 Cheers.
 -Seth

 On Apr 2, 5:06 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  I do not know if this is related but sqlite that ships on python for
  macosx has known bugs. This would not be the only one. You should use
  the binary distribution on OSX which does not seem to have these
  problems.

  On Apr 2, 6:29 pm, seth seth.le...@gmail.com wrote:

   I'm having trouble doing a db.table.insert from an external cron on
   macosx.

   The system cron file

   0-59/1 * * * * cd /Users/username/Desktop/appname/web2py  python
   web2py.py -R applications/appname/controllers/test.py -C -D 1  /tmp/
   cron.output 21

   The crontab file in appname/cron directory

   */10    *       *       *       *       root *test/callcron

   I can see the callcron method is successfully being called every ten
   minutes from the cron.output file.

   But, in cron.output I get the following error
   WARNING:root:unable to import dbhash

   and none of the db.table.inserts put anything in the database.
   Although, when I hit the controller/action via the URL everything
   works fine and I get entries in the database.

   I've also tried the -S appname and -M switches, with no changes.

   I've followed the following posts

  http://groups.google.com/group/web2py/browse_thread/thread/cfe89bfa9d...

   and

  http://groups.google.com/group/web2py/browse_thread/thread/9acf0aae73...

   with the same results.

   I'm new to web2py so I may be missing something obvious :)

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



[web2py:19048] Re: Input type button

2009-04-03 Thread mdipierro

I am not sure I fully understand the question since this is not a
web2py specific questions.

If a page has a button:

button onclick={{=URL(r=request,f='sayhi')}}click me/button

when you click it will call the action sayhi(), For example

def sayhi(): return dict(message=hello)

Normally you use input inside a form.../form. The form is
submitted to the action specified in form action=.
web2py uses postbacks, i.e. It alwys submits the form to the same
action that generated the form.

Not sure I answered your question.

Massimo

On Apr 3, 6:38 pm, r...@devshell.org roman.goldm...@gmail.com
wrote:
 I am trying to just understand where web2py stores the request data,
 i.e. for various inputs and for buttons, how will I tell which button/
 input is being activated by the user.

 I am making a simple calculator, and I want some buttons to be
 type=button, not type submit. However, once they are
 type=button, what does web2py use to determine what it should do.

 What I am looking for here is an example like:

 default/index.html
 input type=button name=sayhello/input

 default/result/index.html
 Hello World!

 How do I get the button on the default/index.html page, to call the
 default/result/index.html page, and call the helloworld() function in
 the controller for that page?

 On Apr 3, 1:58 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  normally what you do is:

  if form.accepts(request.vars): redirect(URL(r=request,f='index'))

  web2py uses postbacks. You do not have to but it makes your life much
  easier. Or are you trying to submit a web2py form to a non-web2py
  action?

  Massimo

  On Apr 3, 1:48 pm, r...@devshell.org roman.goldm...@gmail.com
  wrote:

   Hi there,

   I was wondering about the button input type. I know it is recommended
   to use a input submit type, however, if one were wanting to use a
   button, how could I have web2py forward to another page with it?

   ie. input type=button name=register/input --- I want that to
   redirect to register/index.html in the VIEW.

   Also, I found the epydoc request class to be missing the vars method
   description, only get_vars is listed (which happens to be the same).
   However, if I replace get_vars with just vars in the address bar, it
   forwards me to the vars method description...its weird that it is not
   listed as a method.

   Lastly, is there a tutorial or anything about how to use CSS (classes
   over ids) with the various HTML tags in web2py ie. FORMS, TABLE, TR,
   TD, INPUT, etc.

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



[web2py:19049] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-03 Thread seth

That was it!

Best Regards,
-Seth

On Apr 3, 5:52 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 can you try add

 db.commit()

 This is not necessary for normal controllers but perhaps it is
 necessary for Cron.
 @Achipa, could you clarify this aspect of cron?

 Massimo

 On Apr 3, 7:45 pm, seth seth.le...@gmail.com wrote:

  Hi Massimo,

  Thanks for the quick response. I've since tried the same on another
  machine (this time ubuntu linux) and am having the same trouble, this
  time there is no dbhash error.

  In case anyone wants to verify my troubles, here are the relevant
  parts...

  [web2py crontab] /applications/cronworks/cron/crontab
       */1        *       *       *       *       root *default/crontest

  [External crontab] crontab -e
      0-59/1 * * * * cd /home/seth/web2py  python web2py.py -M -R
  applications/cronworks/controllers/default.py -C -D 1  /tmp/
  cronworks.output 21
      I've tried with and without the -M and -R

  [Model] db.py

    db.define_table('cron',
      db.Field('word', 'string'))

  [Controller] default.py - crontest()

    def crontest():
        print INSIDE CRONTEST
        db.cron.insert(word='thisisatest')

  As with before, I can verify that the method is being run every
  minute, and that the insert works when the method is called via the
  url.

  [cronworks.output]
    INFO:root:Hard cron daemon started
    DEBUG:root:External cron invocation
    DEBUG:root:WEB2PY CRON: Trying to acquire lock
    DEBUG:root:WEB2PY CRON: Locked
    INFO:root:WEB2PY CRON (ext): Application: cronworks executing
  *default/crontest in /home/seth/web2py at 2009-04-04 00:35:02.115734
    DEBUG:root:WEB2PY CRON: Releasing cron lock
    DEBUG:root:WEB2PY CRON done
    INFO:root:WEB2PY CRON Call returned: default applications appear to
  be installed already
    web2py Enterprise Web Framework
    Created by Massimo Di Pierro, Copyright 2007-2009
    Version 1.59 (2009-03-16 13:10:16)
    Database drivers available: SQLite3
    INSIDE CRONTEST
    None

  Thank you kindly for your time, and keep up the great work with
  web2py!

  Cheers.
  -Seth

  On Apr 2, 5:06 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   I do not know if this is related but sqlite that ships on python for
   macosx has known bugs. This would not be the only one. You should use
   the binary distribution on OSX which does not seem to have these
   problems.

   On Apr 2, 6:29 pm, seth seth.le...@gmail.com wrote:

I'm having trouble doing a db.table.insert from an external cron on
macosx.

The system cron file

0-59/1 * * * * cd /Users/username/Desktop/appname/web2py  python
web2py.py -R applications/appname/controllers/test.py -C -D 1  /tmp/
cron.output 21

The crontab file in appname/cron directory

*/10    *       *       *       *       root *test/callcron

I can see the callcron method is successfully being called every ten
minutes from the cron.output file.

But, in cron.output I get the following error
WARNING:root:unable to import dbhash

and none of the db.table.inserts put anything in the database.
Although, when I hit the controller/action via the URL everything
works fine and I get entries in the database.

I've also tried the -S appname and -M switches, with no changes.

I've followed the following posts

   http://groups.google.com/group/web2py/browse_thread/thread/cfe89bfa9d...

and

   http://groups.google.com/group/web2py/browse_thread/thread/9acf0aae73...

with the same results.

I'm new to web2py so I may be missing something obvious :)

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



[web2py:19050] web2py desktop / web app

2009-04-03 Thread ice9

I have been reading and hearing a lot about taking web frameworks like
pylons to create a web app  that works on the desktop  and web.. The
one using pylons was using dabo which uses wxPython for  the gui lib.
I just think it would be very cool to do such a thing, alternatives
are Titanium by appcelerator, Pyjamas-desktop which is very rough.
Web2py is mature and works great out of the box.

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



[web2py:19051] Re: important about ajax forms

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 4:35 PM, Yarko Tymciurak yark...@gmail.com wrote:

 another way to state this:  partials are language from one very (too)
 narrow use case.
 The general case is that page CONTAINERS manage output, and decay to one
 container per page (or the partials sort of idea that were mentioned).

 Now - controller logic is just engineering logic - implementation of
 solution / output;

 Containers, and the protocol to connect output (URI) to a container is view
 logic...

 This is important, because this is how outupt to one page (for example for
 PyCon) can be collected from controller outupt from 2 frameworks (django or
 web2py)

 And this is where this concept shows the boundaries that are appropriate
 (the other end of the boundary - even if you never want to combine output
 from elsewhere, the point is still  that level of separation is desireable).

 Come to think of it, another place to look is what do Yahoo Pipes do?
 That is 3 places to look, and gather ideas:  Yahoo Pipes, jsr Portlets,
  .Net / what dotnetnuke uses to implement application containers...

 This last piece is where web2py can start:  think about how to have
 portlets that can (for example) be connected to web2py application output.


Note what this last concept does / says:  If I can have a screen container
as a destination, then I can supply tools which are applications (however
small) which a user / site can just install and connect - for example, to
have a calendar on the page.   What that calendar ties to (now) could be
done thru the calendar's admin interface --- instead of programming. Placing
the calendar, and connecting it to a receptor/container too can be an admin
functionality. This is an important shift.

Let's think about this carefully, study what's out there and come up with a
starting, simple (but appropriately functional) proposal.

-y

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



[web2py:19052] Re: important about ajax forms

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 8:58 PM, Yarko Tymciurak yark...@gmail.com wrote:

 On Fri, Apr 3, 2009 at 4:35 PM, Yarko Tymciurak yark...@gmail.com wrote:

 another way to state this:  partials are language from one very (too)
 narrow use case.
 The general case is that page CONTAINERS manage output, and decay to one
 container per page (or the partials sort of idea that were mentioned).

 Now - controller logic is just engineering logic - implementation of
 solution / output;

 Containers, and the protocol to connect output (URI) to a container is
 view logic...

 This is important, because this is how outupt to one page (for example for
 PyCon) can be collected from controller outupt from 2 frameworks (django or
 web2py)

 And this is where this concept shows the boundaries that are appropriate
 (the other end of the boundary - even if you never want to combine output
 from elsewhere, the point is still  that level of separation is desireable).

 Come to think of it, another place to look is what do Yahoo Pipes do?
 That is 3 places to look, and gather ideas:  Yahoo Pipes, jsr Portlets,
  .Net / what dotnetnuke uses to implement application containers...

 This last piece is where web2py can start:  think about how to have
 portlets that can (for example) be connected to web2py application output.


 Note what this last concept does / says:  If I can have a screen container
 as a destination, then I can supply tools which are applications (however
 small) which a user / site can just install and connect - for example, to
 have a calendar on the page.   What that calendar ties to (now) could be
 done thru the calendar's admin interface --- instead of programming. Placing
 the calendar, and connecting it to a receptor/container too can be an admin
 functionality. This is an important shift.


And not new - dotnetnuke  already does this (has for years).  It would just
be new (?) to Python.  I know there are some aspects of this in Plone, but
those I believe are rather less flexible than what I'm thinking of - I'm
still thinking of one page, multi frameworks putputting to (still thinking
about future of pycon site).



 Let's think about this carefully, study what's out there and come up with a
 starting, simple (but appropriately functional) proposal.

 -y


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



[web2py:19053] Re: important about ajax forms

2009-04-03 Thread Yarko Tymciurak
On Fri, Apr 3, 2009 at 9:03 PM, Yarko Tymciurak yark...@gmail.com wrote:


 On Fri, Apr 3, 2009 at 8:58 PM, Yarko Tymciurak yark...@gmail.com wrote:

 On Fri, Apr 3, 2009 at 4:35 PM, Yarko Tymciurak yark...@gmail.comwrote:

 another way to state this:  partials are language from one very (too)
 narrow use case.
 The general case is that page CONTAINERS manage output, and decay to one
 container per page (or the partials sort of idea that were mentioned).

 Now - controller logic is just engineering logic - implementation of
 solution / output;

 Containers, and the protocol to connect output (URI) to a container is
 view logic...

 This is important, because this is how outupt to one page (for example
 for PyCon) can be collected from controller outupt from 2 frameworks (django
 or web2py)

 And this is where this concept shows the boundaries that are appropriate
 (the other end of the boundary - even if you never want to combine output
 from elsewhere, the point is still  that level of separation is desireable).

 Come to think of it, another place to look is what do Yahoo Pipes do?
 That is 3 places to look, and gather ideas:  Yahoo Pipes, jsr Portlets,
  .Net / what dotnetnuke uses to implement application containers...

 This last piece is where web2py can start:  think about how to have
 portlets that can (for example) be connected to web2py application output.




  Note what this last concept does / says:  If I can have a screen
 container as a destination, then I can supply tools which are applications
 (however small) which a user / site can just install and connect - for
 example, to have a calendar on the page.   What that calendar ties to (now)
 could be done thru the calendar's admin interface --- instead of
 programming. Placing the calendar, and connecting it to a receptor/container
 too can be an admin functionality. This is an important shift.


 And not new - dotnetnuke  already does this (has for years).  It would just
 be new (?) to Python.  I know there are some aspects of this in Plone, but
 those I believe are rather less flexible than what I'm thinking of - I'm
 still thinking of one page, multi frameworks putputting to (still thinking
 about future of pycon site).


Also see my.msn.com for concept of site / page elements that you can move
around, and their content follows. and menu items that user (or concievably
admin) can use to configure thru the container.





 Let's think about this carefully, study what's out there and come up with
 a starting, simple (but appropriately functional) proposal.

 -y




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



[web2py:19054] Re: web2py desktop / web app

2009-04-03 Thread mdipierro

I believe ceej has been working with web2py + titanium. Perhaps he can
give us some advice.

On Apr 3, 8:15 pm, ice9 meier.aa...@gmail.com wrote:
 I have been reading and hearing a lot about taking web frameworks like
 pylons to create a web app  that works on the desktop  and web.. The
 one using pylons was using dabo which uses wxPython for  the gui lib.
 I just think it would be very cool to do such a thing, alternatives
 are Titanium by appcelerator, Pyjamas-desktop which is very rough.
 Web2py is mature and works great out of the box.

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



[web2py:19055] Re: important about ajax forms

2009-04-03 Thread mdipierro

Yarko most systems just use iframes. You can put anything you want
into an iframe.

The problem I am trying to solve is turning existing forms into ajax
forms and do it in such a way that when the form has errors, it just
modified itself without reloading the page. If the form submission
succeeds the ajax response triggers an event outside the box. I do
not want to use iframes because 1) I want to communicate with the
outside; 2) I want to inherit the CSS of the box container.

I think this is a critical ingredient although not sufficient to
implement what you are suggesting.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:19057] Re: important about ajax forms

2009-04-03 Thread ceej

I'm really liking this idea Massimo, I'm going to be using it in a
project I'm about to start and grow on it :)

Keeps using ajax very DRY.

On Apr 3, 4:08 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 There has been a lot of discussion in the past about forms that submit
 via ajax and may or may not refresh the entire page. It is also useful
 to be able to break html pages into modules or plugins or
 components each with its own model, view, controller in such a way
 that they communicate both serversize (by sharing session and
 database) and clientsize (one boxed component should be able for
 example to refresh the entire page or trigger a flash).

 I have prototype application that does this.

    http://www.web2py.com/examples/static/web2py.app.events.tar

 It uses jquery publisher subscriber mechanism. All the code is in a
 new web2py_ajax and a class call jDiv (similar to Rails Partial but
 more powerful in my opinion) which I could include in html.py

 It allows you to write code like this:

 def index():
    return dict(partial1=jDiv('click me for text','mycallback1'),
                partial2=jDiv('click me for flash','mycallback2'),
                partial3=jDiv('click me to redirect','mycallback3'),
                partial4=jDiv('click me for form','mycallback4'))

 def mycallback1():
    return 'hello world'

 def mycallback2():
    return jDiv.flash('this is a test') # flash on the container page

 def mycallback3():
    return jDiv.redirect('http://www.yahoo.com') # redirects entire
 page

 def mycallback4():
    form=FORM('your name:',
              INPUT(_name='name',requires=IS_NOT_EMPTY()),
              INPUT(_type='submit'))
    if form.accepts(request.vars):
        return jDiv.flash('hello '+form.vars.name)
    return form

 Can you figure out what it does?
 Not that the page is never reloaded. Only parts (partials, jDivs) of
 the reloaded. Each jDiv lives in its own container, has one action,
 can have a view, and can talk to each other.

 This may require some more thought.

 Comments?

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