[web2py:29116] Re: web2py 1.66.1 (win) zipimport.ZipImportError

2009-08-22 Thread Jason Brower

It's ok, your still awesome. :þ
Besides, hiking is something I think a lot of use should be doing on a
weekend like this. (But I am programming.)
Regards,
Jason


On Fri, 2009-08-21 at 20:28 -0700, Iceberg wrote:
 On Aug22, 1:11am, mdipierro mdipie...@cs.depaul.edu wrote:
 
  Note to self... never release new version before going hiking.
 
  Massimo
 
 Or you can release it in a name 1.x.x hiking version, hiking here
 means beta. :-P
 
 PS: This post is of course a joking version. :-)
 
 Regards,
 Iceberg
  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29119] Re: Displaying variable in drop-down menu

2009-08-22 Thread Varun Kumar
db1 {
   field1
}
db2 {
   field2
}
db3 {
   field3
}

db1.field1.requires = IS_IN_DB ( db2.field2 or db3.field3 )

what is the syntax for above IS_IN_DB statement ( is it possible to add drop
down menu also for this command ) ?




On Sat, Aug 22, 2009 at 8:20 AM, Iceberg iceb...@21cn.com wrote:


 On Aug21, 7:58pm, newbie_web2py varunk.ap...@gmail.com wrote:
  db.table_name.field1.requires= IS_IN_DB(db,'table_name.field2_name','%
  (name)s')
 
  Can we extend the above syntax so that we can select field1 from
  field2 or field3 ( with or without the drop-down menu ) ??

 Don't know whether you mean this:

 db.table_name.field1.requires= IS_IN_DB(
   db,'table_name.field2_name','%(field2)s, %(field3)s')
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29118] Re: Routes in GAE

2009-08-22 Thread Prabhu

Thanks Victor and Yarko.

It works if I specify routes_in = (('.*:/cc/$a','/ccweb/default/$a'))
or
routes_out = (('/ccweb/default/$a', '/cc/$a'))


If I say

routes_in = (('.*:/cc/$a','/ccweb/default/$a'))
routes_out = (('/ccweb/default/$a', '/cc/$a'))

in routes.py, I still get the syntax error. Why am I not able to
specify both? This looks like a very dumb mistake I am making. Any
ideas?

Prabhu


On Aug 22, 9:02 am, Yarko Tymciurak yark...@gmail.com wrote:
 you might find this discussiont helpful:

 http://groups.google.com/group/web2py/msg/abb56704cda162a0

 On Fri, Aug 21, 2009 at 5:17 PM, Victor victor.akuj...@gmail.com wrote:

  your line should be routes_in = (('.*:/testme','/myapp/default/
  index'))  dont forget to add an $ at the end if all you want is /
  testme

  On Aug 21, 10:41 pm, Prabhu prabhu.sen...@gmail.com wrote:
   Hi,

   Newbie to web2py here. My routes.py reads,

   #!/usr/bin/env python
   # -*- coding: utf-8 -*-

   routes_in = (('/testme','/myapp/default/index'),)

   routes_out = (('/myapp/default/index', '/test'),)

  http://127.0.0.1:8000/testmeworks. When I upload web2py to GAE, I get
   the following error

   Your routes.py has a syntax error. Please fix it before you restart
   web2py
   type 'exceptions.SyntaxError': invalid syntax (string, line 3)
   Traceback (most recent call last):
     File /base/data/home/apps/myapp/1.335783148456469963/
   gaehandler.py, line 26, in module
       import gluon.main
     File /base/data/home/apps/myapp/1.335783148456469963/gluon/
   main.py, line 39, in module
       from globals import Request, Response, Session
     File /base/data/home/apps/myapp/1.335783148456469963/gluon/
   globals.py, line 18, in module
       from compileapp import run_view_in
     File /base/data/home/apps/myapp/1.335783148456469963/gluon/
   compileapp.py, line 43, in module
       from rewrite import error_message_custom
     File /base/data/home/apps/myapp/1.335783148456469963/gluon/
   rewrite.py, line 31, in module
       raise e
   type 'exceptions.SyntaxError': invalid syntax (string, line 3)

   This happens when there is a routes.py file (even if all the lines are
   commented).

   Is this the correct way to do URL Rewrite? The Reddish application
   (web2py.appspot.com) does this correctly. How? The source code (of
   Reddish) has the application only.

   Can someone please clarify this?

   Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29120] Re: Displaying variable in drop-down menu

2009-08-22 Thread Iceberg

On Aug22, 2:55pm, Varun Kumar varunk.ap...@gmail.com wrote:
 db1 {
    field1}

 db2 {
    field2}

 db3 {
    field3

 }

 db1.field1.requires = IS_IN_DB ( db2.field2 or db3.field3 )

 what is the syntax for above IS_IN_DB statement ( is it possible to add drop
 down menu also for this command ) ?


If your emphasis is about the OR relationship, how about build a
base db (table) first and let all other reference field links to the
base?

db0{
  field0
}

db1{
  field1, requires=IS_IN_DB(db0,db0.field0)
}

db2{
  field2, requires=IS_IN_DB(db0,db0.field0)
}

db3{
  field3, requires=IS_IN_DB(db0,db0.field0)
}

anyway, you get the idea.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29122] Re: Help query

2009-08-22 Thread tititi

Hi, I'm testing a similiar join query but not getting success in
extracting the dictionary

r = db.reviews
u = db.users
query = ((db.reviews.id==request.args[0])  (db.users.id==1))
left= (r.on(u.id==r.user_id))
reviews=db(query).select
(r.headline,r.article,u.username,left=left, orderby=r.date_added)
return(reviews=reviews)

On the view.html

{{for review in reviews:}}
b{{=review.headline}}/b: {{=review.username}}
{{pass}}

I'm getting this error: KeyError: 'headline'

Am I missing something?


On Aug 12, 3:46 am, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:
 Thank you Massimo

 --- On Tue, 8/11/09, mdipierro mdipie...@cs.depaul.edu wrote:



  From: mdipierro mdipie...@cs.depaul.edu
  Subject: [web2py:28376] Re: Helpquery
  To: web2py-users web2py@googlegroups.com
  Date: Tuesday, August 11, 2009, 8:04 PM

  Here is is broken down into pieces:

  a=db.llamados
  b=db.accountcode.with_alias('b')
  c=db.clientes.with_alias('c')
 query=
  (b.id_clientes==clte)(a.dialstatus=='ANSWER')
  (a.inicio=desde)(a.inicio=hasta)
  left =
  (b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
  rows = db(query).select
  (a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inici 
  o)

  On Aug 11, 4:54 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
  wrote:
   Dear all.

   How i can doing the followingqueryfor web2py:

    select
          
  a.destino,a.answeredtime,a.inicio,a.fin,a.valor from
  llamados as a
    join
           accountcode as b on a.id_accountcode=b.id
    join
           clientes as c on b.id_clientes=c.id

    where id_clientes = clte and a.dialstatus='ANSWER'
  and (a.inicio =

   desde    and a.inicio = hasta) order by a.inicio
  DESC

   I want not use executesql.

   Fernando
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29123] Re: Problem with mysql setup in web2py with dreamhost hosting.

2009-08-22 Thread mr.freeze

I think you may need to put the database name after the port:
mysql://username:passw...@server:3306/database

On Aug 21, 11:33 pm, Jason Brower encomp...@gmail.com wrote:
 Can't seem to get this to work.  Keep's telling me I have an invlaid URI
 or something similar.
 I think it would tell me if the port or something was wrong.  Could it
 be that? (Dreamhost server never specified, and I have tried with and
 without.)  Obviously password is not may password.  But it is something
 simple. (No funny charactors.)
 db = SQLDB('mysql://trimax_db:passw...@mysql.trimaxsafety.com.tw:3306')
 Best Regards,
 Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29125] Re: moving database to new server results in 'auth_user' already exists

2009-08-22 Thread mr.freeze

I experienced the same error simply changing the MySQL user's
password.  I was able to get around it by setting migrate=False on
every define_table call on my model.

On Aug 20, 10:10 am, Fred fre...@gmail.com wrote:
 I ended up doing this:

 Create empty database on new server.
 Change db.py to connect to that new database.
 Visit an application page in the browser; web2py creates the
 application tables in the database, empty.
 Dump the data from the oldMySQLserver with --no-create-info option
 (notablecreation DDL).
 Load that dumped data into the newMySQLserver.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29128] Re: Problem with mysql setup in web2py with dreamhost hosting.

2009-08-22 Thread Yarko Tymciurak
On Sat, Aug 22, 2009 at 10:23 AM, mr.freeze nat...@freezable.com wrote:


 I think you may need to put the database name after the port:
 mysql://username:passw...@server:3306/database


yes - and you need to be sure you've created the empty database in advance.




 On Aug 21, 11:33 pm, Jason Brower encomp...@gmail.com wrote:
  Can't seem to get this to work.  Keep's telling me I have an invlaid URI
  or something similar.
  I think it would tell me if the port or something was wrong.  Could it
  be that? (Dreamhost server never specified, and I have tried with and
  without.)  Obviously password is not may password.  But it is something
  simple. (No funny charactors.)
  db = SQLDB('mysql://trimax_db:passw...@mysql.trimaxsafety.com.tw:3306')
  Best Regards,
  Jason
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29127] Re: Help query

2009-08-22 Thread Yarko Tymciurak
you are doing a join accross tables; to see what the results of that
select() looks like, try it from a shell, e.g. type in your select from:

python web2py.py -S myapp -M

Then take a look at reviews[0];

If you have ipython installed, you might like looking at it that way, as
tab-completion will give you some hints.

Let us know if this helps.

- Yarko

On Sat, Aug 22, 2009 at 5:09 AM, tititi briant...@gmail.com wrote:


 Hi, I'm testing a similiar join query but not getting success in
 extracting the dictionary

r = db.reviews
u = db.users
query = ((db.reviews.id==request.args[0])  (db.users.id==1))
left= (r.on(u.id==r.user_id))
reviews=db(query).select
 (r.headline,r.article,u.username,left=left, orderby=r.date_added)
return(reviews=reviews)

 On the view.html

 {{for review in reviews:}}
b{{=review.headline}}/b: {{=review.username}}
 {{pass}}

 I'm getting this error: KeyError: 'headline'

 Am I missing something?


 On Aug 12, 3:46 am, FERNANDO VILLARROEL fvillarr...@yahoo.com wrote:
  Thank you Massimo
 
  --- On Tue, 8/11/09, mdipierro mdipie...@cs.depaul.edu wrote:
 
 
 
   From: mdipierro mdipie...@cs.depaul.edu
   Subject: [web2py:28376] Re: Helpquery
   To: web2py-users web2py@googlegroups.com
   Date: Tuesday, August 11, 2009, 8:04 PM
 
   Here is is broken down into pieces:
 
   a=db.llamados
   b=db.accountcode.with_alias('b')
   c=db.clientes.with_alias('c')
  query=
   (b.id_clientes==clte)(a.dialstatus=='ANSWER')
   (a.inicio=desde)(a.inicio=hasta)
   left =
   (b.on(a.id_accountcode==b.id),c.on(b.id_clientes==c.id))
   rows = db(query).select
  
 (a.destino,a.answeredtime,a.inicio,a.fin,a.valor,left=left,orderby=~a.inici
 o)
 
   On Aug 11, 4:54 pm, FERNANDO VILLARROEL fvillarr...@yahoo.com
   wrote:
Dear all.
 
How i can doing the followingqueryfor web2py:
 
 select
   
   a.destino,a.answeredtime,a.inicio,a.fin,a.valor from
   llamados as a
 join
accountcode as b on a.id_accountcode=b.id
 join
clientes as c on b.id_clientes=c.id
 
 where id_clientes = clte and a.dialstatus='ANSWER'
   and (a.inicio =
 
desdeand a.inicio = hasta) order by a.inicio
   DESC
 
I want not use executesql.
 
Fernando
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29129] Re: Help query

2009-08-22 Thread Mladen Milankovic

Hi.

When you use multiple tables in a query, it return DALStorage object in 
DALStorage object for each table you requested. Simpler every row object is a 
dict which contains dict object for each table.

try:
{{for review in reviews:}}
b{{=review.reviews.headline}}/b: {{=review.users.username}}
{{pass}}

regards
mmlado

On Saturday 22 August 2009 12:09:18 tititi wrote:
 Hi, I'm testing a similiar join query but not getting success in
 extracting the dictionary

 r = db.reviews
 u = db.users
 query = ((db.reviews.id==request.args[0])  (db.users.id==1))
 left= (r.on(u.id==r.user_id))
 reviews=db(query).select
 (r.headline,r.article,u.username,left=left, orderby=r.date_added)
 return(reviews=reviews)

 On the view.html

 {{for review in reviews:}}
 b{{=review.headline}}/b: {{=review.username}}
 {{pass}}

 I'm getting this error: KeyError: 'headline'

 Am I missing something?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29130] Re: postgresql error

2009-08-22 Thread ctalley

I'm just getting back to this after being on travel for a week.

The path of consequence for python import statements is sys.path.

 import sys
 print sys.path
[... 'C:\\Python26\\lib\\site-packages' ...]

site-packages is indeed where psycopg2 is installed so no problem
there.

Lng story short, the latest build of psycopg2 (2.0.12) has a bug.
I installed 2.0.10 and the problem went away.

Thanks.

On Aug 17, 1:09 pm, Yarko Tymciurak yark...@gmail.com wrote:
 ok - so that says you have python installed somewhere, and associated with
 your *.py files (to execute them) - but it is not in your path;

 You either need to type the path to your python executable (on windows, the
 default would be something like c:/python/python.exe)  or add it to your
 path variable - then try the import statement from the python prompt...



 On Mon, Aug 17, 2009 at 12:03 PM, ctalley ctal...@caci.com wrote:

  web2py.exe is on the machine, but not running.  I'm running from
  web2py.py (source).

  Does it matter how it's started?  I started it by navigating to the
  web2py source folder and double clicking web2py.py.

  On Aug 17, 12:47 pm, Yarko Tymciurak yark...@gmail.com wrote:
   I see - are you running web2py.exe then?

   On Mon, Aug 17, 2009 at 11:37 AM, ctalley ctal...@caci.com wrote:

from the command prompt...

C:\python
'python' is not recognized as an internal or external command,
operable program or batch file.

On Aug 17, 12:16 pm, Yarko Tymciurak yark...@gmail.com wrote:
 if you try this from cmd shell, what do you get:

 C:  python
 Python 2.6.2
 Type help, copyright, credits or license for more
  information.

  import psycopg2
  dir('psycopg2')
 On Mon, Aug 17, 2009 at 10:57 AM, ctalley ctal...@caci.com wrote:

  I've been using SQLite and am trying to migrate to PostgreSQL.

  I'm getting this error immediately when starting my application...
  NameError: global name 'psycopg2' is not defined

  ...on this configuration...
  operating system: Windows XP

  web2py: version 1.66.0 source

  python: version 2.6.2 Windows

  psycopg2: version 2.0.12 for python 2.6

  Anything obviously wrong?

  Thanks.

  BTW, in case this hasn't already been pointed out, page 213 of the
  current manual has a typo.  It says...
  db=SQLDB(postgres:myuser:mypassw...@localhost:5432/mydb)

  but should say...
  db=SQLDB(postgres://myuser:mypassw...@localhost:5432/mydb)
  (note the // is missing in the first version)- Hide quoted text -

 - Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29131] Re: postgresql error

2009-08-22 Thread Yarko Tymciurak
Ach!  Good to know - thanks...

On Sat, Aug 22, 2009 at 6:18 PM, ctalley ctal...@caci.com wrote:


 I'm just getting back to this after being on travel for a week.

 The path of consequence for python import statements is sys.path.

  import sys
  print sys.path
 [... 'C:\\Python26\\lib\\site-packages' ...]

 site-packages is indeed where psycopg2 is installed so no problem
 there.

 Lng story short, the latest build of psycopg2 (2.0.12) has a bug.
 I installed 2.0.10 and the problem went away.

 Thanks.

 On Aug 17, 1:09 pm, Yarko Tymciurak yark...@gmail.com wrote:
  ok - so that says you have python installed somewhere, and associated
 with
  your *.py files (to execute them) - but it is not in your path;
 
  You either need to type the path to your python executable (on windows,
 the
  default would be something like c:/python/python.exe)  or add it to your
  path variable - then try the import statement from the python prompt...
 
 
 
  On Mon, Aug 17, 2009 at 12:03 PM, ctalley ctal...@caci.com wrote:
 
   web2py.exe is on the machine, but not running.  I'm running from
   web2py.py (source).
 
   Does it matter how it's started?  I started it by navigating to the
   web2py source folder and double clicking web2py.py.
 
   On Aug 17, 12:47 pm, Yarko Tymciurak yark...@gmail.com wrote:
I see - are you running web2py.exe then?
 
On Mon, Aug 17, 2009 at 11:37 AM, ctalley ctal...@caci.com wrote:
 
 from the command prompt...
 
 C:\python
 'python' is not recognized as an internal or external command,
 operable program or batch file.
 
 On Aug 17, 12:16 pm, Yarko Tymciurak yark...@gmail.com wrote:
  if you try this from cmd shell, what do you get:
 
  C:  python
  Python 2.6.2
  Type help, copyright, credits or license for more
   information.
 
   import psycopg2
   dir('psycopg2')
  On Mon, Aug 17, 2009 at 10:57 AM, ctalley ctal...@caci.com
 wrote:
 
   I've been using SQLite and am trying to migrate to PostgreSQL.
 
   I'm getting this error immediately when starting my
 application...
   NameError: global name 'psycopg2' is not defined
 
   ...on this configuration...
   operating system: Windows XP
 
   web2py: version 1.66.0 source
 
   python: version 2.6.2 Windows
 
   psycopg2: version 2.0.12 for python 2.6
 
   Anything obviously wrong?
 
   Thanks.
 
   BTW, in case this hasn't already been pointed out, page 213 of
 the
   current manual has a typo.  It says...
   db=SQLDB(postgres:myuser:mypassw...@localhost:5432/mydb)
 
   but should say...
   db=SQLDB(postgres://myuser:mypassw...@localhost:5432/mydb)
   (note the // is missing in the first version)- Hide quoted text
 -
 
  - Show quoted text -- Hide quoted text -
 
- Show quoted text -- Hide quoted text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29132] Re: web2py, bigtable and the '09 DAL

2009-08-22 Thread Robin B

You can access the 'table._tableobj' which is the generated GAE Model
object, however this is not a public interface and not subject to
backwards compatibility.

Posts = db['posts']._tableobj
Posts.get_by_id(long(id))

Robin


On Aug 21, 3:45 am, dlypka dly...@gmail.com wrote:
 Here are my GAE DALnr snippets.

 Some code has been simplified (by using if stmts with hard-coded
 classnames) for brevity.

 I will provide a link to a zip of a working sample next Monday.

 In gluon\contrib\gql.py:
 ---
 from google.appengine.ext import db as google_db
 from google.appengine.ext.db import polymodel as pm  # DLypka Mod to
 support PolyModel
    :
    :
 class MyGAEBaseDALnr(pm.PolyModel):   #DLypka Mod
     selflinkPrev = google_db.SelfReferenceProperty
 (collection_name='selflinksPrev')
     selflinkNext = google_db.SelfReferenceProperty
 (collection_name='selflinksNext')

 class MyGAEBaseDALnrSegment(pm.PolyModel):   #DLypka Mod  This entity
 is a child of MyGAEBaseDALnr
     linkToDALnr = google_db.ReferenceProperty(MyGAEBaseDALnr,
 required=False, collection_name='linksToDALnr')

 # DLypka Mod: New method
 def insertNative(self, **fields):
     self._db['_lastsql'] = 'insert'
     for field in self.fields:
         if not field in fields and self[field].default != None:
             fields[field] = self[field].default
         if field in fields:
             fields[field] = obj_represent(fields[field], self
 [field].type, self._db)
     tmp = self._tableobj(**fields)
     tmp.put()
     return dict(nativeRef=tmp, id=tmp.key().id())

 In Method     def _select(self, *fields, **attributes):
    :
    :
 #        tablename = table.kind()  # DLypka commented out
         isPoly = isinstance(table, pm.PolymorphicClass)  # DLypka
 Patch for PolyModel support
         if isPoly: # DLypka Patch for PolyModel support
             tablename = table.class_name() # DLypka Patch for
 PolyModel support
         else:  # DLypka Patch for PolyModel support
             tablename = table.kind()

 In Method     def _create(self):
    :
    :
    #Note: The specific class names are hardcoded in the following if()
 stmts for brevity in this snippet.
    #      This hard coding is replaced in my complete version of my
 DALnr
    #      with a new named parameter 'gaebaseclass'
    #      added into the define_table() method in gql.py
         if self._tablename == 'MyGAEBaseDALnr':
             self._tableobj = classobj(self._tablename,
 (MyGAEBaseDALnr, ), myfields)
         elif self._tablename == 'MyGAEBaseDALnrSegment':
             self._tableobj = classobj(self._tablename,
 (MyGAEBaseDALnrSegment, ), myfields)
         else:
             self._tableobj = classobj(self._tablename,
 (google_db.Model, ), myfields)
         return None

 ==

 In your applications\init\models\db.py:
 --
 db.define_table('DALnr',
                 db.Field('name','text')
                 )

 db.define_table('DALnrSegment',
                 db.Field('idDALnr',db.DALnr),    # web2py reference to
 parent
                 db.Field('level','integer'),
                 db.Field('name','text')
                 )

 myDALnrNativeInstance00keys = db.DALnr.insertNative
 (level=0,name='DALnr_01')  # I cloned insert() but I return a dict()
 with the native ref as well as id
 myDALnrNativeInstance00 = myDALnrNativeInstance00keys['nativeRef']
 myDALnrNativeInstance00id = myDALnrNativeInstance00keys['id']

 rows=db(db.DALnr.id  0).select()
 for row in rows:
     myDALnrInstance00 = row  # NOTE: There is only a single row here,
 so myDALnrInstance00  will be the row we just inserted into the web2py
 DAL

 myDALnrSegmentNativeInstance00_00keys = db.DALnrSegment.insertNative
 (idDALnr = myDALnrNativeInstance00id, level=0,
 name='DALnrSegment_00_01')
 myDALnrSegmentNativeInstance00_00 =
 myDALnrSegmentNativeInstance00_00keys['nativeRef']
 myDALnrSegmentNativeInstance00_00.linkToDALnr =
 myDALnrNativeInstance00 # Link this child to its parent

 myDALnrSegmentNativeInstance00_00.put()  # This rewrites (updates) the
 entity to have the updated value in linkToDALnr set in the previous
 stmt

 # === NOTE This is the Interesting part !!! ===
 links1 = myDALnrNativeInstance00.linksToDALnr  # === NOTE: this
 property was AUTOMATICALLY maintained by the automatic bidirectional
 nature of the ReferenceProperty, so that the 'parent' has a list of
 refs to its related children, without any explicit code to add
 them!!!
 # links1 is a google.appengine.ext.db.query
 # It is a db.Query

 # loop on links1 which is a column on the parent entity and see what
 you get:
 for key in links1:
     childref = key  # childref is (magically) a MyGAEBaseDALnrSegment
 which is a child of 

[web2py:29133] Password 2 field - Using Custom on Registration.

2009-08-22 Thread Yannick

Hello mate,
quick question... I'm trying to customize the Registration form using
Auth.
I was wondering about the Password_two field ???
here is what I'm doing but not working:



{{=regform.custom.begin}}
 {{=regform.custom.widget.first_name}}
 {{=regform.custom.widget.last_name}}
 {{=regform.custom.widget.email}}
 {{=regform.custom.widget.password}}
 {{=regform.custom.widget.password_two}} ### --- here is my
problem ??? what to i have to put here?
 {{=regform.custom.submit}}
{{=regform.custom.end}}

##

with this   {{=regform.custom.widget.password_two}} the textfield
doesn't show... What do I have to put there ?

Can anyone already had the same issue ?

Thanks for your help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29134] correct path in href?

2009-08-22 Thread jayvandal

HI,
I have a controller named person
I have a controller welcome. I created a def home() in welcome
controller.
I want to have the user go to  a controller  named person that has
definitions for person., show_person, new_person.
I was trying to use this statement below, but I don't know  how to
construct f This doesn't work


{{=A('create show person',_href=URL(r=request,f='app/controllers/
person/person.py'))}}


Thanks for any help
Jim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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:29135] Re: correct path in href?

2009-08-22 Thread Jonathan Lundell

On Aug 22, 2009, at 10:16 PM, jayvandal wrote:

 I have a controller named person
 I have a controller welcome. I created a def home() in welcome
 controller.
 I want to have the user go to  a controller  named person that has
 definitions for person., show_person, new_person.
 I was trying to use this statement below, but I don't know  how to
 construct f This doesn't work


 {{=A('create show person',_href=URL(r=request,f='app/controllers/
 person/person.py'))}}

Try something like: URL(r=request, c='person', f='show_person')

...or whatever the function is that you want.

But the 'person' controller should be app/controllers/person.py, not  
the path you show above.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users 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
-~--~~~~--~~--~--~---