[web2py:12497] Re: PDF manual on Lulu downloaded fine...

2008-11-26 Thread Coalescence

Bought this the other day

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



[web2py:12500] form validation

2008-11-26 Thread mmstud

How would you do such a validation, that when one field is filled, for
should check, that another field is filled also? That means one field
is dependent on another field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12503] Re: form validation

2008-11-26 Thread mdipierro

something like this

db.define_table('t','SQLField('a'),SQLField('b'))
db.t.a.requires=IS_NOT_EMPTY()
db.t.b.requires=IS_EXPR('value==%s' % repr(request.vars.a))

a,b have to be not null and the same.

On Nov 26, 7:02 am, mmstud [EMAIL PROTECTED] wrote:
 How would you do such a validation, that when one field is filled, for
 should check, that another field is filled also? That means one field
 is dependent on another field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12498] Re: PDF manual on Lulu downloaded fine...

2008-11-26 Thread achipa

I must be off of this Earth. It does not have my country in the
list :S

On Nov 26, 12:09 pm, Coalescence [EMAIL PROTECTED] wrote:
 Bought this the other day

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



[web2py:12506] UTF-8 strings are truncated?

2008-11-26 Thread SergeyPo

Hello Group!

When I do in controller:

table=SQLTABLE(db().select(db.data_storage.ALL, limitby=(0,20)),
_class='flexit', _width='100%')
return dict(table = table)

strings that are in database (utf-8 coded) are displayed truncated :
part of the string, than question mark in diamond symbol, than eclipse
(...)

Афанас�...
Балмак�...

etc.

This happens both in my code and in db administration page.
When I do:

print db().select(db.data_storage.ALL, limitby=(0,20))

I get correct strings in Terminal, so data in database is correct.

How to fix that?

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



[web2py:12507] Re: UTF-8 strings are truncated?

2008-11-26 Thread mdipierro

Can you show us a screen shot to make sure I understand?

It is true that SQLTABLE (on purpose) truncates strings to a fix
number of characters. Perhaps this is your problem.

If you need a table that displays long string you should make your own
table

table
  {{ for row in db().select(db.data_storage.ALL, limitby=(0,20)): }}
  tr
{{ for field in db.data_storage_fields:}}
  td{{=row[field]}}/td
{{pass}}
  /tr
  {{pass}}
/table

On Nov 26, 8:13 am, SergeyPo [EMAIL PROTECTED] wrote:
 Hello Group!

 When I do in controller:

 table=SQLTABLE(db().select(db.data_storage.ALL, limitby=(0,20)),
 _class='flexit', _width='100%')
 return dict(table = table)

 strings that are in database (utf-8 coded) are displayed truncated :
 part of the string, than question mark in diamond symbol, than eclipse
 (...)

 Афанас ...
 Балмак ...

 etc.

 This happens both in my code and in db administration page.
 When I do:

 print db().select(db.data_storage.ALL, limitby=(0,20))

 I get correct strings in Terminal, so data in database is correct.

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



[web2py:12509] FORM and select

2008-11-26 Thread annet

In a controller I have got the following code to build a form:

form=FORM('Type een plaatsnaam:',
INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
'Selecteer een activiteit:'
SELECT(_name='training',requires=IS_IN_DB
(db,'training.training','%(training)s')),
INPUT(_type='submit'))


In my model,

db.bedrijftraining.training.requires=IS_IN_DB(db,
'training.training','%(training)s')

results in a drop down list in the admin, I had hoped to achieve the
same in the form above using the following line of code:

SELECT(_name='training',requires=IS_IN_DB(db,'training.training','%
(training)s')),

,however, this line results in an error, does one of you know how to
implement a drop down list in FORM?


Best regards,

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



[web2py:12508] winpdb

2008-11-26 Thread mdipierro

Has anybody tried winpdb with web2py?

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



[web2py:12511] Re: UTF-8 strings are truncated?

2008-11-26 Thread SergeyPo

Here is a screenshot: http://zarealye.com/snapshot.jpg
Here I try to use flexigrid but the same happens with web2py db
administration page.
You will see black diamonds with questionmark...
These are Russian strings (UTF-8) truncated. Is it possible to
increase the length? Is there not a bug in utf-8 truncation?
I guess, simply   ulong russian text[:10] won't work correctly in
utf.



On Nov 26, 5:22 pm, mdipierro [EMAIL PROTECTED] wrote:
 Can you show us a screen shot to make sure I understand?

 It is true that SQLTABLE (on purpose) truncates strings to a fix
 number of characters. Perhaps this is your problem.

 If you need a table that displays long string you should make your own
 table

 table
   {{ for row in db().select(db.data_storage.ALL, limitby=(0,20)): }}
   tr
     {{ for field in db.data_storage_fields:}}
       td{{=row[field]}}/td
     {{pass}}
   /tr
   {{pass}}
 /table

 On Nov 26, 8:13 am, SergeyPo [EMAIL PROTECTED] wrote:

  Hello Group!

  When I do in controller:

      table=SQLTABLE(db().select(db.data_storage.ALL, limitby=(0,20)),
  _class='flexit', _width='100%')
      return dict(table = table)

  strings that are in database (utf-8 coded) are displayed truncated :
  part of the string, than question mark in diamond symbol, than eclipse
  (...)

  Афанас ...
  Балмак ...

  etc.

  This happens both in my code and in db administration page.
  When I do:

      print db().select(db.data_storage.ALL, limitby=(0,20))

  I get correct strings in Terminal, so data in database is correct.

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



[web2py:12512] Re: FORM and select

2008-11-26 Thread mdipierro

FROM is just a helper (makes form.../form) and it is not much
smarter than that. You can use form_factory or

options=[OPTION(k,_value=v) for v,k in db.training.training.options()]

 form=FORM('Type een plaatsnaam:',
 INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
 'Selecteer een activiteit:'
 SELECT(_name='training',requires=IS_IN_DB
 (db,'training.training','%(training)s'),*options),
 INPUT(_type='submit'))


On Nov 26, 8:42 am, annet [EMAIL PROTECTED] wrote:
 In a controller I have got the following code to build a form:

 form=FORM('Type een plaatsnaam:',
 INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
 'Selecteer een activiteit:'
 SELECT(_name='training',requires=IS_IN_DB
 (db,'training.training','%(training)s')),
 INPUT(_type='submit'))

 In my model,

 db.bedrijftraining.training.requires=IS_IN_DB(db,
 'training.training','%(training)s')

 results in a drop down list in the admin, I had hoped to achieve the
 same in the form above using the following line of code:

 SELECT(_name='training',requires=IS_IN_DB(db,'training.training','%
 (training)s')),

 ,however, this line results in an error, does one of you know how to
 implement a drop down list in FORM?

 Best regards,

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



[web2py:12513] Re: Date

2008-11-26 Thread mdipierro

It should not display none because of

{{ if not clubs:}}  {{}}
 h1 No clubs /h1
{{else:}}  {{}}

and you can customize the message.

Massimo

On Nov 26, 8:59 am, annet [EMAIL PROTECTED] wrote:
 One more question on this topic:

 The code above works fine, however, when there are no matching records
 in the database the word 'none' appears where normally the table
 displays the resulting records. I would like a message to appear
 telling the visitor that there are no records in the database that
 match his query parameters. How do I achieve this?

 Best regards,

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



[web2py:12514] Re: UTF-8 strings are truncated?

2008-11-26 Thread mdipierro

It is a bug in the sense that the utf8 is truncated while it should be
converted to unicode, then truncated.
This line in gluon/sqlhtml.py needs to be fixed:

if len(r)truncate: r=r[:truncate-3]+'...'

perhaps replace by

ur=unicode(r,'utf8)
if len(ur)truncate: r=ur[:truncate-3].encode('utf8')
+'...'

Could you give it a try?

Anyway you can change the truncate variable. In  your code:

table=SQLTABLE(db().select(db.data_storage.ALL, limitby=
(0,20)),truncate=100,
_class='flexit', _width='100%')

On Nov 26, 9:07 am, SergeyPo [EMAIL PROTECTED] wrote:
 Here is a screenshot:http://zarealye.com/snapshot.jpg
 Here I try to use flexigrid but the same happens with web2py db
 administration page.
 You will see black diamonds with questionmark...
 These are Russian strings (UTF-8) truncated. Is it possible to
 increase the length? Is there not a bug in utf-8 truncation?
 I guess, simply   ulong russian text[:10] won't work correctly in
 utf.

 On Nov 26, 5:22 pm, mdipierro [EMAIL PROTECTED] wrote:

  Can you show us a screen shot to make sure I understand?

  It is true that SQLTABLE (on purpose) truncates strings to a fix
  number of characters. Perhaps this is your problem.

  If you need a table that displays long string you should make your own
  table

  table
{{ for row in db().select(db.data_storage.ALL, limitby=(0,20)): }}
tr
  {{ for field in db.data_storage_fields:}}
td{{=row[field]}}/td
  {{pass}}
/tr
{{pass}}
  /table

  On Nov 26, 8:13 am, SergeyPo [EMAIL PROTECTED] wrote:

   Hello Group!

   When I do in controller:

   table=SQLTABLE(db().select(db.data_storage.ALL, limitby=(0,20)),
   _class='flexit', _width='100%')
   return dict(table = table)

   strings that are in database (utf-8 coded) are displayed truncated :
   part of the string, than question mark in diamond symbol, than eclipse
   (...)

   Афанас ...
   Балмак ...

   etc.

   This happens both in my code and in db administration page.
   When I do:

   print db().select(db.data_storage.ALL, limitby=(0,20))

   I get correct strings in Terminal, so data in database is correct.

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



[web2py:12516] Re: UTF-8 strings are truncated?

2008-11-26 Thread SergeyPo

This worked:

ur=unicode(r,'utf8')
if len(ur)truncate: r=ur[:truncate-3].encode('utf8') + '...'

Thank you!

On Nov 26, 6:18 pm, mdipierro [EMAIL PROTECTED] wrote:
 It is a bug in the sense that the utf8 is truncated while it should be
 converted to unicode, then truncated.
 This line in gluon/sqlhtml.py needs to be fixed:

                 if len(r)truncate: r=r[:truncate-3]+'...'

 perhaps replace by

                 ur=unicode(r,'utf8)
                 if len(ur)truncate: r=ur[:truncate-3].encode('utf8')
 +'...'

 Could you give it a try?

 Anyway you can change the truncate variable. In  your code:

     table=SQLTABLE(db().select(db.data_storage.ALL, limitby=
 (0,20)),truncate=100,
 _class='flexit', _width='100%')

 On Nov 26, 9:07 am, SergeyPo [EMAIL PROTECTED] wrote:

  Here is a screenshot:http://zarealye.com/snapshot.jpg
  Here I try to use flexigrid but the same happens with web2py db
  administration page.
  You will see black diamonds with questionmark...
  These are Russian strings (UTF-8) truncated. Is it possible to
  increase the length? Is there not a bug in utf-8 truncation?
  I guess, simply   ulong russian text[:10] won't work correctly in
  utf.

  On Nov 26, 5:22 pm, mdipierro [EMAIL PROTECTED] wrote:

   Can you show us a screen shot to make sure I understand?

   It is true that SQLTABLE (on purpose) truncates strings to a fix
   number of characters. Perhaps this is your problem.

   If you need a table that displays long string you should make your own
   table

   table
     {{ for row in db().select(db.data_storage.ALL, limitby=(0,20)): }}
     tr
       {{ for field in db.data_storage_fields:}}
         td{{=row[field]}}/td
       {{pass}}
     /tr
     {{pass}}
   /table

   On Nov 26, 8:13 am, SergeyPo [EMAIL PROTECTED] wrote:

Hello Group!

When I do in controller:

    table=SQLTABLE(db().select(db.data_storage.ALL, limitby=(0,20)),
_class='flexit', _width='100%')
    return dict(table = table)

strings that are in database (utf-8 coded) are displayed truncated :
part of the string, than question mark in diamond symbol, than eclipse
(...)

Афанас ...
Балмак ...

etc.

This happens both in my code and in db administration page.
When I do:

    print db().select(db.data_storage.ALL, limitby=(0,20))

I get correct strings in Terminal, so data in database is correct.

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



[web2py:12515] Re: your recommended way of calling controllers from the command line ?

2008-11-26 Thread Yarko

Hi Jonathan -

Could you write this up?  Some (me?!) might find it interesting / useful.

Thank you.

Yarko 

-Original Message-
From: Jonathan Benn [EMAIL PROTECTED]
Sent: Wednesday, November 26, 2008 6:55 AM
To: web2py Web Framework web2py@googlegroups.com
Subject: [web2py:12499] Re: your recommended way of calling controllers from 
the command line  ?


Hi Achipa,


On Nov 25, 1:55 pm, achipa [EMAIL PROTECTED] wrote:
 The subject says it all. I know a couple of methods (python -R
 wrapper, the older -S patch, piping, etc), but was wondering which you
 think is the cleanest (and cross platform) as I'd like to integrate it
 into my cron patch (so you could specify controllers/functions in your
 crontab file, not just executables).

I run into this problem a lot, because on GAE I can only make db calls
to a running server. So for example, if for an automated test suite I
need to modify the database, I can't do this directly from an outside
testing Python script.

My solution is to create test controller actions that modify the db,
and then expose them via XMLRPC. It works like a charm and makes the
functions very easy to execute from any arbitrary Python script.

--Jonathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]

[The entire original message is not included]

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



[web2py:12517] Re: Date

2008-11-26 Thread annet

Massimo,

I am afraid, I did not fully understand your former reply then.

This is the controller:

def byplace():
response.view='clubs/view.html'
response.functionname=T('Club locator op plaats')
form=FORM('Type een plaatsnaam:',
INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
INPUT(_type='submit'))
if form.accepts(request.vars,session):
clubs=db((db.bedrijf.id==db.adres.bedrijf)
(db.bedrijf.id==db.bedrijfbranche.bedrijf)\
(db.adres.plaatsnaam==request.vars.plaatsnaam)
(db.adres.adressoort==2)(db.bedrijfbranche.branche==2))\
.select
(db.bedrijf.id,db.bedrijf.bedrijfsnaam,db.bedrijf.ranking,db.adres.straatnaam,
\
orderby=db.bedrijf.ranking|db.bedrijf.bedrijfsnaam)
else:
response.message='Formuleer een zoekopdracht'
clubs=[]
return dict(form=form,clubs=clubs)


and this the view:

div id=grid2columns
div id=leftcolumn
{{=form}}
{{include 'functionnavigation.html'}}
/div !-- leftcolumn --
div id=mainright
div id=dt_example
{{if not clubs:}}
p class=message
{{=response.message}}
/p !-- message --
{{else:}}
table id=example class=display
thead
tr
thbedrijfsnaam/th
thstraatnaam/th
/tr
/thead
tbody
{{for club in clubs:}}
tr
td{{=A
(club.bedrijf.bedrijfsnaam,_href=URL(r=request,f='clubdetails',
args=[club.bedrijf.id]),_target=_blank)}}/td
td{{=club.adres.straatnaam}}/td
/tr
{{pass}}
/tbody
/table
{{pass}}
/div !-- dt_example --
/div !-- mainright --
/div !-- grid2columns --


When the page is rendered for the first time, the message in
response.message is displayed. When the visitor enters a city and
clicks the submit button one of two things happens: if there are clubs
in the city the visitor entered the clubs are displayed in the table,
if there are no clubs in the city the visitor entered the word 'none'
is displayed. I expected response.message to be displayed instead of
none, but it isn't. I hope providing you with the code, helps solve
this problem.


Best regards,

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



[web2py:12518] How to download archive dumps?

2008-11-26 Thread Snaky Love

Hi, I am just digging into web2py - what I see now is really very
exciting!

I would like to download the group archives, but I could not find a
way to do it... isn´t there a tar.gz mbox file or anything similar to
download anywhere? That would help very much understanding past
discussions.

Thanks!

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



[web2py:12520] Re: Date

2008-11-26 Thread mdipierro

you can either set a value of response.message in the if accepts(...)
or you can do

{{=response.message or Say something here}}

On Nov 26, 10:22 am, annet [EMAIL PROTECTED] wrote:
 Massimo,

 I am afraid, I did not fully understand your former reply then.

 This is the controller:

 def byplace():
 response.view='clubs/view.html'
 response.functionname=T('Club locator op plaats')
 form=FORM('Type een plaatsnaam:',
 INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
 INPUT(_type='submit'))
 if form.accepts(request.vars,session):
 clubs=db((db.bedrijf.id==db.adres.bedrijf)
 (db.bedrijf.id==db.bedrijfbranche.bedrijf)\
 (db.adres.plaatsnaam==request.vars.plaatsnaam)
 (db.adres.adressoort==2)(db.bedrijfbranche.branche==2))\
 .select
 (db.bedrijf.id,db.bedrijf.bedrijfsnaam,db.bedrijf.ranking,db.adres.straatnaam,
 \
 orderby=db.bedrijf.ranking|db.bedrijf.bedrijfsnaam)
 else:
 response.message='Formuleer een zoekopdracht'
 clubs=[]
 return dict(form=form,clubs=clubs)

 and this the view:

 div id=grid2columns
 div id=leftcolumn
 {{=form}}
 {{include 'functionnavigation.html'}}
 /div !-- leftcolumn --
 div id=mainright
 div id=dt_example
 {{if not clubs:}}
 p class=message
 {{=response.message}}
 /p !-- message --
 {{else:}}
 table id=example class=display
 thead
 tr
 thbedrijfsnaam/th
 thstraatnaam/th
 /tr
 /thead
 tbody
 {{for club in clubs:}}
 tr
 td{{=A
 (club.bedrijf.bedrijfsnaam,_href=URL(r=request,f='clubdetails',
 args=[club.bedrijf.id]),_target=_blank)}}/td
 td{{=club.adres.straatnaam}}/td
 /tr
 {{pass}}
 /tbody
 /table
 {{pass}}
 /div !-- dt_example --
 /div !-- mainright --
 /div !-- grid2columns --

 When the page is rendered for the first time, the message in
 response.message is displayed. When the visitor enters a city and
 clicks the submit button one of two things happens: if there are clubs
 in the city the visitor entered the clubs are displayed in the table,
 if there are no clubs in the city the visitor entered the word 'none'
 is displayed. I expected response.message to be displayed instead of
 none, but it isn't. I hope providing you with the code, helps solve
 this problem.

 Best regards,

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



[web2py:12521] Re: How to download archive dumps?

2008-11-26 Thread mdipierro

Good point. That would be useful but I cannot find any way to do it
from the google groups management interface.

Massimo

On Nov 26, 9:43 am, Snaky Love [EMAIL PROTECTED] wrote:
 Hi, I am just digging into web2py - what I see now is really very
 exciting!

 I would like to download the group archives, but I could not find a
 way to do it... isn´t there a tar.gz mbox file or anything similar to
 download anywhere? That would help very much understanding past
 discussions.

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



[web2py:12522] Re: form validation

2008-11-26 Thread DenesL

mmstud, you can do:

if request.vars.a:
db.t.b.requires=IS_NOT_EMPTY()

before you create the form in the controller.

On Nov 26, 8:02 am, mmstud [EMAIL PROTECTED] wrote:
 How would you do such a validation, that when one field is filled, for
 should check, that another field is filled also? That means one field
 is dependent on another field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12524] Re: initial table data ?

2008-11-26 Thread achipa

...another issue is that you cannot delete all the rows from such
table as you will trigger the defaults reload.

On Nov 21, 7:45 pm, achipa [EMAIL PROTECTED] wrote:
 Yes, I use something similar ATM, but I'm concerned about the overhead
 if you have a large number of tables...

 On Nov 21, 7:26 pm, mdipierro [EMAIL PROTECTED] wrote:

  if not db(db.table.id0).count(): db.table.import_from_csv_file(open
  ('mytable.csv'))

  Massimo

  On Nov 21, 12:24 pm, achipa [EMAIL PROTECTED] wrote:

   We have talked about this previously, but the CSV import/export in the
   previous topic reminded me - wouldn't it be nice to have a sort of
   SQLDefaultData('mytable.csv') entry in the model, which would contain
   the default contents of the table ? If the migrator decides it needs
   to create the table, it could just fill it up with the values from the
   file (loading from code or the model file is not that elegant as it
   doesn't know if the tables has been just created or already there and
   just got empty via user interaction). Or does this sort of
   functionality already exist and I just somehow missed it ? :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12525] Re: Join + Update a field

2008-11-26 Thread Tito Garrido
Hey DenisL,

What about the update method?
db((db.character.id==1)(db.character.id
==db.characterHasAttribute.id_character)(db.characterHasAttribute.id_attribute==3)).update(characterHasAttribute.total_value=2)

Doesn't work...

On Wed, Nov 26, 2008 at 10:36 AM, Tito Garrido [EMAIL PROTECTED]wrote:

 Oh, thanks DenesL. I did a dir(new) but I didn't notice that :)

 Thanks!


 On Tue, Nov 25, 2008 at 10:27 PM, DenesL [EMAIL PROTECTED] wrote:


 Tito,

 change:
 new.update_record(characterHasAttribute.total_value=2)

 to:
 new.characterHasAttribute.update_record(total_value=2)

 Do a dir(new) and you will see why.

 



 --
 Linux User #387870
 .
  _/_õ|__|
 ..º[ .-.___.-._| . . . .
 .__( o)__( o).:___




-- 
Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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



[web2py:12526] Re: Join + Update a field

2008-11-26 Thread mdipierro

You cannot update the result of a JOIN.

On Nov 26, 5:55 pm, Tito Garrido [EMAIL PROTECTED] wrote:
 Hey DenisL,

 What about the update method?
 db((db.character.id==1)(db.character.id
 ==db.characterHasAttribute.id_character)(db.characterHasAttribute.id_attribute==3)).update(characterHasAttribute.total_value=2)

 Doesn't work...

 On Wed, Nov 26, 2008 at 10:36 AM, Tito Garrido [EMAIL PROTECTED]wrote:



  Oh, thanks DenesL. I did a dir(new) but I didn't notice that :)

  Thanks!

  On Tue, Nov 25, 2008 at 10:27 PM, DenesL [EMAIL PROTECTED] wrote:

  Tito,

  change:
  new.update_record(characterHasAttribute.total_value=2)

  to:
  new.characterHasAttribute.update_record(total_value=2)

  Do a dir(new) and you will see why.

  --
  Linux User #387870
  .
   _/_õ|__|
  ..º[ .-.___.-._| . . . .
  .__( o)__( o).:___

 --
 Linux User #387870
 .
  _/_õ|__|
 ..º[ .-.___.-._| . . . .
 .__( o)__( o).:___
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12527] Re: manual

2008-11-26 Thread Tito Garrido
Brazil :)

On Wed, Nov 26, 2008 at 10:29 AM, Massimo Di Pierro [EMAIL PROTECTED]
 wrote:


 In which country are you?

 Massimo

 



-- 
Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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



[web2py:12528] Re: Join + Update a field

2008-11-26 Thread Tito Garrido
Thank you Massimo.

On Wed, Nov 26, 2008 at 10:17 PM, mdipierro [EMAIL PROTECTED] wrote:


 You cannot update the result of a JOIN.

 On Nov 26, 5:55 pm, Tito Garrido [EMAIL PROTECTED] wrote:
  Hey DenisL,
 
  What about the update method?
  db((db.character.id==1)(db.character.id
 
 ==db.characterHasAttribute.id_character)(db.characterHasAttribute.id_attribute==3)).update(characterHasAttribute.total_value=2)
 
  Doesn't work...
 
  On Wed, Nov 26, 2008 at 10:36 AM, Tito Garrido [EMAIL PROTECTED]
 wrote:
 
 
 
   Oh, thanks DenesL. I did a dir(new) but I didn't notice that :)
 
   Thanks!
 
   On Tue, Nov 25, 2008 at 10:27 PM, DenesL [EMAIL PROTECTED] wrote:
 
   Tito,
 
   change:
   new.update_record(characterHasAttribute.total_value=2)
 
   to:
   new.characterHasAttribute.update_record(total_value=2)
 
   Do a dir(new) and you will see why.
 
   --
   Linux User #387870
   .
    _/_õ|__|
   ..º[ .-.___.-._| . . . .
   .__( o)__( o).:___
 
  --
  Linux User #387870
  .
   _/_õ|__|
  ..º[ .-.___.-._| . . . .
  .__( o)__( o).:___
 



-- 
Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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



[web2py:12529] Re: manual

2008-11-26 Thread Zoom . Quiet
China 中国
;-)

2008/11/26 Massimo Di Pierro [EMAIL PROTECTED]:

 In which country are you?

 Massimo




-- 
http://zoomquiet.org'''
过程改进乃是催生可促生靠谱的人的组织!
PE keeps evolving organizations which promoting people be good!'''
[HR]金山软件常年招聘大量Py/C++人才!
https://groups.google.com/group/python-cn/web/ot-py-c
简历直投俺就好;-)

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



[web2py:12530] Field alias

2008-11-26 Thread Tari

I thought I'd go ahead and ask, and stop googling in vain...

Is there a way to rename a field in a select, e.g. as in

SELECT SUM(column1) + SUM(column2) AS shortname ...

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



[web2py:12532] non-ascii chars URL

2008-11-26 Thread jessinio

my project want web2py support non-ascii char URL, example:

http://127.0.0.1:8000/welcome/default/index/中国

because the URL have chinese's char , so web2py will report : Invalid
request

resolve:

edit gluon/main.py file, diff output:

39c39
 regex_url=re.compile('(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?:^(\w+/)
{2}\w+/?$)|(?:^(\w+/){2}\w+(/[\w\-]+(\.[\w\-]+)*)+$)|(?:^(\w+)/static(/
[\w\-]+(\.[\w\-]+)*)+$)')
---
 regex_url=re.compile('(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?:^(\w+/){2}\w+/?$)|(?:^(\w+/){2}\w+(/[\w\-]+(\.[\w\-]+)*)+$)|(?:^(\w+)/static(/[\w\-]+(\.[\w\-]+)*)+$)',re.U)
127a128
 path = unicode(path, utf8)
130a132,136
 temp = []
 for i in items:
 i = i.encode(utf8)
 temp.append(i)
 items = temp


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



[web2py:12537] Re: help please...

2008-11-26 Thread Zoom . Quiet
2008/11/27 Zoom. Quiet [EMAIL PROTECTED]:
 2008/11/27 mdipierro [EMAIL PROTECTED]:

 If you asked a question and you found an useful answer (posted by me
 or not), please create an entry about it on AlterEgo.

 http://mdp.cti.depaul.edu/AlterEgo/default/add

 COOL! web2py KnowledgeBase!

BTW:
can sharing AlterEgo into
http://mdp.cti.depaul.edu/appliances

???

 we try collection us experience into

 We are working to move to a better system.

 Massimo




-- 
http://zoomquiet.org'''
过程改进乃是催生可促生靠谱的人的组织!
PE keeps evolving organizations which promoting people be good!'''
[HR]金山软件常年招聘大量Py/C++人才!
https://groups.google.com/group/python-cn/web/ot-py-c
简历直投俺就好;-)

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



[web2py:12538] Re: non-ascii chars URL

2008-11-26 Thread jessinio liang
2008/11/27 mdipierro [EMAIL PROTECTED]


 Thank you Jessinio,

 could you please email me the patch as an attachment? I cannot read it
 properly.

 Does anybody have any objection to this patch?


sorry , i don't know , i know it work well (^_^)

see diff file attachment






-- 
身体是革命的本钱!!
http://jessinio.blogspot.com

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

--- /tmp/web2py-read-only/gluon/main.py	2008-11-27 09:45:52.0 +0800
+++ /home/jessinio/download/web2py/gluon/main.py	2008-11-27 11:35:10.0 +0800
@@ -36,7 +36,7 @@
 
 ### Security Checks: validate URL and session_id here, accept_language is validated in languages
 # pattern to find valid paths in url /application/controller/...
-regex_url=re.compile('(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?:^(\w+/){2}\w+/?$)|(?:^(\w+/){2}\w+(/[\w\-]+(\.[\w\-]+)*)+$)|(?:^(\w+)/static(/[\w\-]+(\.[\w\-]+)*)+$)')
+regex_url=re.compile('(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?:^(\w+/){2}\w+/?$)|(?:^(\w+/){2}\w+(/[\w\-]+(\.[\w\-]+)*)+$)|(?:^(\w+)/static(/[\w\-]+(\.[\w\-]+)*)+$)',re.U)
 # patter used to validate client address
 regex_client=re.compile('[\w\-]+(\.[\w\-]+)*\.?')
 
@@ -125,8 +125,10 @@
 if len(items)1: request.env.query_string=items[1]
 else: request.env.query_string=''
 path=request.env.path_info[1:].replace('\\','/')
+path = unicode(path, utf8)
 if not regex_url.match(path):
 raise HTTP(400,error_message,web2py_error='invalid path')
+path = path.encode('utf8')
 items=path.split('/')
 ###
 # serve if a static file


[web2py:12542] Re: non-ascii chars URL

2008-11-26 Thread mdipierro

I am not sure. This needs a lot of testing.

On Nov 26, 10:00 pm, jessinio liang [EMAIL PROTECTED] wrote:
 On Thu, Nov 27, 2008 at 11:55 AM, mdipierro [EMAIL PROTECTED] wrote:

  The question is:

  Assume a url likehttp://hostname/app/default/action/data

  and data is in unicode and passes validation.
  is it safe to open(data,'r')   ?

 i change the path( string object ) to unicode before regex_url.match(path) ,
 change it back utf8 after regex_url.match(path), so, it's safe to open
 function.

 right? (^_^)





  On Nov 26, 9:41 pm, jessinio liang [EMAIL PROTECTED] wrote:
   2008/11/27 mdipierro [EMAIL PROTECTED]

Thank you Jessinio,

could you please email me the patch as an attachment? I cannot read it
properly.

Does anybody have any objection to this patch?

   sorry , i don't know , i know it work well (^_^)

   see diff file attachment

   --
   身体是革命的本钱!!http://jessinio.blogspot.com

diff.log
   1KViewDownload

 --
 身体是革命的本钱!!http://jessinio.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12545] t2 static and wsgi

2008-11-26 Thread Wes James

I finally got wsgi working (osx 10.5) and wanted to mention that the
t2 static pages work fine with wsgi vs, with mod_rewrite I had to
create a folder under apache root docs with t2 statics.  I like wsgi
better :)

-wj

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



[web2py:12546] Re: input type

2008-11-26 Thread somebody

so i cannot choose my own directory to save my file..
ok



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



[web2py:12547] create a drop down list in form

2008-11-26 Thread somebody

Is it possible to create a drop down list which listed sql value in
form without any button.. jus pure drop down list..

i have a a drop down list but do not know for what reason there is a
summit button which i do not want..

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