Re: [web2py] Re: Vim snippets for web2py

2010-04-07 Thread Thadeus Burgess
This is nice! I should learn how to use vim :P

Could anybody convert this to a gedit snippet?

-Thadeus





On Wed, Apr 7, 2010 at 5:02 AM, Doxaliber salingro...@gmail.com wrote:
 Fantastic! Thank you!

 On 7 Apr, 08:25, Benigno bca...@albendas.com wrote:
 Wow, big big thanks to Leonardo. Everything is in there...

 Muchas gracias.
 Benigno.

 On Apr 6, 4:27 am, DenesL denes1...@yahoo.ca wrote:

  Leonardo Vidarte, one of the users in the spanish language group, has
  created some snippets [0] for Vim, for the snipMate plugin [1] to be
  exact, with all the API of web2py 1.76.3, including some basic
  snippets for template creation.

  Hopefully they will be useful to somebody. Additions are welcome.

  [0]http://github.com/lvidarte/web2py-snippets
  [1]http://www.vim.org/scripts/script.php?script_id=2540

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] When and how to use command line option -f FOLDER?

2010-04-07 Thread Thadeus Burgess
In windows if you are using NTFS there is something called a Junction
Point which is a hard link. It works like linux `ln`.

http://en.wikipedia.org/wiki/NTFS_junction_point

You have to BE CAREFUL, hard links work like folders! If you delete a
hard link, you delete the file You have to delete it a special
way.

Here is some spiffy software

http://elsdoerfer.name/=ntfslink

-Thadeus





On Wed, Apr 7, 2010 at 10:44 AM, Iceberg iceb...@21cn.com wrote:
 Hi, do you pals know when and how to use command line option -f
 FOLDER? I hope to hear some experience.

 My major web2py develop environment used to be a web2py source version
 freshly from latest trunk, on Windows XP, but without win32 extention
 (why bothers). But today I have to use a web2py windows binary version
 as a workaround due to the cron feature. Detail is available here:
 https://groups.google.com/group/web2py/browse_frm/thread/7d577b75534fe8b8#

 So it seems my apps must be duplicated for the two web2py version home
 folder. But that is inconvenient to maintain. Therefore I am looking
 for a way to let the two (or more) copies of web2py share same
 applications folder. On windows, we don't have ln -s. But web2py
 looks like having builtin solution.

  -f FOLDER, --folder=FOLDER
                        folder from which to run web2py

 However, even I start web2py like this:
  C:\ cd \my\first\web2py
  C:\ web2py.py -a1 -f C:\my\another\web2py
 the web2py starts, serves, but still only hosting apps under the \my
 \first\web2py\applications, not those under \my\another\web2py
 \applications.

 So, is -f FOLDER supposed to do what I want?

 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 web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-07 Thread Thadeus Burgess
Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, line
173, in restricted
exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
line 62, in module
thead
  File /home/tburgess/Applications/web2py/applications/pms/models/common.py,
line 197, in lambda
db.TableA.id_TableB.represent = lambda value: %s % db.TableB[value].name
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2402,
in __getitem__
return self._db(self.id == key).select().first()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 3276, in select
return self._db._adapter.select(self._query,*fields,**attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 507, in select
query = self.SELECT(query,*fields, **attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 433, in SELECT
for field in self.db[table]:
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2102,
in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'None'

-Thadeus





On Mon, Apr 5, 2010 at 6:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 uploading fix. please check it. Thanks for testing this.

 On Apr 5, 3:59 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
 line 278, in module
   File /home/tburgess/Applications/web2py/gluon/globals.py, line 96,
 in lambda
     self._caller = lambda f: f()
   File 
 /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
 line 76, in duplicates
     orderby=db.potentials.A
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
 select
     return self._db._adapter.select(self._query,*fields,**attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in select
     return self.parse(rows,self._colnames)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 706, in parse
     (rid._table, rid._record) = (db[referee], None)
 NameError: global name 'db' is not defined

 -Thadeus

 On Mon, Apr 5, 2010 at 3:01 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  try now

  On Apr 5, 2:30 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Now I get this for reference field

  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
  line 84, in module
      {{=db.table[column].represent(d.B[column])}}
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
  in __getattr__
      self.__allocate()
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
  in __allocate
      self._record = self._table[int(self)]
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
  in __getitem__
      return self._db(self.id == key).select().first()
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
  select
      return self._db._adapter.select(self._query,*fields,**attributes)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
  select
      return self.parse(rows,self._colnames)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, in 
  parse
      colset[fieldname] = rid = Reference(value)
  TypeError: int() argument must be a string or a number, not 'NoneType'

  -Thadeus

  On Mon, Apr 5, 2010 at 2:20 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   I fixed the former. I did not fix the latter. It is a known problem
   with the new dal and one of the few things that needs to be ironed
   out: it does not like select('fieldname') only
   select(db.table['fieldname']). Not difficult to fix anyway.

   On Apr 5, 2:13 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   I get this traceback when attempting to access a reference field.

   rows = db().select(db.table.ALL)
   for r in rows:
     r.id
     r.title
     r.reference_field.name
     r.reference_field.description

   Traceback (most recent call last):
     File /home/tburgess/Applications/web2py/gluon/restricted.py, line
   173, in restricted
       exec ccode in environment
     File 
   /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
   line 84, in module
       {{=db.field[column].represent(d.B[column])}}
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
   in __getattr__
       self.__allocate()
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
   in __allocate
       self._record = self._table[int(self)]
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
   in __getitem__
       return self._db(self.id == key).select

Re: [web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-07 Thread Thadeus Burgess
It comes from the line


db.TableB[value].name

-Thadeus





On Wed, Apr 7, 2010 at 3:19 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 need more info

 On Apr 7, 1:36 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
 line 62, in module
     thead
   File 
 /home/tburgess/Applications/web2py/applications/pms/models/common.py,
 line 197, in lambda
     db.TableA.id_TableB.represent = lambda value: %s % 
 db.TableB[value].name
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2402,
 in __getitem__
     return self._db(self.id == key).select().first()
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 3276, in 
 select
     return self._db._adapter.select(self._query,*fields,**attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 507, in select
     query = self.SELECT(query,*fields, **attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 433, in SELECT
     for field in self.db[table]:
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2102,
 in __getitem__
     return dict.__getitem__(self, str(key))
 KeyError: 'None'

 -Thadeus

 On Mon, Apr 5, 2010 at 6:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  uploading fix. please check it. Thanks for testing this.

  On Apr 5, 3:59 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 278, in module
    File /home/tburgess/Applications/web2py/gluon/globals.py, line 96,
  in lambda
      self._caller = lambda f: f()
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 76, in duplicates
      orderby=db.potentials.A
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
  select
      return self._db._adapter.select(self._query,*fields,**attributes)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
  select
      return self.parse(rows,self._colnames)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 706, in 
  parse
      (rid._table, rid._record) = (db[referee], None)
  NameError: global name 'db' is not defined

  -Thadeus

  On Mon, Apr 5, 2010 at 3:01 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   try now

   On Apr 5, 2:30 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Now I get this for reference field

   Traceback (most recent call last):
     File /home/tburgess/Applications/web2py/gluon/restricted.py, line
   173, in restricted
       exec ccode in environment
     File 
   /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
   line 84, in module
       {{=db.table[column].represent(d.B[column])}}
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
   in __getattr__
       self.__allocate()
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
   in __allocate
       self._record = self._table[int(self)]
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
   in __getitem__
       return self._db(self.id == key).select().first()
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, 
   in select
       return self._db._adapter.select(self._query,*fields,**attributes)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
   select
       return self.parse(rows,self._colnames)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, in 
   parse
       colset[fieldname] = rid = Reference(value)
   TypeError: int() argument must be a string or a number, not 'NoneType'

   -Thadeus

   On Mon, Apr 5, 2010 at 2:20 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
I fixed the former. I did not fix the latter. It is a known problem
with the new dal and one of the few things that needs to be ironed
out: it does not like select('fieldname') only
select(db.table['fieldname']). Not difficult to fix anyway.

On Apr 5, 2:13 pm, Thadeus Burgess thade...@thadeusb.com wrote:
I get this traceback when attempting to access a reference field.

rows = db().select(db.table.ALL)
for r in rows:
  r.id
  r.title
  r.reference_field.name
  r.reference_field.description

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, 
line
173, in restricted
    exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
line 84, in module
    {{=db.field[column].represent(d.B[column])}}
  File /home/tburgess/Applications/web2py

[web2py] enum types

2010-04-07 Thread Thadeus Burgess
Does the DAL support database ENUM types?

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] enum types

2010-04-07 Thread Thadeus Burgess
This is necessary for connecting to a legacy MySQL database.

-Thadeus





On Wed, Apr 7, 2010 at 4:06 PM, Kuba Kucharski kuba.kuchar...@gmail.com wrote:
 hi, thadeus

 there was whole thread about this:

 http://www.mail-archive.com/web2py@googlegroups.com/msg10329.html

 --
 Kuba



 On Wed, Apr 7, 2010 at 10:55 PM, Thadeus Burgess thade...@thadeusb.com 
 wrote:
 Does the DAL support database ENUM types?

 -Thadeus

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-07 Thread Thadeus Burgess
No.

For dal.py to be accepted it has to work exactly like sql.py

Therefore I cannot make ANY code changes if we want a new DAL.

-Thadeus





On Wed, Apr 7, 2010 at 5:31 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 This

    db.TableA.id_TableB.represent = lambda value: %s %
 db.TableB[value].name

 should be

    db.TableA.id_TableB.represent = lambda value: (db.TableB[value] or
 {}).get('name','anonymous')

 On Apr 7, 1:36 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
 line 62, in module
     thead
   File 
 /home/tburgess/Applications/web2py/applications/pms/models/common.py,
 line 197, in lambda
     db.TableA.id_TableB.represent = lambda value: %s % 
 db.TableB[value].name
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2402,
 in __getitem__
     return self._db(self.id == key).select().first()
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 3276, in 
 select
     return self._db._adapter.select(self._query,*fields,**attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 507, in select
     query = self.SELECT(query,*fields, **attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 433, in SELECT
     for field in self.db[table]:
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2102,
 in __getitem__
     return dict.__getitem__(self, str(key))
 KeyError: 'None'

 -Thadeus

 On Mon, Apr 5, 2010 at 6:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  uploading fix. please check it. Thanks for testing this.

  On Apr 5, 3:59 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 278, in module
    File /home/tburgess/Applications/web2py/gluon/globals.py, line 96,
  in lambda
      self._caller = lambda f: f()
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 76, in duplicates
      orderby=db.potentials.A
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
  select
      return self._db._adapter.select(self._query,*fields,**attributes)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
  select
      return self.parse(rows,self._colnames)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 706, in 
  parse
      (rid._table, rid._record) = (db[referee], None)
  NameError: global name 'db' is not defined

  -Thadeus

  On Mon, Apr 5, 2010 at 3:01 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   try now

   On Apr 5, 2:30 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Now I get this for reference field

   Traceback (most recent call last):
     File /home/tburgess/Applications/web2py/gluon/restricted.py, line
   173, in restricted
       exec ccode in environment
     File 
   /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
   line 84, in module
       {{=db.table[column].represent(d.B[column])}}
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
   in __getattr__
       self.__allocate()
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
   in __allocate
       self._record = self._table[int(self)]
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
   in __getitem__
       return self._db(self.id == key).select().first()
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, 
   in select
       return self._db._adapter.select(self._query,*fields,**attributes)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
   select
       return self.parse(rows,self._colnames)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, in 
   parse
       colset[fieldname] = rid = Reference(value)
   TypeError: int() argument must be a string or a number, not 'NoneType'

   -Thadeus

   On Mon, Apr 5, 2010 at 2:20 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
I fixed the former. I did not fix the latter. It is a known problem
with the new dal and one of the few things that needs to be ironed
out: it does not like select('fieldname') only
select(db.table['fieldname']). Not difficult to fix anyway.

On Apr 5, 2:13 pm, Thadeus Burgess thade...@thadeusb.com wrote:
I get this traceback when attempting to access a reference field.

rows = db().select(db.table.ALL)
for r in rows:
  r.id
  r.title
  r.reference_field.name
  r.reference_field.description

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, 
line
173

[web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-07 Thread Thadeus Burgess
I am defining this function.

db.define_table('person', Field('name'))
db.define_table('dog', Field('nickname'), Field('owner', db.person))

db.dog.owner.represent = lambda value: %s % db.owner[value].name

This works in sql.py

This does not work in dal.py

You said you made changes, I tested, works just fine on sql.py, and
has been for quite a while, however I get that stacktrace when I use
dal.py.

-Thadeus





On Wed, Apr 7, 2010 at 8:34 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I guess I do not understand. Who defined this represent function? is
 it not in your code? Are you saying this is a bug in sql.py?

 On Apr 7, 7:48 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 No.

 For dal.py to be accepted it has to work exactly like sql.py

 Therefore I cannot make ANY code changes if we want a new DAL.

 -Thadeus

 On Wed, Apr 7, 2010 at 5:31 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  This

     db.TableA.id_TableB.represent = lambda value: %s %
  db.TableB[value].name

  should be

     db.TableA.id_TableB.represent = lambda value: (db.TableB[value] or
  {}).get('name','anonymous')

  On Apr 7, 1:36 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
  line 62, in module
      thead
    File 
  /home/tburgess/Applications/web2py/applications/pms/models/common.py,
  line 197, in lambda
      db.TableA.id_TableB.represent = lambda value: %s % 
  db.TableB[value].name
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2402,
  in __getitem__
      return self._db(self.id == key).select().first()
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 3276, in 
  select
      return self._db._adapter.select(self._query,*fields,**attributes)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 507, in 
  select
      query = self.SELECT(query,*fields, **attributes)
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 433, in 
  SELECT
      for field in self.db[table]:
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2102,
  in __getitem__
      return dict.__getitem__(self, str(key))
  KeyError: 'None'

  -Thadeus

  On Mon, Apr 5, 2010 at 6:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   uploading fix. please check it. Thanks for testing this.

   On Apr 5, 3:59 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Traceback (most recent call last):
     File /home/tburgess/Applications/web2py/gluon/restricted.py, line
   173, in restricted
       exec ccode in environment
     File 
   /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
   line 278, in module
     File /home/tburgess/Applications/web2py/gluon/globals.py, line 96,
   in lambda
       self._caller = lambda f: f()
     File 
   /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
   line 76, in duplicates
       orderby=db.potentials.A
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, 
   in select
       return self._db._adapter.select(self._query,*fields,**attributes)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in 
   select
       return self.parse(rows,self._colnames)
     File /home/tburgess/Applications/web2py/gluon/sql.py, line 706, in 
   parse
       (rid._table, rid._record) = (db[referee], None)
   NameError: global name 'db' is not defined

   -Thadeus

   On Mon, Apr 5, 2010 at 3:01 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
try now

On Apr 5, 2:30 pm, Thadeus Burgess thade...@thadeusb.com wrote:
Now I get this for reference field

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, 
line
173, in restricted
    exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
line 84, in module
    {{=db.table[column].represent(d.B[column])}}
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
in __getattr__
    self.__allocate()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
in __allocate
    self._record = self._table[int(self)]
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
in __getitem__
    return self._db(self.id == key).select().first()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 
3258, in select
    return 
self._db._adapter.select(self._query,*fields,**attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, 
in select
    return self.parse(rows,self._colnames)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, 
in parse
    colset[fieldname] = rid = Reference(value)
TypeError: int() argument

Re: [web2py] Re: recaptcha in LOAD not working

2010-04-06 Thread Thadeus Burgess
I was under the impression that if the js code was in script tags it
would execute it when inserted into the DOM ?

There is always exec.

-Thadeus





On Tue, Apr 6, 2010 at 5:04 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Now I understand. The problem is not the ajax trap. The problem is
 that browsers do not execute JS code in ajax loaded context. This is
 not a web2py issue but I can see the problem. Let me give this some
 thought.

 On Apr 6, 3:39 pm, Kuba Kucharski kuba.kuchar...@gmail.com wrote:
 Massimo,

 Isn't this the same issue?

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Problem with MANY-MANY relationship

2010-04-05 Thread Thadeus Burgess
Your join is performing a union, your queries could (and will) get
quite huge, since your getting a record for every tag. (so for two
tags you actually get two rows for that snippet). A left join will
provide you with everything, but you still get a row for every tag.

Even with a left join you will still have to query for the title of the tag

 rows = db().select(db.snippets.ALL, db.snippet_tags_link.ALL, 
 left=db.snippet_tags_link.on(db.snippets.id == 
 db.snippet_tags_link.snippet_id))
 print rows
snippets.id,snippets.title,snippets.content,snippets.created,snippet_tags_link.id,snippet_tags_link.snippet_id,snippet_tags_link.tag_id
1,hi,hello world,2010-04-05 09:21:20,1,1,1
1,hi,hello world,2010-04-05 09:21:20,2,1,1
2,woot,erifica,2010-04-05 09:21:20,NULL,NULL,NULL


Or you can do a secondary query to get the tags.

snippets = db().select()
for snip in snippets:
   print snippet.title
   for tag in snip.snippet_tags_link.select():
  print tag.snippet_tags.name

-Thadeus





On Mon, Apr 5, 2010 at 8:46 AM, Ishbir ishbi...@gmail.com wrote:
 I've got some problem with the MANY-MANY relation in Web2Py. This is
 my code-

 http://pastie.textmate.org/903738

 Now, the problem is that the query returns only those records which
 have tags, not the ones without them. However, if I specify query|
 db.snippets.id0 or anything, it gives me garbled results with all the
 tables mixed up and nothing right..

 Is there any way around this? I thought about using the tagging plugin
 but the issue is that I don't think it would be very efficient since I
 need to also display the tags on the index page and that would result
 in n+1 queries where n is the no. of snippets. Or I am just getting
 apprehensive and it will just take 2-3 queries to get the tags of
 snippet?

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: How to use virtualfields?

2010-04-05 Thread Thadeus Burgess
Its slower because each function is executed with the query. So what
happens is when you get your rows object, it is the value of the
function, not the function.

If you wrap all of your functions in a lambda as a lazy function,
then it will increase the speed

please look at 
http://thadeusb.com/weblog/view/web2py_virtualfields_as_an_orm_an_sqlalchemy_approach
for more information

-Thadeus





On Mon, Apr 5, 2010 at 3:13 AM, Iceberg iceb...@21cn.com wrote:
 Old problem solved, new problem arises.

 There is a somewhat obvious difference which I did not notice before.

  (1) db.table.virtualfields.append(ComputedFields())
  This need to be executed BEFORE db().select(), otherwise it will NOT
 affect the select result rows.

  (2) rows.setvirtualfields(table=ComputedFields())
  This of course can only be used AFTER you've got the rows (and you
 can't possibly go to the wrong way.)

 However, there must be some more subtle difference I don't know yet.
 Even I use (1) BEFORE my db().select(), I found that is much slower
 (perhaps due to some lazy function call). And worse, (1) can't support
 virtual field has SAME name as real field, while (2) can. My code
 looks like:

  class VirtualFields:
      distributors=db().select(db.Distributor.id,db.Distributor.name,
          cache=(cache.ram,3600*24)).as_dict()
      def income(self):
          # round the real field income into per thousand unit
          return self.mytable.income / 1000.0
      def distributor(self):
          # tend to change real field distributor from id to its
 name
          return self.distributors.get(
              self.Orders.distributor,{}).get('name')

 So I think I have to stick to usage (2), do I?

 BTW, I am using the latest web2py trunk on Windows XP.

 Regards,
 Iceberg

 On Apr5, 12:18pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I just did this as a test and it worked:

  db=DAL('sqlite:memory:')
  db.define_table('test',Field('quantity','integer'))
  class VirtualFields():

 ...     def profit(self): return self.test.quantity*100 
 db.test.virtualfields.append(VirtualFields())
  db.test.insert(quantity=5)
 1
  rows=db(db.test.id0).select()
  for row in rows: print row

 ...
 Row {'update_record': function lambda at 0x1b8dbb0, 'profit':
 500, 'id': 1, 'delete_record': function lambda at 0x1b8dab0,
 'quantity': 5}

 Sure you are running an updated version of web2py? Which os? which
 version?


   On Sun, Apr 4, 2010 at 10:51 PM, Iceberg iceb...@21cn.com wrote:
Hi there,

I search virtualfields inhttp://www.web2py.com/bookbutfound
nothing.

So I read this post instead:  
https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6...

But I found that
 db.table.virtualfields.append(ComputedFields())
doesn't work.

Only this work:
 rows.setvirtualfields(table=ComputedFields())

Does the former syntax really supposed to exist?

I am using web2py 1.75.4

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 web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] bug in dal.py _first() and SQLFORM ._tablename

2010-04-05 Thread Thadeus Burgess
I get this traceback when attempting to access a reference field.

rows = db().select(db.table.ALL)
for r in rows:
  r.id
  r.title
  r.reference_field.name
  r.reference_field.description

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, line
173, in restricted
exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
line 84, in module
{{=db.field[column].represent(d.B[column])}}
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
in __getattr__
self.__allocate()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
in __allocate
self._record = self._table[int(self)]
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
in __getitem__
return self._db(self.id == key).select()._first()
AttributeError: 'Rows' object has no attribute '_first'


I get this traceback from form = SQLFORM(db.mytable)

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, line
173, in restricted
exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
line 278, in module
  File 
/home/tburgess/Applications/web2py/applications/pms/models/plugin_compression.py,
line 28, in compress_response
d = d()
  File 
/home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
line 15, in index
return dict(hi='hi', form=SQLFORM(db.mytable))
  File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
688, in __init__
inp = self.widgets.multiple.widget(field, default)
  File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
211, in widget
return OptionsWidget.widget(field, value, **attributes)
  File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
187, in widget
options = requires[0].options()
  File /home/tburgess/Applications/web2py/gluon/validators.py, line
2227, in _options
options = self.other.options()
  File /home/tburgess/Applications/web2py/gluon/validators.py, line
385, in options
self.build_set()
  File /home/tburgess/Applications/web2py/gluon/validators.py, line
369, in build_set
records = self.dbset.select(*self.fields, **dd)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in select
return self._db._adapter.select(self._query,*fields,**attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 501, in select
query = self.SELECT(query,*fields, **attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 432, in SELECT
tablenames.append(f._tablename)
AttributeError: 'str' object has no attribute '_tablename'


-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] DAL query count patch

2010-04-05 Thread Thadeus Burgess
Attached is a patch to allow the dal.py to keep track of query counts and types.

Usage

 db.qry_count()
{'SELECT': 5, 'INSERT': 2, 'DELETE': 1}

Massimo, do you accept?

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.

diff -r ef8d90c29480 gluon/dal.py
--- a/gluon/dal.py	Fri Mar 26 22:59:54 2010 -0500
+++ b/gluon/dal.py	Mon Apr 05 14:15:40 2010 -0500
@@ -571,10 +571,25 @@
 return False
 
 def log_execute(self,*a,**b):
+# Make sure its defined!
+if not self.__dict__.has_key('qry_count'):
+self.qry_count = {}
+
 self.db._lastsql = a[0]
 self.db._logger.write(datetime.datetime.now().isoformat()+'\n'+a[0]+'\n')
 try:
 ret = self.cursor.execute(*a,**b)
+
+# Get the type of the query,
+# This is usually the first
+# word of the SQL statement
+qry_type = a[0].split(' ')[0]
+
+# Add to our counter
+if self.qry_count.has_key(qry_type):
+self.qry_count[qry_type] += 1
+else:
+self.qry_count[qry_type] = 1
 finally:
 self.db._logger.write(traceback.format_exc())
 return ret
@@ -2016,6 +2031,13 @@
 if name.upper() in self.RSK[backend]:
 raise SyntaxError, 'invalid table/column name %s is a %s reserved SQL keyword' % (name, backend.upper())
 
+def qry_count(self):
+if self._adapter.__dict__.has_key('qry_count'):
+ret = self._adapter.qry_count
+else:
+ret = None
+return ret
+
 def define_table(
 self,
 tablename,


Re: [web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-05 Thread Thadeus Burgess
Now I get this for reference field

Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, line
173, in restricted
exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
line 84, in module
{{=db.table[column].represent(d.B[column])}}
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
in __getattr__
self.__allocate()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
in __allocate
self._record = self._table[int(self)]
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
in __getitem__
return self._db(self.id == key).select().first()
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in select
return self._db._adapter.select(self._query,*fields,**attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in select
return self.parse(rows,self._colnames)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, in parse
colset[fieldname] = rid = Reference(value)
TypeError: int() argument must be a string or a number, not 'NoneType'

-Thadeus





On Mon, Apr 5, 2010 at 2:20 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I fixed the former. I did not fix the latter. It is a known problem
 with the new dal and one of the few things that needs to be ironed
 out: it does not like select('fieldname') only
 select(db.table['fieldname']). Not difficult to fix anyway.

 On Apr 5, 2:13 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I get this traceback when attempting to access a reference field.

 rows = db().select(db.table.ALL)
 for r in rows:
   r.id
   r.title
   r.reference_field.name
   r.reference_field.description

 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
 line 84, in module
     {{=db.field[column].represent(d.B[column])}}
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
 in __getattr__
     self.__allocate()
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
 in __allocate
     self._record = self._table[int(self)]
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
 in __getitem__
     return self._db(self.id == key).select()._first()
 AttributeError: 'Rows' object has no attribute '_first'

 I get this traceback from form = SQLFORM(db.mytable)

 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
 line 278, in module
   File 
 /home/tburgess/Applications/web2py/applications/pms/models/plugin_compression.py,
 line 28, in compress_response
     d = d()
   File 
 /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
 line 15, in index
     return dict(hi='hi', form=SQLFORM(db.mytable))
   File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
 688, in __init__
     inp = self.widgets.multiple.widget(field, default)
   File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
 211, in widget
     return OptionsWidget.widget(field, value, **attributes)
   File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
 187, in widget
     options = requires[0].options()
   File /home/tburgess/Applications/web2py/gluon/validators.py, line
 2227, in _options
     options = self.other.options()
   File /home/tburgess/Applications/web2py/gluon/validators.py, line
 385, in options
     self.build_set()
   File /home/tburgess/Applications/web2py/gluon/validators.py, line
 369, in build_set
     records = self.dbset.select(*self.fields, **dd)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
 select
     return self._db._adapter.select(self._query,*fields,**attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 501, in select
     query = self.SELECT(query,*fields, **attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 432, in SELECT
     tablenames.append(f._tablename)
 AttributeError: 'str' object has no attribute '_tablename'

 -Thadeus

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http

Re: [web2py] Re: DAL query count patch

2010-04-05 Thread Thadeus Burgess
Novelty. Many websites you see will have at the bottom time took to
process request, number of queries to database.

-Thadeus





On Mon, Apr 5, 2010 at 2:24 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I do not see any reason against except that I do not see any reason in
 favor either. Why do you need it?

 Massimo

 On Apr 5, 2:16 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Attached is a patch to allow the dal.py to keep track of query counts and 
 types.

 Usage

  db.qry_count()

 {'SELECT': 5, 'INSERT': 2, 'DELETE': 1}

 Massimo, do you accept?

 -Thadeus

  qry_count.hg.diff
 1KViewDownload

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: DAL query count patch

2010-04-05 Thread Thadeus Burgess
Ah, well the real goal is for it to only be the number of statements
pending in a given transaction.

So db.commit() or db.rollback() should clear the results...

The time counting I am doing in my models, and in response._caller...
but this is not including time taken to set up the environment before
web2py executes the models.

-Thadeus





On Mon, Apr 5, 2010 at 2:43 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 But this does not count the time, just the number of past requests (in
 thread? total?). Am I wrong?
 Moreover the count will be wrong if the web server restarts the
 process. no?

 Massimo

 On Apr 5, 2:33 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Novelty. Many websites you see will have at the bottom time took to
 process request, number of queries to database.

 -Thadeus

 On Mon, Apr 5, 2010 at 2:24 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  I do not see any reason against except that I do not see any reason in
  favor either. Why do you need it?

  Massimo

  On Apr 5, 2:16 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Attached is a patch to allow the dal.py to keep track of query counts and 
  types.

  Usage

   db.qry_count()

  {'SELECT': 5, 'INSERT': 2, 'DELETE': 1}

  Massimo, do you accept?

  -Thadeus

   qry_count.hg.diff
  1KViewDownload

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: DAL query count patch

2010-04-05 Thread Thadeus Burgess
I would like to hear what others think as well.

I do not see how the DAL class knows, could know, might know, when a
query is being executed?

-Thadeus





On Mon, Apr 5, 2010 at 3:15 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Since the new DAL is a class you can define them by subclassing DAL.
 What do you think? I am not convinced this is useful in general and
 needs to be in trunk. It seems a very specialized application but
 perhaps I am missing something. I'd like to hear what other people
 think about this.

 On Apr 5, 3:00 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Ah, well the real goal is for it to only be the number of statements
 pending in a given transaction.

 So db.commit() or db.rollback() should clear the results...

 The time counting I am doing in my models, and in response._caller...
 but this is not including time taken to set up the environment before
 web2py executes the models.

 -Thadeus

 On Mon, Apr 5, 2010 at 2:43 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  But this does not count the time, just the number of past requests (in
  thread? total?). Am I wrong?
  Moreover the count will be wrong if the web server restarts the
  process. no?

  Massimo

  On Apr 5, 2:33 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Novelty. Many websites you see will have at the bottom time took to
  process request, number of queries to database.

  -Thadeus

  On Mon, Apr 5, 2010 at 2:24 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   I do not see any reason against except that I do not see any reason in
   favor either. Why do you need it?

   Massimo

   On Apr 5, 2:16 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Attached is a patch to allow the dal.py to keep track of query counts 
   and types.

   Usage

db.qry_count()

   {'SELECT': 5, 'INSERT': 2, 'DELETE': 1}

   Massimo, do you accept?

   -Thadeus

    qry_count.hg.diff
   1KViewDownload

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

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: bug in dal.py _first() and SQLFORM ._tablename

2010-04-05 Thread Thadeus Burgess
Traceback (most recent call last):
  File /home/tburgess/Applications/web2py/gluon/restricted.py, line
173, in restricted
exec ccode in environment
  File 
/home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
line 278, in module
  File /home/tburgess/Applications/web2py/gluon/globals.py, line 96,
in lambda
self._caller = lambda f: f()
  File 
/home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
line 76, in duplicates
orderby=db.potentials.A
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in select
return self._db._adapter.select(self._query,*fields,**attributes)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in select
return self.parse(rows,self._colnames)
  File /home/tburgess/Applications/web2py/gluon/sql.py, line 706, in parse
(rid._table, rid._record) = (db[referee], None)
NameError: global name 'db' is not defined

-Thadeus





On Mon, Apr 5, 2010 at 3:01 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 try now

 On Apr 5, 2:30 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Now I get this for reference field

 Traceback (most recent call last):
   File /home/tburgess/Applications/web2py/gluon/restricted.py, line
 173, in restricted
     exec ccode in environment
   File 
 /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
 line 84, in module
     {{=db.table[column].represent(d.B[column])}}
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
 in __getattr__
     self.__allocate()
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
 in __allocate
     self._record = self._table[int(self)]
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
 in __getitem__
     return self._db(self.id == key).select().first()
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 3258, in 
 select
     return self._db._adapter.select(self._query,*fields,**attributes)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 512, in select
     return self.parse(rows,self._colnames)
   File /home/tburgess/Applications/web2py/gluon/sql.py, line 707, in parse
     colset[fieldname] = rid = Reference(value)
 TypeError: int() argument must be a string or a number, not 'NoneType'

 -Thadeus

 On Mon, Apr 5, 2010 at 2:20 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  I fixed the former. I did not fix the latter. It is a known problem
  with the new dal and one of the few things that needs to be ironed
  out: it does not like select('fieldname') only
  select(db.table['fieldname']). Not difficult to fix anyway.

  On Apr 5, 2:13 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  I get this traceback when attempting to access a reference field.

  rows = db().select(db.table.ALL)
  for r in rows:
    r.id
    r.title
    r.reference_field.name
    r.reference_field.description

  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/views/default/index.html,
  line 84, in module
      {{=db.field[column].represent(d.B[column])}}
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2210,
  in __getattr__
      self.__allocate()
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2203,
  in __allocate
      self._record = self._table[int(self)]
    File /home/tburgess/Applications/web2py/gluon/sql.py, line 2384,
  in __getitem__
      return self._db(self.id == key).select()._first()
  AttributeError: 'Rows' object has no attribute '_first'

  I get this traceback from form = SQLFORM(db.mytable)

  Traceback (most recent call last):
    File /home/tburgess/Applications/web2py/gluon/restricted.py, line
  173, in restricted
      exec ccode in environment
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 278, in module
    File 
  /home/tburgess/Applications/web2py/applications/pms/models/plugin_compression.py,
  line 28, in compress_response
      d = d()
    File 
  /home/tburgess/Applications/web2py/applications/pms/controllers/default.py,
  line 15, in index
      return dict(hi='hi', form=SQLFORM(db.mytable))
    File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
  688, in __init__
      inp = self.widgets.multiple.widget(field, default)
    File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
  211, in widget
      return OptionsWidget.widget(field, value, **attributes)
    File /home/tburgess/Applications/web2py/gluon/sqlhtml.py, line
  187, in widget
      options = requires[0].options()
    File /home/tburgess/Applications/web2py/gluon/validators.py, line
  2227, in _options
      options = self.other.options()
    File /home/tburgess/Applications/web2py/gluon/validators.py, line
  385, in options
      self.build_set()
    File /home/tburgess/Applications/web2py/gluon

Re: [web2py] recaptcha in LOAD not working

2010-04-05 Thread Thadeus Burgess
It is because recaptcha uses ajax to communicate, and when using LOAD
web2py traps all ajax calls, so the recaptcha requests are not making
it to the server.

-Thadeus





On Mon, Apr 5, 2010 at 5:05 PM, selecta gr...@delarue-berlin.de wrote:
 I tried to use Recaptcha in a LOAD div but I does not work

 The problem is that the page stats reloading when it gets to the div
 loaded with LOAD where the recaptcha javascripts are in and gets stuck
 on reloading it

 controller:
 ...
 form = SQLFORM.factory(Field('tag_name'))
 captcha = None
 if not auth.user:
    captcha = Recaptcha(request,'xxx','xxx')
    form[0].append(captcha)
 if request.vars.tag_name:
   
   if form.accepts(request.vars, session):
        ...
 return dict(form=form, captcha = captcha)

 view tag.html:
 {{=form.custom.begin}}
 ...
 {{=captcha}}
 {{=form.custom.end}}
 {{pass}}

 view default.html:
 LOAD('default','tag',args=(table_name,record_id),ajax=True) - does
 not work

 but with
 LOAD('default','tag',args=(table_name,record_id))
 at least the page loads

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: recaptcha in LOAD not working

2010-04-05 Thread Thadeus Burgess
Maybe the web2py_ajax_trap can have a write-through put in so it will
not intercept communications for recaptcha?

-Thadeus





On Mon, Apr 5, 2010 at 5:28 PM, selecta gr...@delarue-berlin.de wrote:
 tnx Thadeus

 just found http://recaptcha.net/apidocs/captcha/client.html
 reCAPTCHA AJAX API

 will read into it 2morrow
 would be nice if recaptcha works with web2pys ajax things by default

 On Apr 6, 12:10 am, Thadeus Burgess thade...@thadeusb.com wrote:
 It is because recaptcha uses ajax to communicate, and when using LOAD
 web2py traps all ajax calls, so the recaptcha requests are not making
 it to the server.

 -Thadeus



 On Mon, Apr 5, 2010 at 5:05 PM, selecta gr...@delarue-berlin.de wrote:
  I tried to use Recaptcha in a LOAD div but I does not work

  The problem is that the page stats reloading when it gets to the div
  loaded with LOAD where the recaptcha javascripts are in and gets stuck
  on reloading it

  controller:
  ...
  form = SQLFORM.factory(Field('tag_name'))
  captcha = None
  if not auth.user:
     captcha = Recaptcha(request,'xxx','xxx')
     form[0].append(captcha)
  if request.vars.tag_name:
    
    if form.accepts(request.vars, session):
         ...
  return dict(form=form, captcha = captcha)

  view tag.html:
  {{=form.custom.begin}}
  ...
  {{=captcha}}
  {{=form.custom.end}}
  {{pass}}

  view default.html:
  LOAD('default','tag',args=(table_name,record_id),ajax=True) - does
  not work

  but with
  LOAD('default','tag',args=(table_name,record_id))
  at least the page loads

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Rows don't serialize well if unicode in _extra

2010-04-05 Thread Thadeus Burgess
When dealing with 1 table, names are short names

When dealing with multiple tables, all names are fully qualified.

-Thadeus





On Mon, Apr 5, 2010 at 8:22 PM, fgpy franck...@gmail.com wrote:
 More details here:

 I have 2 tables: shop (2 fields) and enquete (18 fields).

 I use an inner join like the one bellow.
 'shop.shop_code' is what I call a fully qualified name
 'hht_q_1' is what I call a short name. All those names end to be in
 _extra and as they contain some unicode, the __str__ method of Rows
 fails.

 Putting 'enquete' in front of all the names makes the code less
 readable, therefore using short names linking to the colums returned
 by the inner join.

    rows = db(db.enquete.shop_code==db.shop.shop_code).select(
                'shop.shop_code', 'shop.shop_name',
                'hht_q_1', 'hht_q_2', 'hht_q_3', 'hht_q_4', 'hht_q_5',
                'hht_q_6', 'hht_q_7', 'hht_q_8', 'hht_q_9',
                'pc_q_1', 'pc_q_2', 'pc_q_3', 'pc_q_4', 'pc_q_5',
                'pc_q_6',  'pc_q_7',
                )

 Please advise.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Friendly URLs

2010-04-04 Thread Thadeus Burgess
Francisco,

Take a look at some other existing blog examples.

mengu's blog - http://github.com/mengu/blog
currently running on mengu.net

thadeus blogitizor - http://code.google.com/p/blogitizor/
currently running on thadeusb.com

-Thadeus





On Sun, Apr 4, 2010 at 12:03 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 that is a very old app. I needs some work.

 On Apr 4, 10:16 am, Francisco Costa m...@franciscocosta.com wrote:
 Hello!
 I've installed WordpressClonehttp://web2py.com/appliances/default/show/36
 and i would like to have each post with a friendly url
 instead ofhttp://domain/blog/default/post/7have something 
 likehttp://domain/welcome-to-pypress/

 Thank you

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] How to use virtualfields?

2010-04-04 Thread Thadeus Burgess
I think its

db.table.virtualfields.append()

-Thadeus





On Sun, Apr 4, 2010 at 10:51 PM, Iceberg iceb...@21cn.com wrote:
 Hi there,

 I search virtualfields in http://www.web2py.com/book but found
 nothing.

 So I read this post instead:   
 https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6d836?tvc=1

 But I found that
  db.table.virtualfields.add(ComputedFields())
 doesn't work.

 Only this work:
  rows.setvirtualfields(table=ComputedFields())

 Does the former syntax really supposed to exist?

 I am using web2py 1.75.4

 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 web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] failed to seek; server does not accept Range HTTP header

2010-04-02 Thread Thadeus Burgess
I have a controller as follows

def stream():
   id = request.args(0)
   record = db.items[id]

   if record:
  return response.stream(record.filepath)
   else:
  return False

When playing in Totem Media Player, the files play, but when
attempting to seek ahead in the song it receives this error.

http://127.0.0.1:8000/muzik/default/stream/228: failed to seek;
server does not accept Range HTTP header

However, when playing the same file in VLC, I am able to seek.

Any help to make it work for Totem?

Totem: 0
VLC: 100 + 1

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: psycopg2 problem

2010-04-02 Thread Thadeus Burgess
Yay!

I have seen this happen before when attempting to switch between
easy_install and apt-get... egg files get left around, or easy_install
creates an egg and apt-get just installs source... so you end up with
two places and things get confused.

-Thadeus





On Fri, Apr 2, 2010 at 5:08 AM, Richie richie.d...@googlemail.com wrote:
 I love you! Uninstall, reinstall, restart apache, worked a charm.
 Would love you know what the probem was, but at least it's fixed now!

 Thank you all for your input, I'm sure I'll be back with more problems
 soon, this group is great!

 On Apr 2, 4:07 am, Thadeus Burgess thade...@thadeusb.com wrote:
 It still must be a problem with the site-packages.

 And I wonder if it has something to do with the fact you had
 problems with easy_install.

 I would try

 apt-get remove python-psycopg2

 then look in your site-packages, make sure to remove ALL instances of
 psycopg2 egg or src files. Also check your local user instance of
 python modules.

 Then once you are sure its clean, attempt to reinstall with apt-get.

 -Thadeus

 On Thu, Apr 1, 2010 at 8:50 PM, Richie richie.d...@googlemail.com wrote:
  Yeah, it's all spelled fine (not like I typed it there, sorry!) and
  the database exists. Obviously if web2py was connecting to PostgreSQL
  it would give a database not found or a cannot write to database
  error or something, not a python cannot find psycopg2 module.

  I think now that the question that needs answering is why can't WSGI
  web2py see psycop2 even though terminal web2py can...? I'm not gonna
  say BUG, but I can't work out what Im doing wrong!

  On Apr 2, 1:40 am, Yarko Tymciurak resultsinsoftw...@gmail.com
  wrote:
  On Apr 1, 4:40 pm, Richie richie.d...@googlemail.com wrote:

   From command line python db = DAL('postgres://posttg...@localhost:
   5432/appdb') gives a FATAL:  no pg_hba.conf entry for host
   127.0.0.1, user postgres, database appdb, SSL off but this is a
   different issue that I can sort out later! It is still accessing that
   postgres server to get that error, which web2py isn't.

  A really basic check:  have you created the database, appdb, and
  given it no-password rights to user posttgres (? is that use spelled
  correctly???) for at least read and modify?

  - Yarko

   import psycopg2 works perfectly.

   Seems like web2py's dal.py module cannot find psycop2 even though
   command line python can, but I have no idea why. Path probs? I'm
   clueless!

   On Apr 1, 9:55 pm, Thadeus Burgess thade...@thadeusb.com wrote:

And to triple make sure... from the shell printing sys.version gives
exactly the same, date, revision, GCC version ?

mod_wsgi was compiled with the same version of python installed?

So just to make sure you only get the GlobalName when you access
web2py through mod_wsgi ?

tburg...@***-dev:~/Applications/web2py$ python web2py.py -S welcome

 db = DAL('postgres://user:p...@localhost:1234/database')

Correct?

and

tburg...@***-dev:~/Applications/web2py$ python

 import psycopg2

-Thadeus

On Thu, Apr 1, 2010 at 2:46 PM, Richie richie.d...@googlemail.com 
wrote:
 Worked fine..

 2.5.2 (r252:60911, Jan 20 2010, 23:30:56)
 [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]

 Same version!

 Extra confused now...

 On Apr 1, 9:42 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 So mod_wsgi will not let you print, try this (before your 
 db=DAL(...) statement)

 import sys

 tmp_file = open('/path/to/a/writable/file.txt', 'w')
 tmp_file.write(sys.version)
 tmp_file.close()

 db = DAL(...)

 Try and access default controller (you will get an error, but now 
 we
 have a file) Open up the file, and make sure the version 
 corresponds
 to the one your shell is using.

 Probably not the most elegant way, but its quick.

 -Thadeus

 On Thu, Apr 1, 2010 at 2:39 PM, Richie 
 richie.d...@googlemail.com wrote:
  @Thadeus

  Statement 1 it is. How do I check the version mod_wsgi is using?

  I really appreciate the help!

  On Apr 1, 9:22 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  We are confused.

  1) He said he gets the error when I try to access default 
  controller.

  2) He did not say I try to access psycopg2 from my controller.

  I take what he said to mean (statement 1) he cannot connect to
  postgres with web2py. Perhaps he really ment statement 2, in 
  which you
  are correct.

  -Thadeus

  On Thu, Apr 1, 2010 at 2:16 PM, Yarko Tymciurak

  resultsinsoftw...@gmail.com wrote:
   On Apr 1, 3:12 pm, Thadeus Burgess thade...@thadeusb.com 
   wrote:
   Make sure mod_wsgi is running the same version of python 
   that you have
   psycopg2 installed.

   that is not the point / problem here;

   anyway,  python web2py.py -S welcome, and an attempt to 
   import
   psycopg2 from that shell

Re: [web2py] Re: failed to seek; server does not accept Range HTTP header

2010-04-02 Thread Thadeus Burgess
2.28.2

So it is a Totem issue and not a setting in Rocket?

If so, that is fine by me.

-Thadeus





On Fri, Apr 2, 2010 at 6:54 AM, mr.freeze nat...@freezable.com wrote:
 What version of Totem are you using? Looks like they fixed it by
 buffering the downloaded portion locally on 2.28 and after:

 https://bugzilla.gnome.org/show_bug.cgi?id=524771

 On Apr 2, 1:17 am, Thadeus Burgess thade...@thadeusb.com wrote:
 I have a controller as follows

 def stream():
    id = request.args(0)
    record = db.items[id]

    if record:
       return response.stream(record.filepath)
    else:
       return False

 When playing in Totem Media Player, the files play, but when
 attempting to seek ahead in the song it receives this error.

 http://127.0.0.1:8000/muzik/default/stream/228: failed to seek;
 server does not accept Range HTTP header

 However, when playing the same file in VLC, I am able to seek.

 Any help to make it work for Totem?

 Totem: 0
 VLC: 100 + 1

 -Thadeus

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2pyslices hacked or problem?

2010-04-02 Thread Thadeus Burgess
That is... odd!

Looks normal here.

-Thadeus





On Fri, Apr 2, 2010 at 3:09 PM, mr.freeze nat...@freezable.com wrote:
 A basketball player? Weird! Can you try clearing your browser cache to
 see if it goes away?

 On Apr 2, 3:39 pm, Frank thethinkbo...@gmail.com wrote:
 Frank thethinkbo...@... writes:

  I'm just curious and kindly want to remind logo problem at this moment, is 
  that
  a problem or website was hacked or website is supposed to do so?

  Frank

 very strange, this only happen in Firefox not in IE 8 and Chrome.my firefox 
 is
 3.6.2.
 I can not post picture in this list but logo is a basketball player now.
 is same problem from other people?

 Frank

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] number of queries in transaction

2010-04-02 Thread Thadeus Burgess
Is there any way to determine the number of queries pending in a
transaction (before db.commit())

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Fetching a single field from multiple rows in gluon.sql.Rows as a tuple/list?

2010-04-01 Thread Thadeus Burgess
``db().select(db.Record.Name)`` returns a rows object, which acts like a tuple.

-Thadeus





On Thu, Apr 1, 2010 at 5:06 AM, DenesL denes1...@yahoo.ca wrote:
 thelist=[row.Name for row in db().select(db.Record.Name)]

 On Apr 1, 1:41 am, Magnitus eric_vallee2...@yahoo.ca wrote:
 Hi,

 assuming that I have a Record table with a field called Name in
 the database (all also that there are a bunch of other fields for that
 table).

 Assume that I make the following query:

 Rows = db().select(db.Record.ALL)

 Is there a way to directly (with one line without having to iterate
 through each row and create the tuple/list manually) fetch the Name
 field for all the rows in a tuple/List?

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Proper handling of Undefined Record Exception in Reference Class

2010-04-01 Thread Thadeus Burgess
Somehow, I am getting the Undefined Record Exception being raised,
from line 1429 in sql.py.

When I comment out the exception, appadmin works just fine. It looks
as if the reference is an ID that does not exist in my table.

Somehow, the ID is 4057, when the highest ID in my table is only 4052,
any ideas on how this could have happened, or how to even fix this!?

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py forked

2010-04-01 Thread Thadeus Burgess
I prefer spoons.

-Thadeus





On Thu, Apr 1, 2010 at 9:44 AM, DenesL denes1...@yahoo.ca wrote:
 LOL

 On Apr 1, 9:39 am, mr.freeze nat...@freezable.com wrote:
 Just kidding! Happy April Fools Day!

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Proper handling of Undefined Record Exception in Reference Class

2010-04-01 Thread Thadeus Burgess
Yes but out of 4050 records, how do I determine the one record that
got borked, since obviously record 4057 does not exist. I have queried
reference fields and nothing refers to a record 4057 either.

p.s. this was with using sqlite browser

-Thadeus





On Thu, Apr 1, 2010 at 9:53 AM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 On Apr 1, 9:52 am, Thadeus Burgess thade...@thadeusb.com wrote:
 Somehow, I am getting the Undefined Record Exception being raised,
 from line 1429 in sql.py.

 When I comment out the exception, appadmin works just fine. It looks
 as if the reference is an ID that does not exist in my table.

 ...  implied: NOT a clean install


 Somehow, the ID is 4057, when the highest ID in my table is only 4052,
 any ideas on how this could have happened, or how to even fix this!?

 Guess: has to do with your table references

  for action in [debuggin, info]:   provide action

 ;-)

 - Yarko

 -Thadeus

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Fetching a single field from multiple rows in gluon.sql.Rows as a tuple/list?

2010-04-01 Thread Thadeus Burgess
This will embed a sub query and use belongs on it.

db((db.Record.Group_id == ID) 
(db.Record.Name.belongs(db(db.Record.BloodType ==
'O-')._select(.count()

Alternatively for NOT

db((db.Record.Group_id == ID) 
(~db.Record.Name.belongs(db(db.Record.BloodType ==
'O-')._select(.count()

-Thadeus





On Thu, Apr 1, 2010 at 12:01 PM, Magnitus eric_vallee2...@yahoo.ca wrote:
 Thanks for both replies :).

 So, if ``db().select(db.Record.Name)``  acts like a tuple, then I can
 do something like this:

 Names_in_db = db().select(db.Record.Name)
 for Name in List_of_names:
    if Name in Names_in_db:
        #Update logic goes here
    else:
        #Insert logic goes here

 Also, I have another question:

 The belongs member function for DAL.Table.Field allows you to isolate
 rows for which a particular field is in a given set of values.

 Is there a short direct way to specify that you actually want to
 isolate the rows for which a particular field is in the complement of
 the set?

 Likes (for example... actually, its pretty much what I'm trying to do
 in my code):

 db(db.Record.Group_id==ID  (!
 db.Record.Name.belongs(List_of_names))).delete()

 Note: The above syntax is not correct and gives an error, but it
 illustrates what I'm trying to achieve.


 On Apr 1, 10:30 am, Thadeus Burgess thade...@thadeusb.com wrote:
 ``db().select(db.Record.Name)`` returns a rows object, which acts like a 
 tuple.

 -Thadeus

 On Thu, Apr 1, 2010 at 5:06 AM, DenesL denes1...@yahoo.ca wrote:
  thelist=[row.Name for row in db().select(db.Record.Name)]

  On Apr 1, 1:41 am, Magnitus eric_vallee2...@yahoo.ca wrote:
  Hi,

  assuming that I have a Record table with a field called Name in
  the database (all also that there are a bunch of other fields for that
  table).

  Assume that I make the following query:

  Rows = db().select(db.Record.ALL)

  Is there a way to directly (with one line without having to iterate
  through each row and create the tuple/list manually) fetch the Name
  field for all the rows in a tuple/List?

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] psycopg2 problem

2010-04-01 Thread Thadeus Burgess
Make sure mod_wsgi is running the same version of python that you have
psycopg2 installed.

-Thadeus





On Thu, Apr 1, 2010 at 1:48 PM, Richie richie.d...@googlemail.com wrote:
 I can import psycopg2 from a python shell, but I'm getting NameError:
 global name 'psycopg2' is not defined when I try to access my default
 controller. I'm setup with Apache and MOD WSGI. Anyone got any ideas?

 Thanks!

 Rich

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: psycopg2 problem

2010-04-01 Thread Thadeus Burgess
We are confused.

1) He said he gets the error when I try to access default controller.

2) He did not say I try to access psycopg2 from my controller.

I take what he said to mean (statement 1) he cannot connect to
postgres with web2py. Perhaps he really ment statement 2, in which you
are correct.

-Thadeus





On Thu, Apr 1, 2010 at 2:16 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 On Apr 1, 3:12 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Make sure mod_wsgi is running the same version of python that you have
 psycopg2 installed.

 that is not the point / problem here;

 anyway,  python web2py.py -S welcome, and an attempt to import
 psycopg2 from that shell will show that you can import it fine from
 the web2py app level;   gluon.dal imports it, and your app doesn't get
 to see it for a reason.


 -Thadeus

 On Thu, Apr 1, 2010 at 1:48 PM, Richie richie.d...@googlemail.com wrote:
  I can import psycopg2 from a python shell, but I'm getting NameError:
  global name 'psycopg2' is not defined when I try to access my default
  controller. I'm setup with Apache and MOD WSGI. Anyone got any ideas?

  Thanks!

  Rich

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: new SQLFORM

2010-04-01 Thread Thadeus Burgess
So why formstyle instead of

form.as_div()
or
form.as_ul()

??

-Thadeus





On Wed, Mar 24, 2010 at 8:18 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Thank you!

 On Mar 24, 8:21 pm, Jose jjac...@gmail.com wrote:
 I sent a patch to Massimo

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: psycopg2 problem

2010-04-01 Thread Thadeus Burgess
So mod_wsgi will not let you print, try this (before your db=DAL(...) statement)

import sys

tmp_file = open('/path/to/a/writable/file.txt', 'w')
tmp_file.write(sys.version)
tmp_file.close()

db = DAL(...)

Try and access default controller (you will get an error, but now we
have a file) Open up the file, and make sure the version corresponds
to the one your shell is using.

Probably not the most elegant way, but its quick.

-Thadeus





On Thu, Apr 1, 2010 at 2:39 PM, Richie richie.d...@googlemail.com wrote:
 @Thadeus

 Statement 1 it is. How do I check the version mod_wsgi is using?

 I really appreciate the help!

 On Apr 1, 9:22 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 We are confused.

 1) He said he gets the error when I try to access default controller.

 2) He did not say I try to access psycopg2 from my controller.

 I take what he said to mean (statement 1) he cannot connect to
 postgres with web2py. Perhaps he really ment statement 2, in which you
 are correct.

 -Thadeus

 On Thu, Apr 1, 2010 at 2:16 PM, Yarko Tymciurak

 resultsinsoftw...@gmail.com wrote:
  On Apr 1, 3:12 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Make sure mod_wsgi is running the same version of python that you have
  psycopg2 installed.

  that is not the point / problem here;

  anyway,  python web2py.py -S welcome, and an attempt to import
  psycopg2 from that shell will show that you can import it fine from
  the web2py app level;   gluon.dal imports it, and your app doesn't get
  to see it for a reason.

  -Thadeus

  On Thu, Apr 1, 2010 at 1:48 PM, Richie richie.d...@googlemail.com wrote:
   I can import psycopg2 from a python shell, but I'm getting NameError:
   global name 'psycopg2' is not defined when I try to access my default
   controller. I'm setup with Apache and MOD WSGI. Anyone got any ideas?

   Thanks!

   Rich

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

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Using Ajax to display detail from a list

2010-04-01 Thread Thadeus Burgess
I usually do something similar.

Even to the extreme of my td have an extra column.

So My id usually looks like

id=tablename_recordid_column

And in my controllers I parse this as

tablename, record_id, column = request.vars.id.split('_')

-Thadeus





On Thu, Apr 1, 2010 at 2:24 PM, Keith Edmunds k...@midnighthax.com wrote:
 What I want to do: have a list of items displayed; when one is clicked,
 more detail is shown (via an Ajax call) in a defined detail area.

 Problem: the web2py ajax call takes three parameters: a controller action,
 one or more field ids, and a target DIV. My controller action needs to
 identify which row has been clicked on, so I need a hidden field per row
 that holds the row number. Because all field ids need to be unique, I
 actually have to build a dynamic name for the row id (eg,
 id=row_{{=row.number}}, name=row_{{=row.number}}), and - even worse - my
 controller action doesn't know the name of the field passed, so it has to
 parse response.vars to find it.

 Web2py and Python in general are so well architected that I know there
 must be a better way. Could someone point it out, please?

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: psycopg2 problem

2010-04-01 Thread Thadeus Burgess
And to triple make sure... from the shell printing sys.version gives
exactly the same, date, revision, GCC version ?

mod_wsgi was compiled with the same version of python installed?

So just to make sure you only get the GlobalName when you access
web2py through mod_wsgi ?

tburg...@***-dev:~/Applications/web2py$ python web2py.py -S welcome
 db = DAL('postgres://user:p...@localhost:1234/database')


Correct?

and

tburg...@***-dev:~/Applications/web2py$ python
 import psycopg2


-Thadeus





On Thu, Apr 1, 2010 at 2:46 PM, Richie richie.d...@googlemail.com wrote:
 Worked fine..

 2.5.2 (r252:60911, Jan 20 2010, 23:30:56)
 [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]

 Same version!

 Extra confused now...

 On Apr 1, 9:42 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 So mod_wsgi will not let you print, try this (before your db=DAL(...) 
 statement)

 import sys

 tmp_file = open('/path/to/a/writable/file.txt', 'w')
 tmp_file.write(sys.version)
 tmp_file.close()

 db = DAL(...)

 Try and access default controller (you will get an error, but now we
 have a file) Open up the file, and make sure the version corresponds
 to the one your shell is using.

 Probably not the most elegant way, but its quick.

 -Thadeus

 On Thu, Apr 1, 2010 at 2:39 PM, Richie richie.d...@googlemail.com wrote:
  @Thadeus

  Statement 1 it is. How do I check the version mod_wsgi is using?

  I really appreciate the help!

  On Apr 1, 9:22 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  We are confused.

  1) He said he gets the error when I try to access default controller.

  2) He did not say I try to access psycopg2 from my controller.

  I take what he said to mean (statement 1) he cannot connect to
  postgres with web2py. Perhaps he really ment statement 2, in which you
  are correct.

  -Thadeus

  On Thu, Apr 1, 2010 at 2:16 PM, Yarko Tymciurak

  resultsinsoftw...@gmail.com wrote:
   On Apr 1, 3:12 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Make sure mod_wsgi is running the same version of python that you have
   psycopg2 installed.

   that is not the point / problem here;

   anyway,  python web2py.py -S welcome, and an attempt to import
   psycopg2 from that shell will show that you can import it fine from
   the web2py app level;   gluon.dal imports it, and your app doesn't get
   to see it for a reason.

   -Thadeus

   On Thu, Apr 1, 2010 at 1:48 PM, Richie richie.d...@googlemail.com 
   wrote:
I can import psycopg2 from a python shell, but I'm getting 
NameError:
global name 'psycopg2' is not defined when I try to access my 
default
controller. I'm setup with Apache and MOD WSGI. Anyone got any ideas?

Thanks!

Rich

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

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

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Validation per object

2010-04-01 Thread Thadeus Burgess
I actually have an example for this kind of form.

Say I have two Records, Person 124 and Person 532.

Well come to find out, record 124 and 532 are the exact same person
who signed up twice.

I want to merge the two records together and leave with just one, but
oh noes 532 has more up to date info than 124.

So I want to display both records, side by side, with some radio
buttons A and B for each record.

If the radio button has A as a value when it comes in, I take from
Record A( in this case, Person 124)., If the radio button has a value
of B, I take record 532.

So in this case, I cannot use SQLFORM (I could, but its much easier to
just use a manual form, and manually validate the request.vars)

-Thadeus





On Thu, Apr 1, 2010 at 6:34 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 On Apr 1, 5:04 pm, carlo syseng...@gmail.com wrote:
 sorry for this out of sync answer but though I managed some tricks
 to tackle the (problem of) validation in pure html forms during these
 years, I would be curious about an answer to Mengu's request of
 showing how to make validation with manual forms.

 When I need to do this, I do it with making a memory-based table, and
 SQLFORM or SQLFORM.factory, and do whatever validation I need.


 Sorry DenesL but you did not answer the question as you supposed a
 model in place, so I would really appreciate a simple html form which
 preserves validation. Thank you

 There is a fundamental fuzziness around this:   If you have manual
 forms without data persistence, what are you validating?  (and what
 can you not do by building up a simpel memory-db model, and validating
 transient data against that?)

 Second - if it is _really_ transient data that you are validation,
 then even memory db, per request, could get pretty heavy in terms of
 server load - why not do client-side validation?

 Either way, this begs the question:   why exactly this form of
 question?

 I want to know the reasons / situation / logic behind this specific
 (server-side, no data persistence, no temporary, memory model of the
 data)  request.

 As it stands, it seems to me to be missing some key information /
 motivations.

 Yarko

 carlo

 On 15 Mar, 21:09, DenesL denes1...@yahoo.ca wrote:

  On Mar 15, 6:28 am, Mengu whalb...@gmail.com wrote:

First of all, I am not sure what is the problem you are trying to
solve. Even if you havecustomformsand you build all the form html
manually you can still use the existing validation mechanism.

   I don't want to use crud or sqlform or any html helper. i build my
  formsmanually. and actually if you show me how to make validation
   with manualforms, it would be good.

  You could set the error messages in the requires

  db.users.name.requires = IS_NOT_EMPTY(error_message = Please enter
  your name)
  db.users.email.requires = [
    IS_EMAIL(error_message=Given e-mail is not a valid one.),
    IS_NOT_IN_DB(db,'users.email',error_message=Sorry, this e-mail
  already exists in our database)
  ]

  create your form with the same field names and to check them do

  for n,v in request.vars.items():
    rr=db.users[n].requires
    if isinstance(rr,list):
      t,e=v,None
      for r in rr:
        t,e=r(t)
        if e: break
    else:
      t,e=rr(v)
    if e:
      form.errors[n]=e

  # here do whatever you need to do with form.errors

  Denes

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: psycopg2 problem

2010-04-01 Thread Thadeus Burgess
It still must be a problem with the site-packages.

And I wonder if it has something to do with the fact you had
problems with easy_install.

I would try

apt-get remove python-psycopg2

then look in your site-packages, make sure to remove ALL instances of
psycopg2 egg or src files. Also check your local user instance of
python modules.

Then once you are sure its clean, attempt to reinstall with apt-get.

-Thadeus





On Thu, Apr 1, 2010 at 8:50 PM, Richie richie.d...@googlemail.com wrote:
 Yeah, it's all spelled fine (not like I typed it there, sorry!) and
 the database exists. Obviously if web2py was connecting to PostgreSQL
 it would give a database not found or a cannot write to database
 error or something, not a python cannot find psycopg2 module.

 I think now that the question that needs answering is why can't WSGI
 web2py see psycop2 even though terminal web2py can...? I'm not gonna
 say BUG, but I can't work out what Im doing wrong!

 On Apr 2, 1:40 am, Yarko Tymciurak resultsinsoftw...@gmail.com
 wrote:
 On Apr 1, 4:40 pm, Richie richie.d...@googlemail.com wrote:

  From command line python db = DAL('postgres://posttg...@localhost:
  5432/appdb') gives a FATAL:  no pg_hba.conf entry for host
  127.0.0.1, user postgres, database appdb, SSL off but this is a
  different issue that I can sort out later! It is still accessing that
  postgres server to get that error, which web2py isn't.

 A really basic check:  have you created the database, appdb, and
 given it no-password rights to user posttgres (? is that use spelled
 correctly???) for at least read and modify?

 - Yarko



  import psycopg2 works perfectly.

  Seems like web2py's dal.py module cannot find psycop2 even though
  command line python can, but I have no idea why. Path probs? I'm
  clueless!

  On Apr 1, 9:55 pm, Thadeus Burgess thade...@thadeusb.com wrote:

   And to triple make sure... from the shell printing sys.version gives
   exactly the same, date, revision, GCC version ?

   mod_wsgi was compiled with the same version of python installed?

   So just to make sure you only get the GlobalName when you access
   web2py through mod_wsgi ?

   tburg...@***-dev:~/Applications/web2py$ python web2py.py -S welcome

db = DAL('postgres://user:p...@localhost:1234/database')

   Correct?

   and

   tburg...@***-dev:~/Applications/web2py$ python

import psycopg2

   -Thadeus

   On Thu, Apr 1, 2010 at 2:46 PM, Richie richie.d...@googlemail.com 
   wrote:
Worked fine..

2.5.2 (r252:60911, Jan 20 2010, 23:30:56)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)]

Same version!

Extra confused now...

On Apr 1, 9:42 pm, Thadeus Burgess thade...@thadeusb.com wrote:
So mod_wsgi will not let you print, try this (before your db=DAL(...) 
statement)

import sys

tmp_file = open('/path/to/a/writable/file.txt', 'w')
tmp_file.write(sys.version)
tmp_file.close()

db = DAL(...)

Try and access default controller (you will get an error, but now we
have a file) Open up the file, and make sure the version corresponds
to the one your shell is using.

Probably not the most elegant way, but its quick.

-Thadeus

On Thu, Apr 1, 2010 at 2:39 PM, Richie richie.d...@googlemail.com 
wrote:
 @Thadeus

 Statement 1 it is. How do I check the version mod_wsgi is using?

 I really appreciate the help!

 On Apr 1, 9:22 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 We are confused.

 1) He said he gets the error when I try to access default 
 controller.

 2) He did not say I try to access psycopg2 from my controller.

 I take what he said to mean (statement 1) he cannot connect to
 postgres with web2py. Perhaps he really ment statement 2, in which 
 you
 are correct.

 -Thadeus

 On Thu, Apr 1, 2010 at 2:16 PM, Yarko Tymciurak

 resultsinsoftw...@gmail.com wrote:
  On Apr 1, 3:12 pm, Thadeus Burgess thade...@thadeusb.com wrote:
  Make sure mod_wsgi is running the same version of python that 
  you have
  psycopg2 installed.

  that is not the point / problem here;

  anyway,  python web2py.py -S welcome, and an attempt to import
  psycopg2 from that shell will show that you can import it fine 
  from
  the web2py app level;   gluon.dal imports it, and your app 
  doesn't get
  to see it for a reason.

  -Thadeus

  On Thu, Apr 1, 2010 at 1:48 PM, Richie 
  richie.d...@googlemail.com wrote:
   I can import psycopg2 from a python shell, but I'm getting 
   NameError:
   global name 'psycopg2' is not defined when I try to access 
   my default
   controller. I'm setup with Apache and MOD WSGI. Anyone got 
   any ideas?

   Thanks!

   Rich

   --
   You received this message because you are subscribed to the 
   Google Groups web2py-users group.
   To post to this group, send email to web...@googlegroups.com.
   To unsubscribe

[web2py] session secure

2010-03-31 Thread Thadeus Burgess
Odd, we don't have a

session.is_secure()

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: session secure

2010-03-31 Thread Thadeus Burgess
return

self._secure

-Thadeus





On Wed, Mar 31, 2010 at 12:27 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 What would it do?

 Massimo

 On Mar 31, 12:11 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Odd, we don't have a

 session.is_secure()

 -Thadeus

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-30 Thread Thadeus Burgess
Here are the results from two sources, A) The survey, and B) Listing
of community members speaking for one or the other.

A) Survey - 12 Responses ( No way to determine if anybody spammed responses )

There are no significant differences in usage scales, the hypothesis
is that it only matters for the kind of form, so 50% of the time
they are changing it one way or the other.

Preferences are split 50/50 for zero=None and zero=.

https://spreadsheets.google.com/ccc?key=0AstNNXQhkjU-dE9jS1VHSWdyd08xX2x6NU0yaEs1cnchl=en

B) Community Members

I have attached a OpenOffice document containing two columns. The
first column is of community members
speaking for zero=None as the default, along with the date and time.
This does not include any of my posts, though
I am a strong advocate of zero=None. The second column is of community
members arguing for zero=.

This is the general synopsis.

For Zero=

Having zero=None represents a usability issue, assume the average user
is lazy(stupid) and provide a default
that does not validate, this is to keep them from accidentally
submitting a valid option they did not want.

For Zero=None

Change back to zero=None so old apps act the same, or they want it to
display without the blank option.
The blank option gives values that does not validate. It makes logical
sense to only have values
in the dropdown that validate. zero is an EXTRA feature and should be
turned on EXPLICITLY when needed
instead of turned OFF when not needed.

-Thadeus





On Thu, Mar 25, 2010 at 1:03 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 Hi Thadeus.

 You have two objections. One is procedural and one is more
 substantial.

 Procedurally, I can add any feature I consider appropriate. It has
 happened before. It will happen again. In practice, it is my interest
 to keep users happy and in particular other contributors, so if I feel
 something is contentious, I do ask for people opinion. It have done so
 and I will continue to do so. And if I do not ask, you can bring it
 up. And you did well to bring this up.

 Now to the substantial objection. The change in question was made
 because I thought it was a good one (and I still think so), because it
 did not break backward compatibility (no application broke, it just
 caused more error messages when users failed to select a value in
 dropbox).

 Moreover at the time I did not think it was not going to be so
 contentious. I am not yet even sure it is contentious now, that is
 what you have to prove with the poll.

 Changing it back is more problematic because it will cause users to
 accidentally submit forms with default options chosen by the browser
 instead of chosen by the programmer or the user (if no default=... is
 set, the browser will automatically select the first item in the
 options). In my view that is bad software design so it shoud stay as
 it is.

 There a number resources on the web that give practial
 recommendations. For example http://www.cs.tut.fi/~jkorpela/forms/choices.html
 says For a normal 1-of-many selection (apart from the two preceding
 cases), use either a SELECT element  or a set of radio buttons. In
 both cases, make sure a well-defined default is initially selected.
 zero='' provides that option for create forms.

 Nevertheless, I do accept the possibility that I am wrong. I have been
 wrong before. Yet you have to prove to me that I am wrong. I
 understand your case and that is not sufficient. I need to know that a
 good majority of the people think that this should be reverted.

 For me, backward compatibility means that we do not introduce changes
 that break web2py APIs as documented in published book. For example I
 have said over and over that the new DAL may break SQLCustomType
 because will hopefully provide a better mechanism.

 So let me add something new to the discussion:

 You mentioned difficulty in changing back the behavior of your apps.
 Here is a simple solution for that. In your db.py, before you use
 IS_IN_DB:

 IS_IN_DB2 = IS_IN_DB
 def IS_IN_DB(*a,**b):
     b['zero']=None
     return IS_IN_DB2(*a,**b)

 (and same for IS_IN_SET). With this piece of code your apps will
 behave as if this change was never introduced and you will not need to
 edit it.
 People who like a message can do:

 IS_IN_DB2 = IS_IN_DB
 def IS_IN_DB(*a,**b):
     b['zero']=T('please choose one')
     return IS_IN_DB2(*a,**b)

 Anyway. I really think the poll should have a deadline. How many votes
 do you have so far? When are you planning to close it?

 Massimo

 On Mar 24, 10:21 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I am not sure of the exact time frame that this was introduced
 (zero='', breaking backwards-compatibility) by it was only a matter of
 a couple of months ago, not a year. The exact date was 2010-01-03 of
 this change, 
 athttp://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/1497

 Should I point out that

 A) This was at a time when most who would have had input on this were
 on holiday break

Re: [web2py] Inserting into multiple related tables.

2010-03-30 Thread Thadeus Burgess
user_id = db.users.insert(.)
contact = db.contacts.insert(user = user_id, user_recording='/hi/')

So insert returns the id of the newly inserted record..

If you want the actual object of what you just inserted you need

user = db.user[db.users.insert(...)]

Now you can perform, user.update/user.update_record() etc etc.

-Thadeus





On Tue, Mar 30, 2010 at 12:09 PM, compassiontara t...@birl.org wrote:
 Perhaps I'm missing the obvious, but I can't figure out how to make
 this work:

 db.define_table('users',
        Field('phone','string',unique=True),
        Field('safe','boolean',default=False),
        Field('allow_le','boolean',default=False),
        Field('safe_time','datetime'),
        Field('finished','boolean'),
        Field('finished_time','datetime'),
        Field('start_time','datetime'),
 )
 db.define_table('contacts',
        Field('user',db.users),
        Field('phone','string'),
        Field('user_recording','string'),
        Field('called','boolean',default=False),
 )

 db.users.insert(phone='17125551212',safe_time=datetime.datetime.now()
 +3600)
 db.contacts.insert(user=user_id,user_recording='/var/sounds/
 blah.wav',phone='1551212')

 where the db.contacts insert needs the .id from the db.users.insert.
 I want both to be within a transaction, but because web2py does
 transactions and commits automatically at end, how would I make this
 happen?

 I understand I could do something insane like commit(), do a query to
 get the new ID record, and then do the insert for contacts, and then
 if that fails, go delete the record from users, but I'm hoping that
 there is a more humane way of doing this?

 With Love,
 Tara

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Feature request: xlstoweb2py [was: Where do you use web2py?]

2010-03-30 Thread Thadeus Burgess
Any status on xls2web2py?

-Thadeus





On Wed, Mar 17, 2010 at 9:38 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 The problem with appadmin is that it is designed for the administrator
 and has security issues. A user can execute any python code he/she
 wants in the query string. This is a feature because its use is
 supposed to be restricted to the administrator. Users have to be
 trusted to expose appadmin to them. It would be better to use
 something ike the jqGrid plugin.

 On Mar 17, 3:24 am, Thadeus Burgess thade...@thadeusb.com wrote:
 I had actually used appadmin in production for a particular database
 for several months. The users were the same as you are describing
 (end-user, used to excel).

 Now that it is time to give them the real app (as appadmin was just a
 quick get us up and running)... they are actually sad to see us stop
 using appadmin, they like it!

 I think you might be surprised at how easy appadmin is to grasp for
 those who deal with spreadsheets all day.

 -Thadeus

 On Wed, Mar 17, 2010 at 1:27 AM, Vincent Borghi

 vincent.borgh...@gmail.com wrote:
  On Tue, Mar 16, 2010 at 4:11 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  I think what Vincent is asking is not so much importing capability but
  an interface that can read an excel file (or a csv file) asks you the
  names (guessing from the header) and types (guessing from data) of
  columns and then writes the model for you.

  yes Massimo

  Perhaps something that can
  deal with the case when the table is the result of a join. Then
  importing is a trivial step. We have that already

  In addition to data importation and code generation for the model,
  a key feature is to generate a user interface to the data.

  The default appadmin.py is OK for an administrator, but
  not so OK for an end-user who just wants to manage and share
  some data.
  Such end-users are most data owners than administartors.

  Ideally, the utility I am looking for will generate a nice user
  (viewers and data owners)
  interface, that the administrator (who is supposed to know python and
  more or less SQL)
  can customize/enhance.

  The end-users/data owners are not knowlegeable in SQL (they are
  used to excel tables, after all).
  Moreover they expect to have simple functionality
  to do base CRUD operations : Create, Read (browse, filter, sort, dump as 
  csv,
  paged or full datalist view in sortable table with choosable columns, 
  possibly
  customizing who has which acces rights, so on...), Update and Delete.

  Regards

  On Mar 16, 9:27 am, Dragonfyre13 dragonfyr...@gmail.com wrote:
  Well, my suggestion would be forget the XLS format for the first
  iteration. Use CSV. If you're not concerned with formulas, that's the
  cleanest route, and included in the default python install. (csv
  module). I use it all the time for my load test frameworks I build.

  It's not only very easy to use, but since it's VERY easy to export
  from excel, it shouldn't be much of a burden on the users. In a second
  iteration, if the license matches, you could do an import from xls
  format.

  On Mar 16, 8:03 am, mdipierro mdipie...@cs.depaul.edu wrote:

   This can be done. I need to check the licence of the xls readers.

   On Mar 16, 3:45 am, Vincent Borghi vincent.borgh...@gmail.com wrote:

Hello

I have used web2py to (quickly) implement a simple phone directory of
customer contacts,
for a small phone call center.
Before that, people tried to maintain their contact information in an
Excel spreadsheet
that was exchanged thru mail and/or a windows sharedc folder...

( Also note that I deal with two zope/plone sites, but I cannot 
(/don't want) to
fully understand all the stuff that has been added/changed with the
Plone 3 release
and soon the Plone 4 one -- too complicated for me.
However, as a CMS, Plone has advantages, and afaik there is nothing 
really
production-ready in the web2py world )

By the way:
Feature request: xlstoweb2py
===
For me, web2py could be the killer framework everywhere there are
simple xls Excel files
circulating among people who try to share and maintain information as
they can (and
they are numerous in many companies...).

In fact, in many cases, Excel sheets made by people involve no 
formula, but are
just tables of static data. To deal with this frequent use case, I am
looking for an
xlstoweb2py utility that would take an xls file as input, and would
automatically
convert the data to an sqlite database, would build a base web2py 
application
implementing CRUD features and perhaps some form of access control 
policy.
The base app would be possibly ready to use, but as the resulting 
code would be
 web2py- and python-based, it would be easy for a
developer/administrator (as me) to customize/enhance the generated 
app.

For me

[web2py] Stored Procedures DAL

2010-03-30 Thread Thadeus Burgess
Is it possible?

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Here's a theory question

2010-03-30 Thread Thadeus Burgess
How do you MVC a javascript client application?

So I have web2py acting as the server, and I write a Javascript GUI (based
off extjs or similar library).

So of course this goes in the View files... The interesting question is that
these client side js have their own MCV on top of that (models are your
JSONRPC, controllers to format data/communicate with server, and then view
code to generate/populate the html).

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Re: [web2py:38402] Re: SQLFORM without tables

2010-03-30 Thread Thadeus Burgess
Of course, the decoupling would require an entire re-write of how
validation/forms/filters are written...

See you explain this system that each part relies on another part
working a certain way... when I analyze this through my
programming filter to solve this problem this is what I see...

A class for filtering (parsing html values into python values)
A class for validation (validating already parsed data), this could be
used anywhere within web2py, even import_from_csv_file!
A class for data structure (just the data of a form, like a rows
object, and the types of data)
A class for representation (this will take a data structure, and parse
it into a representable format... like a form, or a table)

Each of these classes could use the others, but they don't rely on the
others you could use the filtering without validating the data...
or create a form that can validate, but doesn't represent itself.

-Thadeus





On Tue, Jan 5, 2010 at 7:18 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 way, I do think the current system can be improved and made more
 general. I do not see how this decoup

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Re: [web2py:38394] Re: SQLFORM without tables

2010-03-30 Thread Thadeus Burgess
I have about two or three pages in my saved drafts about this subject :)

I just havn't had the time to sit down and figure out a real workable
solution that can integrate into everything else web2py does.

Your right, the defaults are integrated into everything, everything
from default widgets set by the DAL/Fields so that a SQLFORM can
display them.

So the question is, what changes could be made to the DAL to separate
it from data representation.

-Thadeus





On Fri, Jan 8, 2010 at 10:55 AM, Alex Fanjul alex.fan...@gmail.com wrote:
 is is the most recurrent topic I think. It should be called Decoupled,
 Custom and Tableless Forms. I'd say it would involve lot of changes for
 default things that web2py does now very well, and that is the proble

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Re: [web2py:38474] Re: template, static files, routes.py

2010-03-30 Thread Thadeus Burgess
Alright, look at this example. helloworld always gets printed, the
function is not being redefined as expected. This is a simple example,
but in theory I would use this for say the websites sidebar not the
page title...

Any suggestions I have require changes to gluon and add support for blocks.

## layout.html
{{def title():}}
helloworld
{{pass}}

body
h1{{title()}}/h1
div id=content{{include}}/div
/body

## view.html
{{extend 'layout.html'}}

{{def title():}}
I Like Pie
{{pass}}

Hello, Did you know that I like Pie... also.. The Cake Is A Lie!

I expect my title to be I Like Pie... but really my title is helloworld

-Thadeus





On Wed, Jan 6, 2010 at 1:57 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Mind that if you have

 {{def a()}}hello{{return 'world'}}

 then

 {{a()}} prints renders as 'hello' but {{=a()}} renders as 'helloworld'

 Massimo

 On Jan 6, 1:07 pm, KMax mkostri...@gmail.com wrote:
 I just check layout.html and found there place for menu.
 So it should not be the issue to plase at layout.html code like
 {{=myhead()}} and only issue will be valid return of myhead().
 is it?
 On 6 янв, 21:36, mdipierro mdipie...@cs.depaul.edu wrote:

  Yes and no. the web2py template language is very different from
  Django's because everything inside {{...}} is pure python. This means
  there is no concept of blocks but in python you have function calls.

  You can do

  #based.html
  {{def something()}}text goes here{{return}}
  {{extend 'layout.html'}}
  Hello world

  #layout.html
  htmlbody
  h1{{something()}}h1
  {{include}}
  /body/html

  The def defines a funciton that you can use as a block.

  On Jan 6, 6:13 am, Sujan Shakya suzan.sha...@gmail.com wrote:

   I have some questions that I have not understood.

   In layout.html, I found only one {{include}}.
   Is it possible to use more {{include}} in layout.html so that we can
   achieve equivalent of the following:
   {% block head %}{% endblock %}
   {% block content %}{% endblock %}
   {% block col3 %}{% endblock %}

   How are the static files served in production servers? Are they served
   thru apache/lighttpd or web2py itself ?

   And why is it that the use of routes.py not preferred?

   Thanks.



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.





-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Here's a theory question

2010-03-30 Thread Thadeus Burgess
Aye, this I understand, but for every web2py view, you need a js
(model, view, controller). The question is how should these be
physically laid out while still keeping symbolism as they all are
apart of the same web2py view?

-Thadeus





On Tue, Mar 30, 2010 at 1:45 PM, Timothy Farrell tfarr...@swgen.com wrote:
 This is my best understanding (using ExtJS as an case-study):

 Models -- Stores (Generally these communicate with the server side)
 Views -- Layouts + Widgets (these generate and respond to events)
 Controllers -- Events that control interactions between widgets and stores

 Ext has simplified Models with its Ext.direct stuff.

 How's that?

 -tim

 On 3/30/2010 1:01 PM, Thadeus Burgess wrote:

 How do you MVC a javascript client application?

 So I have web2py acting as the server, and I write a Javascript GUI (based
 off extjs or similar library).

 So of course this goes in the View files... The interesting question is
 that these client side js have their own MCV on top of that (models are your
 JSONRPC, controllers to format data/communicate with server, and then view
 code to generate/populate the html).

 -Thadeus


 --
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To post to this group, send email to web...@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.

 --
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Here's a theory question

2010-03-30 Thread Thadeus Burgess
 If you are with me so far, then Thadeus's question sounds like where
 do I put the client-code, to keep it MVC-like in organization, to help
 me keep my sanity during development and revision

You hit the nail on the head.

In the simplest form of the issue.

To take an idea from gaming.

There are two parts, the gaming client, and game server.
The server handles all data storage/retrieval, it handles all logic
(damage calculations, position movement, unit spawns, chat logs).
The client takes data from the server (a list of all sprites) and
renders them, and allows you an interface to send the server input.
However the client has special logic to make sure your input matches
only that which makes sense to the games logic.

In this case, javascript is the game client, and web2py is the game server.

Javascripts job is to take data, format it in a pretty way, and
provide interfaces to allow for input that still adhears to the
business logic.

web2py handles the data storage/retrieval, and all logic
(calculations, accounts, appointments, contact history).

So here, what is returned as a web2py view is not really a view at
all, but a client side application that happens to be in javascript.

Now client side applications of any type (javascript, java swing,
tkinter, pygame) follow their own MVC conventions. Where your model
is the interface to communicate with the server, your view is the
presentation and input handling layer, and your controller handles
the transition from presentation to engineering layer.

Now we get into the grit of the issue. If web2py can only return one
view/.html file, how do I separate my javascript in such a way that
makes sense, so that it can all be streamed in one request by web2py,
but still communicate via ajax with web2py without refreshing the page
completely. So you end up with your view files actually being the
cilent application, and your server exposing services, where your
controllers response is now the view

-Thadeus





On Tue, Mar 30, 2010 at 4:16 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 On Mar 30, 1:01 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 How do you MVC a javascript client application?

 Here's the simple of it:

 An application is ... an application.

 Layered applications are partitioned into layers for (among other
 things)  a clean interface between layers.
 This is important for a couple of reasons, one of them being the
 ability to move where the network boundary is.

 In typical, plain web2py applications, the network boundary is placed
 at the junction between the controller and the view (the controller
 being server-side).

 Now - more generally, layered applications are a way of structuring
 your solution.

 I like the 4 layer model, as it is descriptive and usually brings home
 another point:

 Presentation:

 How you display things to the end users;  the problem is presented in
 a language describing the problem (and results) familiar to the end
 user, i.e. in the language of the problem domain.    Typically, this
 is NOT in terms of classes or function calls (that is the language
 of the presentation), but rather (for example) in terms of account
 status, or amount due, or things registered for.

 Corresponds closely to V from MVC terminology.

 Business Rules:
 This is the solution, in the language of the problem-domain, i.e. in a
 way the end-user would be able to understand.   Accounts are
 represented as accounts,  names as names, etc.   This is devoid of
 implementation logic (that is, there is nothing that says but you
 have to hold it this way for it to work in a python dict --- because
 a python dict has nothing to do with the end-user's problem domain).

 Engineering Rules:
 This is whatever logic you need to implement the Business rules, in
 the language needed to accomplish this in the technology in use.  For
 example,
 account_in_good_standing() - lets say this will be business-rule-like
 - would list things like:   account_exists(),
 account_positive_balance(), etc.   The engineering rules would
 implement   account_exists() logic as DAL validator statements
 (depends on table definitions - even if they are close to the
 business language),  perhaps queries.   Since another implementation
 might use sqalchemy rather than DAL, the Engineering rules (the way
 you would implement)  would differ for that system, BUT NOT the
 Business Rules.

 Together, Business Rule and Engineering Rule layers correspond to C
 from MVC.

 Data Persistence Layer:
 This is where sqalchemy, DAL,  data manipulation and storage code (and
 device and network layer drivers) would go.   db.define_table()  (and
 all it's contents) are here.   Even as you might be accustomed to
 seeing requires - standard statements in something like db.py, by
 this definition, those would only be standard validators required to
 ensure data consistency -- validators that belong in the Engineering
 Rule layer would appear elsewhere, strictly speaking

Re: [web2py] Re: zengarden anybody?

2010-03-29 Thread Thadeus Burgess
Remotely administer error tickets from your mobile phone!

-Thadeus





On Mon, Mar 29, 2010 at 8:12 AM, blackthorne francisco@gmail.com wrote:
 Hey!

 Nice to see this layout idea. I think I've suggested it a good while
 ago.
 One interesting thing about this approach is that you can also great
 different grades of complexity. E.g. if you want to create a
 minimalistic theme without images, and Tweets on the admin page you
 can simply hide those divs (in the CSS) and change whatever you need
 so that you can keep what you want while the html remains unmodified.
 Another interesting idea would be to create a mobile version so that
 you can administrate your framework remotely from your phone.

 Yes, I'm not just talking about the welcome.app but the admin too!

 Best Regards

 On Mar 29, 2:57 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
 wrote:
 Careful -

 HTML5 is behind schedule, and expected to reach standard stage in 2022
 (?!)...
 That milestone is more political than technical. It is expected a
 stable HTML5 technical spec way before.


 Hoewever, the new canvas element is supported already (so that flash /
 silverlight, etc. isn't needed) --- and IE-9 might even do will with
 this (the preview is out now - it seems pretty fast).

 I woulnd't worry about too much more than what everyone else is
 expecting in HTML-5:  the things browsers broadly support now, and are
 useful (i.e. the canvas element, and more solid svg support, among
 them).

 - Yarko

 On Mar 29, 7:38 am, Christopher Steel chris.st...@gmail.com wrote:



  Great!,

  I am going to do a little research and then put together some
  options / samples. Two other items I am going to look into (which are
  also suggested on the ez.css page) are html5 semantics and WAI ARIA
  landmark roles. Roles would require a code tweak or flag as some
  (most?)  validation sites do not support it yet, html5 I need to look
  into a bit more. html 5 is semantic and I am wondering if this could
  conflict with our current naming conventions, validation and so
  forth.

  Anyway it is a great opportunity to check all this stuff out and we
  could always we could offer some unsupported / off label options
  that give people more choice while maintaining our compatibility
  commitments first adopters in the main. For our organization WAI-ARIA
  landmarks is really important.

  Cheers,

  C.

  On 28 mar, 13:39, Yarko Tymciurak resultsinsoftw...@gmail.com wrote:

   A few points I would make (as I write this, I am aware this probably
   should be moved to the development list):

   -  ez.css is no more than a layout / framing convention;
      -  staying compatible is easy (and it provides simple layout
   control);
      -  it uses a useful convention of css class nameing, namely:  pkg-
   class,  e.g.:  ez-wr -
         - we should stick with that, ie. something like  w2p for all
   web2py named css classes and id selectors;
           - note: the major difference between
             - class selectors (.something) and
             - id selectors (#something) is id selectors can link to a
   part of a page, and javascript uses id selectors;

   I'm not sure specifically what Massimo meant by ez.css and jquery.ui
   naming conventions;  we should get specific about this.

   ez has the concept of
   - wrappers, (ez-wr, ez-mr)
   - style containers (i.e. layout containers)
   - content containers (i.e. ez-box)
   - sizing elements;

   and more...

   jquery has at least these conventions:
   -http://jqueryui.com/docs/Theming/API
   -http://wiki.jqueryui.com/Position

   Note that ThemeRoller is a way to apply to PARTS of a user layout,
   e.g.:

   - font settings;
   - corner radius;
   - header;
   - toolbar;
   - content;
   - clicables;
   - highlight;
   - errors;
   - modal;
   - drop shadoes;

   By combining ez (positioning) and jquery-ui (and staying consistent w/
   themeroller), we should be able to build-up a web2py-unique packaging,
   with potentially useful extensions (e.g. for form layout and theming).

   This seems, to me, to be a very promising direction.

   - Yarko
   Noteab

   On Mar 27, 7:44 pm, mdipierro mdipie...@cs.depaul.edu wrote:

I like the idea. It would be ideal if you could do it using ez.css and
jquery.ui naming conventions.

Massimo

On 27 Mar, 15:23, Christopher Steel chris.st...@gmail.com wrote:

 The Zengarden css code is not open source but we can easily create
 our own. I am just finishing up a css based theme for a client that
 uses div's and flow with a two columns (basically the same appearance
 as the current web2py default layout). I would be more than happy to
 create on using the current web2py names, images and so forth and can
 license it as we like.

 We could include it as a documented option and give it a name like
 base-2c-flow.css or base-tableless.css
 Let me know soon cause I am moving on to non css stuff in the next 
 few
 days.

   

Re: [web2py] Re: as_list returns an isoformated time as_dict returns a datetime.time?

2010-03-29 Thread Thadeus Burgess
I almost want to say that as long as it is still a python object it
should stay python objects.

That being said, we already have the datetime_to_str flag, leave the
defaults as they were if someone wants it differently they can alter
the flag.

-Thadeus





On Sun, Mar 28, 2010 at 10:09 AM, Iceberg iceb...@21cn.com wrote:
 Did not really try it yet, just look into the source code here [1]. So
 there are actually three relevant places:
  Row.as_dict(...,datetime_to_str=False) # was datetime_to_str=True
  Rows.as_dict(...,datetime_to_str=True) # did not change this time
  Rows.as_list(...,datetime_to_str=True) # did not change this time

 IMO, as long as:
  a. row.as_dict() is instead used internally (Well, Tito uses it
 anyway, but he is happy with the change.)
  b. Most people use Rows.as_dict() and Rows.as_list(), and their
 default datetime_to_str=True are not changed.

 then this modification is fine ... for me. I don't know what others
 think. Generally speaking, it is not a necessary change since users
 already has a datetime_to_str flag to toggle. So, count me neutral.

 Regards,
 Iceberg

 [1]:
 http://code.google.com/p/web2py/source/diff?spec=svn5beee338c7dfa1fdbf259f987f5a32460c02a553r=5beee338c7dfa1fdbf259f987f5a32460c02a553format=sidepath=/gluon/sql.py

 On Mar26, 7:21am, mdipierro mdipie...@cs.depaul.edu wrote:
 I just made some changes to sql.py in trunk that does what you say.
 The main purpose it for testing it and see what other people have to
 say.

 I have to changes:
 1) as_dict now behaves by default as as_list (i.e datetime is
 converted to string by default)
 2) when rows and records are stored in a session, datetime is NOT
 serialized into a string

 This may be seen by some as not backward compatible and this behavior
 was not documented anyway. Yet, I want to hear other people opinions
 and want if this breaks people applications.

 Massimo

 On Mar 25, 5:59 pm, Tito Garrido titogarr...@gmail.com wrote:



  What about as_dict(datetime_to_str=True)?

  On Thu, Mar 25, 2010 at 7:33 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   On a second though, this cannot be changed, because it will break web
   services example and therefore backward compatibility. @service.xmlrpc
   for example cannot serialize datetime.

   Anyway you can do

   ...select().as_list(datetime_to_str=False)

   On Mar 25, 4:58 pm, Tito Garrido titogarr...@gmail.com wrote:
I prefer the serialized data on as_dict result :)

On Thu, Mar 25, 2010 at 6:36 PM, mdipierro mdipie...@cs.depaul.edu
   wrote:
 That's how it is. There are historical reasons for it.

 select().as_dict(...) was designed to return a representation that
 could be serialized by simplejson and other serializers. simplejson
 cannot serialize date/datetime/time objects. This is no longer the
 case since I patched simplejson.

 row.as_dict() is instead used internally to compare two records.

 I think we can change one or the other and make them consistent. What
 do people think?

 Massimo

 On Mar 25, 4:29 pm, Tito Garrido titogarr...@gmail.com wrote:
  as_list on a select returns something like:

  [{'id': 11, 'time': '08:00:00'}]

  using as_dict on a record returns:

  [{'id': 11, 'horario': datetime.time(8, 0)}]

  Is that expected?

  Regards,

  Tito

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: as_list returns an isoformated time as_dict returns a datetime.time?

2010-03-29 Thread Thadeus Burgess
They should both operate the same in any case.

-Thadeus





On Mon, Mar 29, 2010 at 12:00 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 I almost want to say that as long as it is still a python object it
 should stay python objects.

 That being said, we already have the datetime_to_str flag, leave the
 defaults as they were if someone wants it differently they can alter
 the flag.

 -Thadeus





 On Sun, Mar 28, 2010 at 10:09 AM, Iceberg iceb...@21cn.com wrote:
 Did not really try it yet, just look into the source code here [1]. So
 there are actually three relevant places:
  Row.as_dict(...,datetime_to_str=False) # was datetime_to_str=True
  Rows.as_dict(...,datetime_to_str=True) # did not change this time
  Rows.as_list(...,datetime_to_str=True) # did not change this time

 IMO, as long as:
  a. row.as_dict() is instead used internally (Well, Tito uses it
 anyway, but he is happy with the change.)
  b. Most people use Rows.as_dict() and Rows.as_list(), and their
 default datetime_to_str=True are not changed.

 then this modification is fine ... for me. I don't know what others
 think. Generally speaking, it is not a necessary change since users
 already has a datetime_to_str flag to toggle. So, count me neutral.

 Regards,
 Iceberg

 [1]:
 http://code.google.com/p/web2py/source/diff?spec=svn5beee338c7dfa1fdbf259f987f5a32460c02a553r=5beee338c7dfa1fdbf259f987f5a32460c02a553format=sidepath=/gluon/sql.py

 On Mar26, 7:21am, mdipierro mdipie...@cs.depaul.edu wrote:
 I just made some changes to sql.py in trunk that does what you say.
 The main purpose it for testing it and see what other people have to
 say.

 I have to changes:
 1) as_dict now behaves by default as as_list (i.e datetime is
 converted to string by default)
 2) when rows and records are stored in a session, datetime is NOT
 serialized into a string

 This may be seen by some as not backward compatible and this behavior
 was not documented anyway. Yet, I want to hear other people opinions
 and want if this breaks people applications.

 Massimo

 On Mar 25, 5:59 pm, Tito Garrido titogarr...@gmail.com wrote:



  What about as_dict(datetime_to_str=True)?

  On Thu, Mar 25, 2010 at 7:33 PM, mdipierro mdipie...@cs.depaul.edu 
  wrote:
   On a second though, this cannot be changed, because it will break web
   services example and therefore backward compatibility. @service.xmlrpc
   for example cannot serialize datetime.

   Anyway you can do

   ...select().as_list(datetime_to_str=False)

   On Mar 25, 4:58 pm, Tito Garrido titogarr...@gmail.com wrote:
I prefer the serialized data on as_dict result :)

On Thu, Mar 25, 2010 at 6:36 PM, mdipierro mdipie...@cs.depaul.edu
   wrote:
 That's how it is. There are historical reasons for it.

 select().as_dict(...) was designed to return a representation that
 could be serialized by simplejson and other serializers. simplejson
 cannot serialize date/datetime/time objects. This is no longer the
 case since I patched simplejson.

 row.as_dict() is instead used internally to compare two records.

 I think we can change one or the other and make them consistent. 
 What
 do people think?

 Massimo

 On Mar 25, 4:29 pm, Tito Garrido titogarr...@gmail.com wrote:
  as_list on a select returns something like:

  [{'id': 11, 'time': '08:00:00'}]

  using as_dict on a record returns:

  [{'id': 11, 'horario': datetime.time(8, 0)}]

  Is that expected?

  Regards,

  Tito

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.




-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Running DAL oustide web2py

2010-03-29 Thread Thadeus Burgess
Alternatively if this is just a script (like cron) or a simple program
and you do not mind loading the entire web2py environment

python web2py.py -S welcome -M -R /path/to/my/script.py

-S denotes the app name, -M denotes execute models and -R is the path
to the script to execute in the environment, if you do not specify -R
then you get a python shell in the current environment.

Remember, you will always need to explicitly call db.commit() from scripts.

-Thadeus





On Mon, Mar 29, 2010 at 9:00 AM, rfx_labs l...@reproflex.de wrote:
 Hi Giovanni,

 I had the same problem and here is my simple solution:

 model.py:
 from gluon.dal import DAL, Field

 db = DAL(sqlite://storage.db)

 db.define_table(reference,
          Field(name, string, notnull=True),
          Field(L, double),
          Field(a, double),
          Field(b, double))

 myApp.py:
 from model import db

 rows = db().select(db.reference.ALL)

 for row in rows:
    print row.name, row.L, row.a, row.b, \n

 If you want to use a model file from a existing web2py application
 without adding the import statement (from gluon.dal import DAL,
 Field). You could import the model like this:

 model.py:
 db = DAL(sqlite://storage.db)

 db.define_table(reference,
          Field(name, string, notnull=True),
          Field(L, double),
          Field(a, double),
          Field(b, double))

 myApp.py:
 from gluon.dal import DAL, Field

 model = open(/Users/mhufsky/Desktop/model.py, rb)
 exec model
 model.close()

 rows = db().select(db.reference.ALL)

 for row in rows:
    print row.name, row.L, row.a, row.b, \n

 In my app I prefer the import method.

 Hint: To get same output you should first insert something to the db.
 Hint2: The db is stored in the working directory. You could specify a
 other folder relative to the working dir or absolute (starting
 with /):
 db = DAL(sqlite://storage.db, folder=/path/to/Folder)


 Martin

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: zengarden anybody?

2010-03-29 Thread Thadeus Burgess
I don't, but in any case its still a nice bargaining chip for a company iphone.

-Thadeus





On Mon, Mar 29, 2010 at 12:17 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:

 You get error tickets?  Really?!   ...     ;-)

 But, actually - it would be nice to get private tweets from sites you
 manage w/ links you could follow remotely if you wanted

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Custom 404 Pages

2010-03-29 Thread Thadeus Burgess
Now that you mention this, this is an issue. My google analytics on my
blog I have noticed lots of pages being request down the rabbit hole,
since I have the error redirecting.

Except for overriding the template in routes, not sure how to make it
look the same as the site.

-Thadeus





On Mon, Mar 29, 2010 at 1:36 PM, Chris crflei...@gmail.com wrote:
 Hi,
 Is there a way to override the template used by the error pages so
 that they match my site by extending the base template? I tried to use
 the routes_onerror in routes.py to redirect on error, however, this
 removes the proper status codes (400, 404 etc.) which the site should
 return.

 Chris

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] web2py.com down or something else?

2010-03-29 Thread Thadeus Burgess
It works for me.

-Thadeus





On Mon, Mar 29, 2010 at 2:03 PM, Feng huf...@gmail.com wrote:
 Hi, I started to learn and use web2py recently. It's a great web
 development framework, simple and easy to start.

 Though for me, starting from yesterday, web2py.com seems to be down on
 me.

 I read some past articles about filtering. So is it the site down or
 my ip is being blocked?

 Thanks!

 Feng

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] Re: Migration issue with appadmin

2010-03-28 Thread Thadeus Burgess
Here is the correct older appadmin.html

http://pastebin.com/FT632P1A

-Thadeus





On Sat, Mar 27, 2010 at 11:35 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 I just upgraded web2py, and have ran into an issue with web2py.

 Using an older version of appadmin, http://pastebin.com/jSnLT2Ua

 Traceback (most recent call last):
  File /home/thadeusb/web2py/gluon/restricted.py, line 173, in restricted
    exec ccode in environment
  File /home/thadeusb/web2py/applications/dolls/views/appadmin.html,
 line 68, in module
    {{fieldname=table._primarykey[0]}}
 IndexError: list index out of range

 Upgrading to the latest appadmin fixes this. http://pastebin.com/MFVvyXrW

 -Thadeus


-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Migration issue with appadmin

2010-03-28 Thread Thadeus Burgess
The check could be easy, just MD5 the file.

It shouldn't upgrade if the file doesn't exist either. However if you
are picking what to upgrade, I guess then it doesn't matter *unless
you forgot!*

I also would like a way to upgrade my web2py version without it
updating welcome and examples apps.

I was thinking, why was appadmin never made part of admin ?

-Thadeus





On Sun, Mar 28, 2010 at 9:53 AM, mr.freeze nat...@freezable.com wrote:
 What about just having another link in 'admin/default/site' ? :

 [ EDIT  | about  | errors  | clean  | pack all  | compile | uninstall
 | upgrade  ]

 It could take you to a page that lets you pick things to upgrade:
 appadmin.py
 appadmin.html
 web2py_ajax.html
 base.css
 jquery.js
 etc...

 You could even get fancy and detect if the files are different.


 On Mar 28, 10:23 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree. It could be done in two steps.

 1) when welcome.w2p is built also build web2py.plugin.appadmin.w2p
 which contains models/appadmin.html and views/appadmin.html

 2) upgrade whould be done by applying the plugin.

 Massimo

 On Mar 28, 9:59 am, mr.freeze nat...@freezable.com wrote:

  It might be nice to have an option in admin to 'upgrade' (copy over)
  appadmin.py and appadmin.html from welcome to your app.

  On Mar 28, 1:33 am, Thadeus Burgess thade...@thadeusb.com wrote:

   Here is the correct older appadmin.html

  http://pastebin.com/FT632P1A

   -Thadeus

   On Sat, Mar 27, 2010 at 11:35 PM, Thadeus Burgess 
   thade...@thadeusb.com wrote:
I just upgraded web2py, and have ran into an issue with web2py.

Using an older version of appadmin,http://pastebin.com/jSnLT2Ua

Traceback (most recent call last):
 File /home/thadeusb/web2py/gluon/restricted.py, line 173, in 
restricted
   exec ccode in environment
 File /home/thadeusb/web2py/applications/dolls/views/appadmin.html,
line 68, in module
   {{fieldname=table._primarykey[0]}}
IndexError: list index out of range

Upgrading to the latest appadmin fixes 
this.http://pastebin.com/MFVvyXrW

-Thadeus



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: new on web2pyslices: aggregate search

2010-03-28 Thread Thadeus Burgess
I have started storing most of those settings in the database,
everything except the DAL connection string goes into a table called
settings. I cache the select of the whole settings table
indefinitely unless a value changes. This allows me to version control
my application on google code (excluding the 0_config.py which only
contains the dal connection string) file without worries.

Nice find... Whoosh looks sweet!

-Thadeus





On Sun, Mar 28, 2010 at 12:53 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 On Mar 28, 1:27 pm, mr.freeze nat...@freezable.com wrote:
 C: Good idea, done.
 Q: Yes. I'll try to figure out a slick way to make the active source
 available at google code without exposing sensitive data.
 General Q: Haven't tried it but this looks 
 promising:http://bitbucket.org/mchaput/whoosh/wiki/Home

 :-)

 You're awesome, Nathan!
 I'll check out that link.

 Re: figure out:   In PyCOn registration, we put private data in models/
 0_private.py --- and I pushed a template version of this, where the
 settings would fail, i.e.:

 DAL_URI='put your db connection string here'

 I've just modified how I do that, to be more explicit for ordering of
 config - I no longer use 0.py --- but rather a scheme like this:

 0development_config.py

 --- for testing, local use;   basically, I (myself) set ONE variable
 here:   DEV_TEST  (for development and test);  if this file doesn't
 exist (it doesn't for deployment), my next file tests for the var, and
 sets it to FALSE if it doesn't exist.   Then, things like CAPTCHA and
 email for registration verification can use alternate logic based on
 setting of DEV_TEST  (this also makes for pretty readable code).

 1private_config.py

 That's all the stuff that I would not want to divulge.  Much like
 routes_example.py,   I have a '1example_private_config.py'  with all
 the strings that will fail if you don't set them for your site - it's
 a little bit of a trick to put example first in the name (e before
 p), but then you can copy this to 1private_config.py (and leave the
 example file), and configure your heart away - it will work (because
 of loading order); you will figure out to not use the example file in
 your deployment.

 The only thing I haven't figured out a nicer way of doing (and it
 needs to be in private_config) is this at the top of the private file

 try: DEV_TEST
 except: DEV_TEST=False

 It seems to be the only reliable way to do this (oh well - good
 enough, with caching).

 Then - what used to be 0.py (the config stuff, and app defs to run
 first - this is what Massimo likes to call it), I have named as:

 2config.py

 for no other reason than to control the ordering of this stuff.

 Hope that is helpful.

 Regards,
 - Yarko


 On Mar 28, 1:06 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
 wrote:

  Nice...   I did a test search on the recent question on
  reset_password_key --- I think this is going to be useful!

  2 q / 1 c:

  C:
  Maybe updating button texts would be nice (e.g.:  search web2py
  slices;    search web2py sites)

  Q:
  Are you going to update your slices source w2p at some point?

  General Q:
  Anyone have suggestions for intranet / private search engines of this
  sort (i.e. locally hosted)?

  Regards,
  - Yarko

  On Mar 27, 8:53 pm, mr.freeze nat...@freezable.com wrote:

   Also, if there are other sites that might be helpful to search, let me
   know. Feel free to visit any sponsored links too :)

   On Mar 27, 7:29 pm, mr.freeze nat...@freezable.com wrote:

In an effort to alleviate my own search frustrations, I have added a
google powered search to web2pyslices.com that searches these sites:

web2pyslices.com
web2py.com (including the wiki)
groups.google.com/group/web2py

Hopefully it will help people find answers quickly.

-Nathan

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] global name 'cx_Oracle' is not defined

2010-03-27 Thread Thadeus Burgess
I think that it means to run the source version of cx_oracle not the
binary version. This would entail downloading the source of cx_Oracle
and installing it into your python's site-packages.

-Thadeus





On Sat, Mar 27, 2010 at 10:51 AM, Jason Lotz jayl...@gmail.com wrote:
 I am trying to connect to an established oracle database. Working in
 Windows I downloaded and installed cx_Oracle. In the Python Shell I am
 able to make a connection.

 db = DAL('oracle://user/passw...@tns')
 Traceback (most recent call last):
   File  console, line 1, in module
   File  gluon/sql.py, line 3783, in DAL
   File  gluon/sql.py, line 966, in __init__
   File  gluon/sql.py, line 829, in _pool_connection
   File  gluon/sql.py, line 967, in lambda
 NameError: global name 'cx_Oracle' is not defined

 I read that I need to run web2py from the cx_oracle source. I'm not
 sure how to 'run from source'. Maybe there is someone that could point
 me in the right direction.


 Thnx,
 Jay

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: cache language files

2010-03-27 Thread Thadeus Burgess
If a language file gets updated, does the cache get cleared?

How long is the cache for, is this editable?

-Thadeus





On Sat, Mar 27, 2010 at 9:13 AM, David Zejda d...@atlas.cz wrote:
 Thanks :)

 I'll report if I find any troubles...

 D.

 On Mar 26, 6:21 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I changed this in trunk. The language files are now cached but please
 check that I did not not break them.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-24 Thread Thadeus Burgess
I am not sure of the exact time frame that this was introduced
(zero='', breaking backwards-compatibility) by it was only a matter of
a couple of months ago, not a year. The exact date was 2010-01-03 of
this change, at
http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/1497

Should I point out that

A) This was at a time when most who would have had input on this were
on holiday break, and
B) hardly enough time has passed for all community members to properly
test this and
C) I am unable to find a post about proposing the change from
zero=None to zero='choose a value'. I have searched my GMail archive,
as well as the online google groups, and have not found this
documented, I take this to mean it creeped in without community
approval.
 D) Must I must I must I resurrect the many posts about this? Massimo,
do a search for zero in the groups, read the posts there is ample
proof of zero=None being an issue.
E) There has been more arguments raised by the community against
zero='' than there has been for zero=''. Refer to item D for
statistics.
F) Must I also point out that this feature was added about a year ago,
and lived as zero=None for approx. 9 months before the change to
zero=''.

This is why the rapid release development of web2py is bad, we never
get a chance to test these features properly in many environments
before they are set in stone and made backwards compatible.

Perhaps there should be a time to live (TTL) for new features and
their default settings? If a new feature is implemented, put it on a 6
month TTL, if by the close of 6 months it has been stable, then add it
as part of the backwards compatibility agreement. This gives ample
time for testing by the whole of the community and all who use this
lovely framework, whilst still following a rapid-release cycle that
has been adopted.

* I am still waiting for a operation definition of backwards compatibility *

-Thadeus





On Wed, Mar 24, 2010 at 10:20 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 It is not that simple. zero='' was introduced about one year ago
 because of popular demand at the time and very few people spoke
 against it. If you change it now you revert to the behavior you had
 one year ago but most recent applications will change behavior.

 This consultation should have a deadline.

 Massimo

 On Mar 24, 9:43 am, Iceberg iceb...@21cn.com wrote:
 On Mar23, 2:29pm, weheh richard_gor...@verizon.net wrote:

  Thadeus, it's 6 of one, half-dozen of the other to me. I use both. So
  in theory, it doesn't really matter which is the default. Therefore, I
  prefer that the default remain whatever it currently is so that I
  don't have to change any of my code.

 To those who use either zero=None or zero='' fifty-fifty, or who
 always specify zero=something explicitly,

 Congratulations, because you are lucky enough that you don't need to
 care the vote result very much. However, in this case, it is not about
 what you choose, it is about what you believe.

 First of all, we should know that it was zero=None at the very
 beginning when this feature was invented. Somehow, later it changed to
 zero='' or zero='something else' back and forth.

 Now, do you believe, from the backward-compatible point of view, we
 should choose a default value which is compatible with the old
 versions even without zero=... being invented? If you do believe, you
 should choose zero=None.

 Do you believe, from a minimum-changing-code point of view, this
 efficiency appeal should not only apply for you, whom might
 coincidentally start using web2py after it is in zero!=None era, but
 also apply for all the developers whom already finish more or less
 legacy apps even before the zero=... was invented? If you do believe,
 you should choose zero=None.

 Do you believe, from a community point of view, we should not allow
 such a precedent that, an arguable and non-backward-compatible feature
 creep in, and then stay as-is just because it already happen anyway?
 That is not wise. If you do believe, you should choose zero=None.

 It is now! Let's just end the debate.
 I want you to 
 vote.http://www.collegelax.us/news/wp-content/uploads/2009/01/i-want-you-t...

 Sincerely,
 Iceberg

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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] For your knowledge

2010-03-24 Thread Thadeus Burgess
http://academicearth.org/courses/building-dynamic-websites

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: prepend a string to a field

2010-03-24 Thread Thadeus Burgess
hrm...

for row in db(db.person.id  0).select():
   row.update_record(name = row.name + x)

This also will work, although not as efficient since the processing
will be done in python and not the database.

-Thadeus





On Wed, Mar 24, 2010 at 11:10 PM, mr.freeze nat...@freezable.com wrote:
 This is ugly but should work:

 from gluon.sql import Expression
 db(db.person.id0).update(name = Expression('person.name || x'))

 I'm almost positive there is a better way.


 On Mar 24, 10:43 pm, Russell russell.mcmur...@gmail.com wrote:
 A bigger problem...

 On further testing, it looks like db(db.person.id0).update(name =
 db.person.name + x)  does NOT work.

 The DAL seems to treat this as an integer addition and the field is
 updated to 0 (at least on sqlite).

 On Mar 25, 4:11 pm, Russell russell.mcmur...@gmail.com wrote:

  Thanks very much for the reply.

  Sorry to say that it doesn't work.  Your answer gives this...
  UPDATE person SET name='xSUBSTR(person.name,1,(1 - 0))';

  On Mar 25, 3:58 pm, mr.freeze nat...@freezable.com wrote:

   Whoops, backwards:
   db(db.person.id0).update(name = %s%s % (x,db.person.name))

   On Mar 24, 9:57 pm, mr.freeze nat...@freezable.com wrote:

Try this:
db(db.person.id0).update(name = %s%s % (db.person.name,x))

On Mar 24, 9:52 pm, Russell russell.mcmur...@gmail.com wrote:

 Hi there,

 I'm trying to prepend a string to a field.  While, this works:

  db(db.person.id0).update(name = db.person.name + x)

 This does not:

  db(db.person.id0).update(name = x + db.person.name)

 Traceback (most recent call last):
   File string, line 1, in fragment
 TypeError: cannot concatenate 'str' and 'Expression' objects

 I have found a work-around, but it is pretty ugly:

  db(db.person.id0).update(name = db.person.name[0:0] + x + 
  db.person.name)

 Does anyone have a better solution?

 Thanks
 Russell



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-23 Thread Thadeus Burgess
weheh, Massimo,

The issue is the same for me, I have several web2py applications, each
commanding over 20 forms which make use of IS_IN_SET. I am dealing
with a sizable number of forms that I need to update just to fix this.
The fact is that web2py changed the output of how drop boxes are
rendered, and in turn it has broken my forms that relied on the first
element being selected.

Aside from the time to alter my forms, this is an issue of promise,
and principle that separate web2py from other python frameworks. To
take a few quotes and give my interpretations of them.

 Another feature of web2py, is that we, its developers, commit to
maintain backward compatibility in future versions. We have done so
since the first release of web2py in October, 2007. New features have
been added and bugs have been fixed, but if a program worked with
web2py 1.0, that program will still work today.  - Massimo Di
Pierro, Web2py Book, Chapter 1, Introduction

This is the kicker, my programs no longer work as intentionally
designed. Perhaps you should re-word this as will still
compile/execute/not crash instead of work.

web2py has never broken backwards compatibility, and it will not
break compatibility when additional functionality is added in the
future.  - Massimo Di Pierro, Web2py Book, Chapter 1.4, Why Web2py

The definition of compatibility is very loosely defined. This quote is
in response to the one made that web2py never controlled this before,
now it is. Regardless of if web2py controlled something previously or
not, it cannot change the compatibility with older versions.

Given the scope of the web2py applications that I develop, and the
sheer principle of the matter, do you understand where I am coming
from?

I seem to be left with the following options

A) Update my 100+ forms and set zero=None. I view this as a complete
waste of my time, either manually or working a search/replace and then
re-testing all of my forms.
B) Use a patched version of web2py that does what I want, zero=None.
This is not a desired option since keeping up with updates gets quite
complex when branching the codebase (DVCS or not). A continuous waste
of my time.
C) Re-define IS_IN_SET in one of my models, however since web2py now
assumes* requires, I need to make sure and define this for my foreign
key relationships, since sql.py uses the imported version of IS_IN_SET
instead of the global version.


* I could also make the same argument for this as it did change the
functionality of forms that used to render as text boxes but now
render as select since they are FK relationships.

-Thadeus





On Tue, Mar 23, 2010 at 1:29 AM, weheh richard_gor...@verizon.net wrote:
 Thadeus, it's 6 of one, half-dozen of the other to me. I use both. So
 in theory, it doesn't really matter which is the default. Therefore, I
 prefer that the default remain whatever it currently is so that I
 don't have to change any of my code.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Survey: Functionality of the Drop Boxes widget

2010-03-23 Thread Thadeus Burgess
It is not so trivial to search and replace. For one, you cannot place
keyword arguments before non-keyword args. So it is not a simple
matter of find/replace IS_IN_SET(... with IS_IN_SET(zero=None...,
there will have to be parsing of the syntax to determine where to
place zero=.

I am perfectly capable of making the changes, and most likely will.

Other frameworks, have version upgrades
that happen once a month at the very least frequency, with migration
guides, change logs, and previous version supported bug fixes. Web2py
cannot do this, for one the development cycle is more along the lines
of hours/days instead of months, there are no migration logs, there are no
change logs, there is no point of reference for upgrading version to
version.

As I have asked before, if Massimo would place an operational
definition of backwards compatibility in the context of web2py,
otherwise it is open to interpretation, and will be judged as those
interpretations are assumed. If you are going to set a standard and a
promise, you either define the parameters of that standard, or
uphold it to the highest and most rigid interpretations. Here we
realize the reason for religious debate and war, the absence of
scientific definitions that allow individuals from all walks of life
to understand from the same perspective and context.

My interpretation is of not having to change a line of code to upgrade
my application and have it look _exactly_ the same after the upgrade.

The majority of use cases is 50/50 and depends on
the context of the form. Even for me, the use cases differ from
hobby applications to professional applications.

-Thadeus





On Tue, Mar 23, 2010 at 2:54 AM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 Thadeus -

 I initially commiserated with you:  backward compatipility is
 backward compatibility --- but I alwasy thought Massimo held on to
 that phrase too strongly, too tightly.   It's important for the big
 things, but it _always_ gets in the way of meaningful, useful
 change...

 I think perhaps Massimo's bordering on being dogmatic about backward
 compatibiliy may have an affect on how people react to this.

 But Jonathan gives an important insight:   I always specify zero=...

 Even as zero=...  didn't exist before, it's easy enough to do
 globeal search and modify to put it in - it's _really_ not a big
 deal;  it's one of those things where dogmatically holding to the
 compatability principle is more trouble than adapting to this
 change.  If it was happening all the time, often... this would be
 annoying;   but occasionally, it is more than tolerable - it can even
 be a good thing, in the big scheme of things.

 You are, of course, free to see it in whatever way you happen to see
 it.  I'm just offering a summary of a counterpoint for consideration.

 Kind regards,
 Yarko

 On Mar 23, 2:22 am, Thadeus Burgess thade...@thadeusb.com wrote:
 weheh, Massimo,

 The issue is the same for me, I have several web2py applications, each
 commanding over 20 forms which make use of IS_IN_SET. I am dealing
 with a sizable number of forms that I need to update just to fix this.
 The fact is that web2py changed the output of how drop boxes are
 rendered, and in turn it has broken my forms that relied on the first
 element being selected.

 Aside from the time to alter my forms, this is an issue of promise,
 and principle that separate web2py from other python frameworks. To
 take a few quotes and give my interpretations of them.

  Another feature of web2py, is that we, its developers, commit to
 maintain backward compatibility in future versions. We have done so
 since the first release of web2py in October, 2007. New features have
 been added and bugs have been fixed, but if a program worked with
 web2py 1.0, that program will still work today.  - Massimo Di
 Pierro, Web2py Book, Chapter 1, Introduction

 This is the kicker, my programs no longer work as intentionally
 designed. Perhaps you should re-word this as will still
 compile/execute/not crash instead of work.

 web2py has never broken backwards compatibility, and it will not
 break compatibility when additional functionality is added in the
 future.  - Massimo Di Pierro, Web2py Book, Chapter 1.4, Why Web2py

 The definition of compatibility is very loosely defined. This quote is
 in response to the one made that web2py never controlled this before,
 now it is. Regardless of if web2py controlled something previously or
 not, it cannot change the compatibility with older versions.

 Given the scope of the web2py applications that I develop, and the
 sheer principle of the matter, do you understand where I am coming
 from?

 I seem to be left with the following options

 A) Update my 100+ forms and set zero=None. I view this as a complete
 waste of my time, either manually or working a search/replace and then
 re-testing all of my forms.
 B) Use a patched version of web2py that does what I want, zero=None.
 This is not a desired option since keeping

Re: [web2py] Re: Drop boxes in 1.76.5

2010-03-22 Thread Thadeus Burgess
Use the form in the other post labeled as Survey:

Also, I do agree I don't want everything to turn into a survey, but
this is a point of contention that has been argued back and forth for
months now ever since the feature creeped in without proper
community input on this breaking change.

-Thadeus





On Mon, Mar 22, 2010 at 10:54 AM, Iceberg iceb...@21cn.com wrote:
 Well, we have enough discussion in
 https://groups.google.com/group/web2py/browse_frm/thread/d25d13cd3f5bd7b1/67f5748c0411e81e
 and I don't want to repeat.

 Just one thing. When talking about keeping backward compatibility
 and thinking this argument could support proposal zero='', then you
 are badly wrong. Actually I am the person who suggested the zero=...,
 so I am quite sure that at the very beginning it was zero=None, in
 order to be compatible with the earlier version of web2py which did
 not have this feature at all!

 And, although I can admit that, in all my apps' code I explicitly use
 zero='' more than zero=None, I still think zero='' is an EXTRA feature
 that MUST be turned on EXPLICITLY. So...

 In short, I suggest zero=None as default. Period.


 @Thadeus: Somehow I can not access your vote. So would you mind please
 vote it for me? I choose zero=None.

 Sincerely,
             Iceberg, 2010-Mar-22, 23:06(PM), Mon

 On Mar22, 10:07am, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree with Mr. Freeze but changing it now may constitute a breaking
 a backward compatibility.
 After reading the survey it has a lot of questions and it may
 confusing to a lot of users.
 Bottom line:

 zero='' is what we have now (vote for this if you do not want changes
 in your apps)
 zero=None is the change in behavior that Thadeus is proposing. It will
 change the way dropbox behave. It will eliminate the default empty
 option in the stopbox (vote this if you want the first alphabetical
 value to be selected by default).

 Clarifications: the last question asks whether the current solution
 (since 1.5x.x I think) was a breaking of backward compatibily, not
 whether a change now should be a braking of backward compatibility.
 @Thadeus, if you ask one question, you should ask the other too.

 Since there are quite a lot of questions I have to retreat what I
 said. I first want to read the answers and then decide what to do. I
 cannot automatically follow what majority wants since it is possible
 that people will make that case that change of behavior now will
 constitute breaking of backward compatibility.

 Massimo

 On Mar 21, 8:49 pm, mr.freeze nat...@freezable.com wrote:



  Done. I personally prefer zero='' as a default. I think the selection
  should be made explicitly by the user unless an actual default value
  for the field is set. This doesn't break backwards compatibility IMO
  because web2py wasn't controlling it before, the browser was.

  On Mar 21, 8:26 pm, Thadeus Burgess thade...@thadeusb.com wrote:

   That is not a good point. That is a interface and usability question,
   also it is a clientell question of who will be using the app.

   I am tired of arguing this matter. As far as I see it, we broke
   backwards compatibility, forcing me to update all of my apps.

   I respectfully ask the community to please take the following
   anonymous survey on this topic. I will support the outcome of the
   results for this survey as the community decision.

   I will not take part of this survey since I created it.

  https://spreadsheets.google.com/viewform?formkey=dE5pd01zNndEMk4zREpF...

   -Thadeus

   On Sun, Mar 21, 2010 at 7:55 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
Not everybody agreed. Somebody (do not remember who) made a good point
that having zero=None will case people to fill forms with with wrong
values (always the first alphabetical value).

On Mar 21, 7:21 pm, Thadeus Burgess thade...@thadeusb.com wrote:
Massimo, I think in the post everyone agreed to make zero=None the
default, and yet after at least 13 of us said to make this the
default, nothing happened. The original design was (is) a good idea,
but making that a default was a bad idea. Nobody had any input at the
moment, but after playing around with it, it sucks being the default.

-Thadeus

On Sun, Mar 21, 2010 at 1:00 PM, mdipierro mdipie...@cs.depaul.edu 
wrote:
 There was a long discussion about this. Different people disagreed 
 on
 how this should behave.

 You can revert to the previous behavior with

 IS_IN_SET(...,zero=None)
 IS_IN_DB(...,zero=None)

 Or customize the empty value

 zero=Please choose one

 Massimo

 On Mar 21, 12:42 pm, annet annet.verm...@gmail.com wrote:
 Today, I upgraded my web2py installation to version 1.76.5. In this
 web2py version the drop boxes display an empty key value pair 
 first,
 and then the key value pairs from the tables I based them on. What
 causes this change in behaviour? How do I correct

Re: [web2py] Re: list of web hosting providers that work for web2py

2010-03-22 Thread Thadeus Burgess
Dreamhost is slow, but cheap
I use slicehost and manage 3 web2py servers, couldn't be happier. I
originally went with apache/mod_wsgi, however I am now migrating
everything over to cherokee + uwsgi, the main selling point there
being a web based management interface.

-Thadeus





On Mon, Mar 22, 2010 at 8:05 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I use vps.net and I cannot be happier. I will make a video on how to
 deploy web2py there.

 Massimo

 On Mar 22, 6:40 pm, mr.freeze nat...@freezable.com wrote:
 Hostgator works but it's not as easy as it could be. I'll try to put
 together a slice soon.

 On Mar 22, 6:34 pm, Richard richar...@gmail.com wrote:

  I read in another thread that all that is needed for a host to support
  web2py is python2.4+. However I tried and failed to run web2py on
  Hostgator, which does support python2.5. It is likely possible, but my
  Apache-fu is not strong enough.

  What would be great is a list of hosts that are known to work along
  with instructions.

  Here is a start of what I have used personally:
  - Google App Engine (http://code.google.com/appengine/docs/python/
  gettingstarted/uploading.html)
  - Webfaction (http://forum.webfaction.com/viewtopic.php?id=2373)

  Others I have heard work:
  - Slicehost
  - Dreamhost

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: widgets in db.py

2010-03-21 Thread Thadeus Burgess
It is negligible. Unless you are talking about thousands of objects, I
wouldn't be too concerned.

-Thadeus





On Sun, Mar 21, 2010 at 11:14 AM, Avik Basu avikb...@gmail.com wrote:
 Are all the models executed on each server request?  If so, is it
 still appropriate to create helper functions (to be accessed by
 controller function) within the model?  I've been doing it this way
 because the helper functions I am writing usually access the db object
 and therefore having the helper in modules does not work.  However, I
 am concerned that having too many helper functions could slow down
 each server request.
 Avik

 On Mar 20, 2:50 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I typically use the following naming convention

 A_widgets.py
 B_settings.py
 C_web2py.py
 D_db.py

 -Thadeus



 On Sat, Mar 20, 2010 at 1:17 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  models are executed alphabetically. You have two options:
  1) rename one of the files:
  2) move the widgets to a module and import the module from db.py

  On Mar 20, 12:56 pm, Avik Basu avikb...@gmail.com wrote:
  Hi,

  I have a several widgets in a file called widgets.py and would like to
  use those widgets in db.py.  Both db.py and widgets.py exist in the
  models directory.  However, when I use the widgets in defining table
  fields in db.py, it does not recognize the widgets.  How can I include
  the widgets.py in db.py?

  Note that some of the the widgets reference the db object and so I
  decided not to put widgets.py in the modules folder since I could not
  reference db and the other globals from web2py.

  Thanks for your help.

  Avik

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Debian / Ubuntu packager needed!

2010-03-21 Thread Thadeus Burgess
How would you propose web2py to write sql.log, or its .table files
used in migrations for that matter?

-Thadeus





On Sun, Mar 21, 2010 at 11:32 AM, Dima Barsky d...@debian.org wrote:
 kaging individual applications is not easy either, there is another
 problem I forgot to mention. Currently web2py assu

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Drop boxes in 1.76.5

2010-03-21 Thread Thadeus Burgess
Massimo, I think in the post everyone agreed to make zero=None the
default, and yet after at least 13 of us said to make this the
default, nothing happened. The original design was (is) a good idea,
but making that a default was a bad idea. Nobody had any input at the
moment, but after playing around with it, it sucks being the default.

-Thadeus





On Sun, Mar 21, 2010 at 1:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 There was a long discussion about this. Different people disagreed on
 how this should behave.

 You can revert to the previous behavior with

 IS_IN_SET(...,zero=None)
 IS_IN_DB(...,zero=None)

 Or customize the empty value

 zero=Please choose one

 Massimo

 On Mar 21, 12:42 pm, annet annet.verm...@gmail.com wrote:
 Today, I upgraded my web2py installation to version 1.76.5. In this
 web2py version the drop boxes display an empty key value pair first,
 and then the key value pairs from the tables I based them on. What
 causes this change in behaviour? How do I correct it?

 Kind regards,

 Annet.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Update record if different than proposed changes

2010-03-21 Thread Thadeus Burgess
I think that this functionality is more for a ORM than the DAL.

There are certain features that the an ORM could actually work a layer
above the DAL, such as table Auditing, django-like query syntax,
many-to-many mapping/handling. Probably more.

But I always vote to keep the DAL minimal, and just that, an abstraction layer.

-Thadeus





On Sun, Mar 21, 2010 at 5:48 PM, Richard richar...@gmail.com wrote:
 would it be sensible for the web2py DAL to handle this automatically?



 On Mar 22, 2:55 am, mr.freeze nat...@freezable.com wrote:
 Something like this?:

     existing = db(db.person.id==desired_id).select().first()
     incoming = [f for f in request.vars.keys() if f in
 db.person.fields]
     changes = dict([(f,request.vars[f]) for f in incoming if
 existing[f] != request.vars[f] ])
     if changes: existing.update_record(**changes)

 On Mar 21, 10:22 am, Matthew matthew.g.nor...@gmail.com wrote:

  Thank you for your quick reply.

  In my example, I provided only field for simplicity. In reality, you
  could have 20 fields to check against. Would I have to check all of
  them manually, or is this a cleaner way?

  Thanks again!

  On Mar 21, 10:45 am, mr.freeze nat...@freezable.com wrote:

   existing = db(db.person.id==desired_id).select().first()
   if existing and existing.name != request.vars.name:
       existing.update_record(name=request.vars.name)

   On Mar 21, 9:38 am, Matthew matthew.g.nor...@gmail.com wrote:

Is there a clean way to update a record only if it is different than
the proposed changes?

For example, I have a person in the table 'person' whose name is
'Pete'. To update his name:

desired_id = 5
db(db.person.id == desired_id).update(name='Pete')

Update is executed, even though his name did not change. What's the
cleanest way to not do the update if the record's fields have not
changed?

Thanks,
Matthew

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Drop boxes in 1.76.5

2010-03-21 Thread Thadeus Burgess
That is not a good point. That is a interface and usability question,
also it is a clientell question of who will be using the app.

I am tired of arguing this matter. As far as I see it, we broke
backwards compatibility, forcing me to update all of my apps.

I respectfully ask the community to please take the following
anonymous survey on this topic. I will support the outcome of the
results for this survey as the community decision.

I will not take part of this survey since I created it.

https://spreadsheets.google.com/viewform?formkey=dE5pd01zNndEMk4zREpFRXFxU05vbEE6MA

-Thadeus





On Sun, Mar 21, 2010 at 7:55 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Not everybody agreed. Somebody (do not remember who) made a good point
 that having zero=None will case people to fill forms with with wrong
 values (always the first alphabetical value).

 On Mar 21, 7:21 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 Massimo, I think in the post everyone agreed to make zero=None the
 default, and yet after at least 13 of us said to make this the
 default, nothing happened. The original design was (is) a good idea,
 but making that a default was a bad idea. Nobody had any input at the
 moment, but after playing around with it, it sucks being the default.

 -Thadeus

 On Sun, Mar 21, 2010 at 1:00 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  There was a long discussion about this. Different people disagreed on
  how this should behave.

  You can revert to the previous behavior with

  IS_IN_SET(...,zero=None)
  IS_IN_DB(...,zero=None)

  Or customize the empty value

  zero=Please choose one

  Massimo

  On Mar 21, 12:42 pm, annet annet.verm...@gmail.com wrote:
  Today, I upgraded my web2py installation to version 1.76.5. In this
  web2py version the drop boxes display an empty key value pair first,
  and then the key value pairs from the tables I based them on. What
  causes this change in behaviour? How do I correct it?

  Kind regards,

  Annet.

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Drop boxes in 1.76.5

2010-03-21 Thread Thadeus Burgess
Ok, to add (or remove) questions I should invalidate all the current
results (4) and those should retake the survey. Also pre-exposure to
this thread can skew the results as there are those who will always
follow what others say on this thread just because of the merit this
person has in the community.



-Thadeus





On Sun, Mar 21, 2010 at 9:07 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree with Mr. Freeze but changing it now may constitute a breaking
 a backward compatibility.
 After reading the survey it has a lot of questions and it may
 confusing to a lot of users.
 Bottom line:

 zero='' is what we have now (vote for this if you do not want changes
 in your apps)
 zero=None is the change in behavior that Thadeus is proposing. It will
 change the way dropbox behave. It will eliminate the default empty
 option in the stopbox (vote this if you want the first alphabetical
 value to be selected by default).

 Clarifications: the last question asks whether the current solution
 (since 1.5x.x I think) was a breaking of backward compatibily, not
 whether a change now should be a braking of backward compatibility.
 @Thadeus, if you ask one question, you should ask the other too.

 Since there are quite a lot of questions I have to retreat what I
 said. I first want to read the answers and then decide what to do. I
 cannot automatically follow what majority wants since it is possible
 that people will make that case that change of behavior now will
 constitute breaking of backward compatibility.


 Massimo

 On Mar 21, 8:49 pm, mr.freeze nat...@freezable.com wrote:
 Done. I personally prefer zero='' as a default. I think the selection
 should be made explicitly by the user unless an actual default value
 for the field is set. This doesn't break backwards compatibility IMO
 because web2py wasn't controlling it before, the browser was.

 On Mar 21, 8:26 pm, Thadeus Burgess thade...@thadeusb.com wrote:

  That is not a good point. That is a interface and usability question,
  also it is a clientell question of who will be using the app.

  I am tired of arguing this matter. As far as I see it, we broke
  backwards compatibility, forcing me to update all of my apps.

  I respectfully ask the community to please take the following
  anonymous survey on this topic. I will support the outcome of the
  results for this survey as the community decision.

  I will not take part of this survey since I created it.

 https://spreadsheets.google.com/viewform?formkey=dE5pd01zNndEMk4zREpF...

  -Thadeus

  On Sun, Mar 21, 2010 at 7:55 PM, mdipierro mdipie...@cs.depaul.edu wrote:
   Not everybody agreed. Somebody (do not remember who) made a good point
   that having zero=None will case people to fill forms with with wrong
   values (always the first alphabetical value).

   On Mar 21, 7:21 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Massimo, I think in the post everyone agreed to make zero=None the
   default, and yet after at least 13 of us said to make this the
   default, nothing happened. The original design was (is) a good idea,
   but making that a default was a bad idea. Nobody had any input at the
   moment, but after playing around with it, it sucks being the default.

   -Thadeus

   On Sun, Mar 21, 2010 at 1:00 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
There was a long discussion about this. Different people disagreed on
how this should behave.

You can revert to the previous behavior with

IS_IN_SET(...,zero=None)
IS_IN_DB(...,zero=None)

Or customize the empty value

zero=Please choose one

Massimo

On Mar 21, 12:42 pm, annet annet.verm...@gmail.com wrote:
Today, I upgraded my web2py installation to version 1.76.5. In this
web2py version the drop boxes display an empty key value pair first,
and then the key value pairs from the tables I based them on. What
causes this change in behaviour? How do I correct it?

Kind regards,

Annet.

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

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http

Re: [web2py] Re: Drop boxes in 1.76.5

2010-03-21 Thread Thadeus Burgess
More about why there are so many questions.

The first question gets us exactly what someone wants as a default
option. This is a bi-polar measure, quickly getting a base response
for what is wanted.

The second one drills down qualitatively why they support this.

The third reveals known cons of this as the default that the developer
accepts as OK and is willing to accept or live with.

The first two scales reveal how often each of the options is used in
their own apps. Mind, this is not a bi-polar measure (that is what the
first question is for)

The second two scales reveal how they feel about each of them as the
default functionality.  Again, not bi-polar measures.

I will remove the questions about backwards compatibility as it is not
relative to what I am trying to accomplish, and not a fair question.

The combination of these answers can give much insight as to why the
community feels about one option or the other.

With the explanation of what these measures are for, I will re-open
this in a new topic so that the measures cannot be skewed by
pre-exposure to opinions expressed by those of us with high merit in
the community (myself included). I WILL invalidate the current results
taken (currently only 4), so I ask if those who have taken could
please re-take the new one. I will be posting a new survey in 15
minutes, to give time for any additional suggested changes that should
be made before data collection starts.

-Thadeus

On Sun, Mar 21, 2010 at 9:12 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 Ok, to add (or remove) questions I should invalidate all the current
 results (4) and those should retake the survey. Also pre-exposure to
 this thread can skew the results as there are those who will always
 follow what others say on this thread just because of the merit this
 person has in the community.



 -Thadeus





 On Sun, Mar 21, 2010 at 9:07 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree with Mr. Freeze but changing it now may constitute a breaking
 a backward compatibility.
 After reading the survey it has a lot of questions and it may
 confusing to a lot of users.
 Bottom line:

 zero='' is what we have now (vote for this if you do not want changes
 in your apps)
 zero=None is the change in behavior that Thadeus is proposing. It will
 change the way dropbox behave. It will eliminate the default empty
 option in the stopbox (vote this if you want the first alphabetical
 value to be selected by default).

 Clarifications: the last question asks whether the current solution
 (since 1.5x.x I think) was a breaking of backward compatibily, not
 whether a change now should be a braking of backward compatibility.
 @Thadeus, if you ask one question, you should ask the other too.

 Since there are quite a lot of questions I have to retreat what I
 said. I first want to read the answers and then decide what to do. I
 cannot automatically follow what majority wants since it is possible
 that people will make that case that change of behavior now will
 constitute breaking of backward compatibility.


 Massimo

 On Mar 21, 8:49 pm, mr.freeze nat...@freezable.com wrote:
 Done. I personally prefer zero='' as a default. I think the selection
 should be made explicitly by the user unless an actual default value
 for the field is set. This doesn't break backwards compatibility IMO
 because web2py wasn't controlling it before, the browser was.

 On Mar 21, 8:26 pm, Thadeus Burgess thade...@thadeusb.com wrote:

  That is not a good point. That is a interface and usability question,
  also it is a clientell question of who will be using the app.

  I am tired of arguing this matter. As far as I see it, we broke
  backwards compatibility, forcing me to update all of my apps.

  I respectfully ask the community to please take the following
  anonymous survey on this topic. I will support the outcome of the
  results for this survey as the community decision.

  I will not take part of this survey since I created it.

 https://spreadsheets.google.com/viewform?formkey=dE5pd01zNndEMk4zREpF...

  -Thadeus

  On Sun, Mar 21, 2010 at 7:55 PM, mdipierro mdipie...@cs.depaul.edu 
  wrote:
   Not everybody agreed. Somebody (do not remember who) made a good point
   that having zero=None will case people to fill forms with with wrong
   values (always the first alphabetical value).

   On Mar 21, 7:21 pm, Thadeus Burgess thade...@thadeusb.com wrote:
   Massimo, I think in the post everyone agreed to make zero=None the
   default, and yet after at least 13 of us said to make this the
   default, nothing happened. The original design was (is) a good idea,
   but making that a default was a bad idea. Nobody had any input at the
   moment, but after playing around with it, it sucks being the default.

   -Thadeus

   On Sun, Mar 21, 2010 at 1:00 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
There was a long discussion about this. Different people disagreed on
how this should behave.

You can revert

[web2py] Survey: Functionality of the Drop Boxes widget

2010-03-21 Thread Thadeus Burgess
There is current on-going discussion of the default functionality of
the drop boxes widget. This is an attempt to gather information from
the community on this discussion. The results of this survey will
determine what this default functionality will be.

Here is the comparison of the two options currently being considered.

zero=

This is when a drop box is rendered, there is an empty OPTION tag
rendered in the first that is selected.

zero=None

This is when only the options in the list are rendered. The first
option in the list is selected.

https://spreadsheets.google.com/viewform?formkey=dE9jS1VHSWdyd08xX2x6NU0yaEs1cnc6MA

Thank You,

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Using the Template System to Generate Emails

2010-03-20 Thread Thadeus Burgess
cache the mail and only access it if its no longer cached?

Or have a table that stores all sent mailings

sent_mail
  - bedrijf
  - message

You still query the database, but you have to store the info somewhere
at some point in time if it is to be accessed later.

-Thadeus





On Sat, Mar 20, 2010 at 6:06 AM, annet annet.verm...@gmail.com wrote:
 I have another question:

 In case the user would like to view the html mail in his browser, I
 have got the following line of code:

 td class=browser align=left
    {{if not request.function=='browser_version':}}
   pHaving trouble viewing this email? a
 href={{=URL(r=request,c='clublocatormail',f='browser_version',args=[nfa.bedrijf])}}View
 it in your browser/a/p
    {{pass}}
 /td


 I would like to use the same view, however, that view contains the
 variable nfa.bedrijf, which, in case of the mail, is available from
 the context. The link to the browser_version function contains
 args=[nfa.bedrijf], so nfa.bedrijf is available as request.args[0] in
 the browser_version function, but I don't now to pass it on to the
 view in a suitable way.

 I could do:

 def browser_version():
    response.view='send_mail.html'

 nfa=db((db.nfa.nfatype==4)(db.nfa.bedrijf==request.args[0])).select(db.nfa.ALL)
    return dict(nfa=nfa)

 ..., but that would unnecessarily query the database. Is there another
 way to solve this problem?


 Kind regards,

 Annet.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py on Kodingen?

2010-03-20 Thread Thadeus Burgess
Its based off of bespin

-Thadeus





On Sat, Mar 20, 2010 at 1:39 PM, mr.freeze nat...@freezable.com wrote:
 It's the former.  Once you get an account, you can create and edit
 projects and manage your web servers/databases/domains/etc. It looks
 like it is mainly centered around php but there are options to enable
 python.  I tried using fastcgi but my Apache skills are weak.

 On Mar 20, 12:39 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I am trying to figure out what it is? Is it a hosting provider with a
 web based IDE? Is it a web based IDE can download and use?

 On Mar 20, 12:01 pm, Alex Fanjul alex.fan...@gmail.com wrote:

  Incredible!! i didnt know kodingen...

  El 20/03/2010 7:19, mr.freeze escribi :

   It appears that Kodingen can run Django and Ruby apps. Someone with
   strong Apache-fu should try to get web2py working :)

  http://kodingen.com/?2010/01/27/get-ruby-working/
  http://kodingen.com/?groups/django-on-kodingen

  --
  Alejandro Fanjul Fdez.
  alex.fan...@gmail.comwww.mhproject.org



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: zengarden anybody?

2010-03-20 Thread Thadeus Burgess
I envision having an app create wizard, you select a layout (based on
ez-css), and then select a skin for the layout. :)

-Thadeus





On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze nat...@freezable.com wrote:
 I think the ability to select a skin when creating an app would be a
 major plus and help kick-start development for the design-impaired
 such as myself.

 On Mar 20, 1:32 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I just came across this:

    http://www.csszengarden.com/

 It is one simple html layout (only divs) with 210 PURE CSS skins:

    http://www.mezzoblue.com/zengarden/alldesigns/

 This could be an option for the welcome app. If we use their html, it
 would be trivial to add a small admin option that downloads a team to
 zengarden and applies to skin. Options that require overriding the
 HTML are more complex to handle.

 What do you think?

 Massimo

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py beautification

2010-03-20 Thread Thadeus Burgess
easy negative margin ??

easy 50 % width ??

I agree, I wish the class names were more human, OTOH, with only a
handful of classes it is not much to learn.


-Thadeus





On Sat, Mar 20, 2010 at 6:57 PM, Pepe pepea...@gmail.com wrote:

 i'm designer and before of that a human being, so i wonder: why make
 web2py less human readable?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: zengarden anybody?

2010-03-20 Thread Thadeus Burgess
Well... the quickest way to change layouts is to store the
configuration in the database...

So have a table for web2py meta information, that contains
current_layout which is value is layout.html or mynewlayout.html
etc etc.

In all views instead of {{ extend layout.html }} it will be {{
extend current_layout }}. Then do the same with the CSS as well.

{{ response.files.append(my_current_css) }}

Cache these variables in RAM to save from un-necessary dbio

-Thadeus





On Sat, Mar 20, 2010 at 5:11 PM, Yarko Tymciurak
resultsinsoftw...@gmail.com wrote:
 Having said this, the zengarden shows how to accomplish some standard
 naming, and now to switch css to affect things

 That by itself is quite useful - and worth (for me at least) more
 closely...


 On Mar 20, 1:53 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 I envision having an app create wizard, you select a layout (based on
 ez-css), and then select a skin for the layout. :)

 -Thadeus

 On Sat, Mar 20, 2010 at 1:50 PM, mr.freeze nat...@freezable.com wrote:
  I think the ability to select a skin when creating an app would be a
  major plus and help kick-start development for the design-impaired
  such as myself.

  On Mar 20, 1:32 pm, mdipierro mdipie...@cs.depaul.edu wrote:
  I just came across this:

     http://www.csszengarden.com/

  It is one simple html layout (only divs) with 210 PURE CSS skins:

     http://www.mezzoblue.com/zengarden/alldesigns/

  This could be an option for the welcome app. If we use their html, it
  would be trivial to add a small admin option that downloads a team to
  zengarden and applies to skin. Options that require overriding the
  HTML are more complex to handle.

  What do you think?

  Massimo

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



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Does the pdf manual differ from the online official web2py book a lot?

2010-03-19 Thread Thadeus Burgess
New web2py features added to the online book, so you will miss certain
things, since the PDF book is about a year old now, whereas the online
book is being added to and expanded.

-Thadeus





On Fri, Mar 19, 2010 at 8:12 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 One month ago they were identical but the online one is a wiki so some
 users have improved it, but no major differences yet.

 On Mar 19, 3:37 am, zkingw zkin...@gmail.com wrote:
 Hi, all:

 I came across web2py earlier this week, and I fall into love with it
 right away, and decided to learn it as my very first python web
 framework.

 I got the pdf version of the manual in hand, already finished the
 first two chapters, and move into the Core part, have to say that's
 one of the best tutorial. My question is that does the pdf manual
 differ from the online official book a lot? And what's the difference
 between those two versions exactly? I want to stay with the pdf manual
 as I can read it using my ebook reader which is really nice, but I
 dont want missing the important stuff because the version difference.

 thanks for your kindly advices.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Does the pdf manual differ from the online official web2py book a lot?

2010-03-19 Thread Thadeus Burgess
Speaking of this. Massimo can we get a latest update feed for the
online book, to make it easier to keep track of new things?

-Thadeus





On Fri, Mar 19, 2010 at 9:44 AM, Thadeus Burgess thade...@thadeusb.com wrote:
 New web2py features added to the online book, so you will miss certain
 things, since the PDF book is about a year old now, whereas the online
 book is being added to and expanded.

 -Thadeus





 On Fri, Mar 19, 2010 at 8:12 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 One month ago they were identical but the online one is a wiki so some
 users have improved it, but no major differences yet.

 On Mar 19, 3:37 am, zkingw zkin...@gmail.com wrote:
 Hi, all:

 I came across web2py earlier this week, and I fall into love with it
 right away, and decided to learn it as my very first python web
 framework.

 I got the pdf version of the manual in hand, already finished the
 first two chapters, and move into the Core part, have to say that's
 one of the best tutorial. My question is that does the pdf manual
 differ from the online official book a lot? And what's the difference
 between those two versions exactly? I want to stay with the pdf manual
 as I can read it using my ebook reader which is really nice, but I
 dont want missing the important stuff because the version difference.

 thanks for your kindly advices.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.




-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py beautification

2010-03-19 Thread Thadeus Burgess
There is a conspiracy that the google bot reduces the page ranking if
it uses a table layout instead of css layout.

I don't believe it though, since why would google NOT index something?

The limitations of tables mean you can't reorganize your content, that
is the beauty of css, you can take the same html file, plug different
css into it and have a completely different site, only because the css
file changes.

http://www.csszengarden.com/ (on the right side is links to apply
different css layouts to the same html page)

Its really not hard, and the box model is not that bad, its just
confusing and most don't know how to use it properly.

http://www.stubbornella.org/content/2009/02/12/css-doesn%E2%80%99t-suck-you%E2%80%99re-just-doing-it-wrong/

Here are perfect examples of the box model working correctly.

http://matthewjamestaylor.com/blog/perfect-3-column.htm
http://www.alistapart.com/articles/holygrail

-Thadeus





On Fri, Mar 19, 2010 at 10:33 AM, Jonathan Lundell jlund...@pobox.com wrote:
 syncrasies of CSS; I do that, pretty much. My complaint is that its box model 
 from the beginning was unsuited to what designers normally do, and the result 
 is the proliferation of CSS frameworks that exist mainly to work around its 
 limitations.


-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] legacy databases

2010-03-19 Thread Thadeus Burgess
You need to define your tables in web2py. As of yet there is no db
introspection for db.

db.define_table('tablename', *Fields)

There is also a thing called keyedtables which is for legacy databases.

-Thadeus





On Fri, Mar 19, 2010 at 10:44 AM, pacopyc paco...@gmail.com wrote:
 Hi, I need to develope a web application with legacy database
 (Oracle). Database's tables have an auto increment field (id) and then
 this is ok. I tried to build a new application and I set database
 connection (db.py). No error (connection string is ok) but if I try to
 use appadmin application I can't see database's tables. Can I build
 models from tables automatically? Is this the problem? What can I do?
 Anything similar inspectdb of Django? Also with Rails no problem, I
 don't understand ... can you help me?

 Thank you

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] web2py api search - edit_area plugin

2010-03-19 Thread Thadeus Burgess
You could do a

def install():
   if db(db.table.id  0).count() == 0:
  db.table.insert(record1)
  db.table.insert(record2)
   if db(db.table2.id  0).count() == 0:
  db.table2.insert(record1)

install()

-Thadeus





On Fri, Mar 19, 2010 at 12:22 PM, Wes James compte...@gmail.com wrote:
 Here is how to get web2py api search plugin to work:

 1. unzip web2py_api_srch.zip in to
 web2py/applications/admin/static/edit_area/plugins
 2. unzip databases.zip in to web2py/applications/admin
 3. add the following to web2py/applications/admin/models/0.py :

 db = DAL('sqlite://storage.sqlite')

 db.define_table(
    'apis',
    Field('api'),
    Field('info')
    )

 4. Makes changes to the end of the editAreaLoader.init in
 web2py/applications/admin/views/default/edit.html:

 , end_toolbar: web2py_api_srch_but {{if filetype=='html':}},plugins:
 web2py_api_srch,zencoding{{else:}},plugins:
 web2py_api_srch{{pass}}

 5.  Add the contents of controller.txt (apis function) to
 web2py/applications/admin/controllers/default.py

 ok - instead of doing all the attachments above, I'm just attaching
 admin.zip where I deleted everything but the necessary files.

 Anyone have any ideas on the db structure or how to populate it?

 -wes

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: best web frameworks

2010-03-19 Thread Thadeus Burgess
quick! everyone, comment good things about web2py!

-Thadeus





On Fri, Mar 19, 2010 at 12:46 PM, selecta gr...@delarue-berlin.de wrote:
 hmmm, what do I learn from that? What should I use they are all the
 same (oh yes different licenses and dependencies on different py
 versions) or is this comparision pointless? Confusion o_O

 On Mar 19, 12:53 pm, Alex Fanjul alex.fan...@gmail.com wrote:
 FYI:http://www.bestwebframeworks.com/python/
 --
 Alejandro Fanjul Fdez.
 alex.fan...@gmail.comwww.mhproject.org

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py beautification

2010-03-19 Thread Thadeus Burgess
Maybe the next version of CSS... but as long as IE is around, growth
of web standards will always be stunted.

-Thadeus





On Fri, Mar 19, 2010 at 12:59 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On Mar 19, 2010, at 8:46 AM, Thadeus Burgess wrote:

 Its really not hard, and the box model is not that bad, its just
 confusing and most don't know how to use it properly.

 That's not a good sign.


 http://www.stubbornella.org/content/2009/02/12/css-doesn%E2%80%99t-suck-you%E2%80%99re-just-doing-it-wrong/

 Here are perfect examples of the box model working correctly.

 http://matthewjamestaylor.com/blog/perfect-3-column.htm
 http://www.alistapart.com/articles/holygrail

 I agree that MJT's example is especially nice. But it also makes my point. 
 His simple 3-column layout has 160 lines of CSS, not all of them for layout, 
 but the lion's share. And that doesn't count the html that makes it go.

 Compare that to the same thing with a table.

 And I'm not arguing for tables, particularly, just that CSS should have made 
 our job easier, not harder.

 Example: I should be able to say, for that kind of layout:

 Give me a box for the page.

 Nest three boxes inside it, on top of each other, each the full width of the 
 enclosing box.

 In the middle of those boxes, nest three more, but left to right.

 Let me give each box a name.

 Let me constrain each box's horizontal and vertical extent based on any 
 combination of content, container, percentages and pixels that isn't 
 self-contradictory. Let the model understand the word center in both 
 dimensions.

 (Now, if on top of that model I want to define more boxes that float around, 
 etc, fine, no objection. But it needn't be part of my base layout.)

 And now let me, separate from that description, pour my content into named 
 boxes.

 When I first heard of CSS, way back whenever, that's kind of what I imagined 
 it'd be like, from the early glowing descriptions. Boy, was I surprised.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Using the Template System to Generate Emails

2010-03-19 Thread Thadeus Burgess
The reason is because the content type is encoded as Text not HTML.
Without the proper meta information sent to the SMTP server, emails
will not display correctly.

Use the following class lined out in the wiki, works like a charm.

http://wiki.web2py.com/Sending_Email_with_Plain_Text_HTML_Versions_plus_Attachments


-Thadeus





On Fri, Mar 19, 2010 at 1:30 PM, Alexandre Andrade
alexandrema...@gmail.com wrote:
 the trick is that

 message is first text, then html

 mail.send(to=[recipient],subject='Controleer uw adresgegevens in
 Fitwise',message=message)

 will result in a text message.

 to render as html, is :

 mail.send(to=[recipient],subject='Controleer uw adresgegevens in
 Fitwise',message=[None,message])




 2010/3/19 DenesL denes1...@yahoo.ca

 Annet,
 maybe this will help
 http://groups.google.com/g/4247fb7b/t/4b6d3b0c8a822c83/d/7964e5b019d1c3d9


 On Mar 19, 12:49 pm, annet annet.verm...@gmail.com wrote:
  In my application all functions related to sending mail from it work.
  The main function reads like:
 
  def send_mail():
 
  nfas=db(db.nfa.nfatype==4).select(db.nfa.ALL,orderby=db.nfa.bedrijf)
      for nfa in nfas:
          context=dict(nfa=nfa)
          message=response.render('clublocatormail/
  send_mail.html',context)
          recipient=nfa.adres
          mail.send(to=[recipient],subject='Controleer uw adresgegevens
  in Fitwise',message=message)
      return True
 
  The send_mail.html view reads like (I removed the irrelevant parts):
 
  html
  head
     meta http-equiv=Content-Type content=text/html; charset=utf-8
     titleTemplate - Single Column/title
  /head
  style type=text/css media=screen
        body {
           background-color: #ee;
        }
  /style
  body
  table width=100% border=0 cellspacing=0 cellpadding=0
  class=bg1
     tr
        td align=center
           table width=600 border=0 cellspacing=0 cellpadding=0
  class=bg2
              tr
                 td class=permission align=left
                    {{if not request.function=='browser_version':}}
                        h1Having trouble viewing this email?
  {{=A('View it in your browser',
 
  _href={{=URL(r=request,a='mock_crm',c='clublocatormail',f='browser_version',args=[nfa.bedrijf]))}}./
  h1
                    {{pass}}
                 /td
              /tr
              tr
                 td class=header align=left
                    img src={{=URL(r=request,c='static',f='template/
  header.gif')}} alt=Header width=600 height=150 /
                 /td
              /tr
              tr
                 td valign=top class=body
                    table width=100% border=0 cellspacing=0
  cellpadding=0
                       tr
                          td valign=top class=mainbar align=left
                             h2/h2
                             img class=hr
  src={{=URL(r=request,c='static',f='template/hr.gif')}} alt=Header
  width=560 height=3 /
                             p{{=nfa.bedrijf}}/p
                             p{{=nfa.adres}}/
  p
                             br /
                          /td
                       /tr
                    /table
                 /td
              /tr
              tr
                 td valign=middle align=left class=footer
  height=61
                    p/p
                 /td
              /tr
           /table
        /td
     /tr
  /table
  /body
  /html
 
  I based this code on this
  article:http://articles.sitepoint.com/article/code-html-email-newsletters
  and the templates referred to. I had hoped the view would display
  without trouble, but it doesn't. In all mail clients and web based
  apps, it displays as plain text, so the html is not rendered. I have
  been trying to find out why for two days now, and hope one of you can
  come to my rescue.
 
  Kind regards,
 
  Annet.

 --
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To post to this group, send email to web...@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.




 --
 Atenciosamente

 --
 =
 Alexandre Andrade
 Hipercenter.com

 --
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To post to this group, send email to web...@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.


-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py beautification

2010-03-19 Thread Thadeus Burgess
The whole UI paradigm is a pain, regardless of what programming
language or platform. Windows Forms makes it easy, but still
archaic.

-Thadeus





On Fri, Mar 19, 2010 at 2:41 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On Mar 19, 2010, at 11:18 AM, Thadeus Burgess wrote:

 Maybe the next version of CSS... but as long as IE is around, growth
 of web standards will always be stunted.

 Not CSS3, anyway.

 I'm doubtful anyway, since CSS is so heavily embedded in browsers. I think 
 we're stuck with the basic model.

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] substring comparison in GAE query

2010-03-19 Thread Thadeus Burgess
You must be thinking of another framework and mixing the two?

I read every post and have not seen that.

Perhaps you mean db(db.table.string.like(%.com)).select()

-Thadeus





On Fri, Mar 19, 2010 at 2:49 PM, howesc how...@umich.edu wrote:
 Hello,

 I swear i saw a post in the last week about creating database queries
 with substring syntax for filtering like:
  query = db(db.table.string_field[:4] == .com)

 but i can't find the post about that.  am i dreaming?  and does
 something like this work on the Google App Engine?  I was trying it
 but got an error:

  File /home/cfhowes/clients/rockriver/source/web2py/gluon/sql.py,
 line 2703, in __getslice__
    s = self._db._translator['substring'] % d
 KeyError: 'substring'

 Thanks,

 Christian

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] substring comparison in GAE query

2010-03-19 Thread Thadeus Burgess
You *can*, but not natively.

http://web2py.com/AlterEgo/default/show/248

rows = db(buyer.id0).select().find(lambda row:row.name.startswith('C'))

-Thadeus





On Fri, Mar 19, 2010 at 3:53 PM, Wes James compte...@gmail.com wrote:
 You can't use like on gae.

 On Fri, Mar 19, 2010 at 2:33 PM, Thadeus Burgess thade...@thadeusb.com 
 wrote:
 You must be thinking of another framework and mixing the two?

 I read every post and have not seen that.

 Perhaps you mean db(db.table.string.like(%.com)).select()

 -Thadeus



 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: problema con mysql y apache

2010-03-19 Thread Thadeus Burgess
Make sure that you have `python-mysqldb` installed on the server.

traductor Google:

Asegúrese de que tiene `python-MySQLdb` instalado en el servidor.


-Thadeus





On Fri, Mar 19, 2010 at 4:05 PM, kike eacarm...@estudiantes.uci.cu wrote:
 te refieres a uno del apache en especifico, porque la aplicacion me
 funcionaba de maravillas antes de ponerla en el apache, y para
 realmente no se que invertarle para que funcione

 On 19 mar, 15:48, Wes James compte...@gmail.com wrote:
 talvez no tienes un driver para mysql

 On Fri, Mar 19, 2010 at 2:31 PM, kike eacarm...@estudiantes.uci.cu wrote:
  tengo una aplicacion terminada pero cuando la monto en el apache me
  lanza el siguiente tiket: Cual es el problema

  Traceback (most recent call last):
   File /home/kike/sbdv/web2py/gluon/restricted.py, line 173, in
  restricted
   File /home/www-data/web2py/applications/SBDV/models/db.py, line 3,
  in module
     vulnerabilidades=DAL('mysql://root:r...@localhost/
  sbdv',pool_size=20)
   File /home/kike/sbdv/web2py/gluon/sql.py, line 3783, in DAL
   File /home/kike/sbdv/web2py/gluon/sql.py, line 919, in __init__
   File /home/kike/sbdv/web2py/gluon/sql.py, line 840, in
  _pool_connection
   File /home/kike/sbdv/web2py/gluon/sql.py, line 919, in lambda
  NameError: global name 'MySQLdb' is not defined

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

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: web2py beautification

2010-03-18 Thread Thadeus Burgess
ez-css + jquery-ui

It is the only proposed option I actually like.

-Thadeus





On Thu, Mar 18, 2010 at 1:54 PM, Mengu whalb...@gmail.com wrote:
 i agree. i actually don't have any problem with jquery-ui since i'm
 doing all my js work with jquery. ez-css seems cool yet it's hard to
 implement so i'm still for oo-css. :)

 On 15 Mart, 01:16, mdipierro mdipie...@cs.depaul.edu wrote:
 I think we should distinguish between a layout css framework (oocss,
 960, etc. include it) and a content css framework (jquery ui only does
 this).  Perhaps we can pick the layout css from one place and the
 content css from jquery. It is important that class names are easy to
 read and we can fit everything in one css file. I do not like to have
 too many css files in the scaffolding app.

 On Mar 14, 5:02 pm, johntynan jgty...@gmail.com wrote:



  While I admire and would welcome having the option of using 960 grid
  templates, Massimo's suggestion of incorporating jquery's themeroller
  into the welcome app sounds equally interesting.

  I'm not much of a designer, but I value the ideal of a tableless
  design.  I'd be willing to try to free up some time to help implement
  these ideas over the coming weeks.

  On Mar 14, 4:10 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Ideally if we could make the welcome app use or at leat friendly 
   withhttp://jqueryui.com/themeroller/itwouldbe nice.

   On Mar 13, 9:35 pm, villas villa...@gmail.com wrote: On Mar 13, 
   4:05 pm, Mengu whalb...@gmail.com wrote:

 i still recommend oocss as css framework. a lot easier, a lot better.

@Aure.
Sencss. Good styles, but I don't think it helps with the tableless
layout?
BlueTrip. Great looking framework, but like Blueprint, it's a
comprehensive grid-based which is probably best used as a plug-in.

@Mengu.  oocss.org
I haven't had much time to research every option,  but I am inclined
to agree.  It seems excellent and I like the fluidity of the formats
that I looked at.  I don't know whether it would be simple enough to
include with Web2py; it would be a good case if we find it gives
access to templates. This is probably the kind of thing I would
personally go for,  but is it right everyone else?  Who knows! Those
with a little time and enough interest might wish to also give it a
quick look and make a brief comment. In any case, I also think it is
nice to be aware of this project even if it is not right for Web2py.
Best wishes,  D

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Feature request: xlstoweb2py [was: Where do you use web2py?]

2010-03-17 Thread Thadeus Burgess
I had actually used appadmin in production for a particular database
for several months. The users were the same as you are describing
(end-user, used to excel).

Now that it is time to give them the real app (as appadmin was just a
quick get us up and running)... they are actually sad to see us stop
using appadmin, they like it!

I think you might be surprised at how easy appadmin is to grasp for
those who deal with spreadsheets all day.

-Thadeus





On Wed, Mar 17, 2010 at 1:27 AM, Vincent Borghi
vincent.borgh...@gmail.com wrote:
 On Tue, Mar 16, 2010 at 4:11 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I think what Vincent is asking is not so much importing capability but
 an interface that can read an excel file (or a csv file) asks you the
 names (guessing from the header) and types (guessing from data) of
 columns and then writes the model for you.

 yes Massimo

 Perhaps something that can
 deal with the case when the table is the result of a join. Then
 importing is a trivial step. We have that already

 In addition to data importation and code generation for the model,
 a key feature is to generate a user interface to the data.

 The default appadmin.py is OK for an administrator, but
 not so OK for an end-user who just wants to manage and share
 some data.
 Such end-users are most data owners than administartors.

 Ideally, the utility I am looking for will generate a nice user
 (viewers and data owners)
 interface, that the administrator (who is supposed to know python and
 more or less SQL)
 can customize/enhance.

 The end-users/data owners are not knowlegeable in SQL (they are
 used to excel tables, after all).
 Moreover they expect to have simple functionality
 to do base CRUD operations : Create, Read (browse, filter, sort, dump as csv,
 paged or full datalist view in sortable table with choosable columns, possibly
 customizing who has which acces rights, so on...), Update and Delete.


 Regards







 On Mar 16, 9:27 am, Dragonfyre13 dragonfyr...@gmail.com wrote:
 Well, my suggestion would be forget the XLS format for the first
 iteration. Use CSV. If you're not concerned with formulas, that's the
 cleanest route, and included in the default python install. (csv
 module). I use it all the time for my load test frameworks I build.

 It's not only very easy to use, but since it's VERY easy to export
 from excel, it shouldn't be much of a burden on the users. In a second
 iteration, if the license matches, you could do an import from xls
 format.

 On Mar 16, 8:03 am, mdipierro mdipie...@cs.depaul.edu wrote:

  This can be done. I need to check the licence of the xls readers.

  On Mar 16, 3:45 am, Vincent Borghi vincent.borgh...@gmail.com wrote:

   Hello

   I have used web2py to (quickly) implement a simple phone directory of
   customer contacts,
   for a small phone call center.
   Before that, people tried to maintain their contact information in an
   Excel spreadsheet
   that was exchanged thru mail and/or a windows sharedc folder...

   ( Also note that I deal with two zope/plone sites, but I cannot (/don't 
   want) to
   fully understand all the stuff that has been added/changed with the
   Plone 3 release
   and soon the Plone 4 one -- too complicated for me.
   However, as a CMS, Plone has advantages, and afaik there is nothing 
   really
   production-ready in the web2py world )

   By the way:
   Feature request: xlstoweb2py
   ===
   For me, web2py could be the killer framework everywhere there are
   simple xls Excel files
   circulating among people who try to share and maintain information as
   they can (and
   they are numerous in many companies...).

   In fact, in many cases, Excel sheets made by people involve no formula, 
   but are
   just tables of static data. To deal with this frequent use case, I am
   looking for an
   xlstoweb2py utility that would take an xls file as input, and would
   automatically
   convert the data to an sqlite database, would build a base web2py 
   application
   implementing CRUD features and perhaps some form of access control 
   policy.
   The base app would be possibly ready to use, but as the resulting code 
   would be
    web2py- and python-based, it would be easy for a
   developer/administrator (as me) to customize/enhance the generated app.

   For me, such a xlstoweb2py would be a killer app.
   We could even imagine a web service oriented towards the end-user (not 
   to
   developers), which would allow the user to upload an xls file, and in
   turn, would
   generate and host a (possibly customizable) web app for the user, to 
   let him
   manage/share his data thru the web.

   Regards
   Vincent Borghi

   PS: thanks to web2py developers for theit great work!

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@googlegroups.com.
 To unsubscribe from this group, send email to 
 

Re: [web2py] Re: Migrating web2py to GAE

2010-03-17 Thread Thadeus Burgess
Does the GAE SSL certificate compatible with google checkout?

The snag with using plugin google checkout level 2 integration is the
need for a $80/year SSL certificate :(

-Thadeus





On Wed, Mar 17, 2010 at 11:10 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 replace http://... with https://

 GAE has its own certificate. It works for me at

 https://web2py-crm.appspot.com/init/appadmin

 On Mar 17, 10:23 am, mat -- mat...@gmail.com wrote:
 Hi - can someone (re)explain how to get appadmin running on GAE?
 On non-GAE hosting I understand it requires SSH tunnel. But is there an
 equivalent on GAE? Currently, when accessing appadmin on both local GAE and
 GAE I get: Admin is disable because insecure channel. Does the app.yaml
 file need to be edited?
 Thanks!



 On Wed, Mar 17, 2010 at 4:43 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  This is not a web2py issue.

   File string, line 1, in bind
  socket.error: (48, 'Address already in use')

  You have some other server running using the same port.

  I just tried appadmin and works file with me.

  On Mar 17, 8:57 am, Al albertsec...@gmail.com wrote:
   The appadmin can be run on GAE, but it cannot run on local GAE SDK.
   (note: I have been thinking it might due to some basic settings, not
   just my code, which I have overlooked, as running T3 and C.R.M
   appliances have the same problem). I have customised myapp according
   to the web2py manual to suit GAE deployment. Also I always got the
   same result on both my mac and windows machines

   Here is the log on the console:

   *** Running dev_appserver with the following flags:
       --admin_console_server= --port=8009 --clear_datastore
   Python command: /usr/bin/python2.5
   WARNING  2010-03-17 13:45:04,091 datastore_file_stub.py:623] Could not
   read datastore data from /var/folders/fd/fdhbJFB5Hj8Bou9ORL02zE+++TM/-
   Tmp-/dev_appserver.datastore
   Traceback (most recent call last):
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/dev_appserver.py, line 68, in module
       run_file(__file__, globals())
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/dev_appserver.py, line 64, in run_file
       execfile(script_path, globals_)
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/google/appengine/tools/dev_appserver_main.py, line
   417, in module
       sys.exit(main(sys.argv))
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/google/appengine/tools/dev_appserver_main.py, line
   394, in main
       static_caching=static_caching)
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/google/appengine/tools/dev_appserver.py, line 3727,
   in CreateServer
       return HTTPServerWithScheduler((serve_address, port),
   handler_class)
     File /Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
   Resources/GoogleAppEngine-default.bundle/Contents/Resources/
   google_appengine/google/appengine/tools/dev_appserver.py, line 3741,
   in __init__
       request_handler_class)
     File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/SocketServer.py, line 330, in __init__
       self.server_bind()
     File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/BaseHTTPServer.py, line 101, in server_bind
       SocketServer.TCPServer.server_bind(self)
     File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/SocketServer.py, line 341, in server_bind
       self.socket.bind(self.server_address)
     File string, line 1, in bind
   socket.error: (48, 'Address already in use')

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

 --
 Mat

 --
 You received this message because you are subscribed to the Google Groups 
 web2py-users group.
 To post to this group, send email to web...@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.



-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 

<    1   2   3   4   5   6   7   8   9   10   >