[web2py] Re: syntax checker won't let me save this

2010-12-23 Thread rāma
Simple mistake. Sorry!

On Dec 23, 2:05 pm, rāma ranjeev...@gmail.com wrote:
 I tried to construct a validator:

 db.sender.keywords.requires = IS_IN_DB(db( db.auth_user.id=user_id ),
 db.userkeywords.keyword)

 I was able to do this in previous versions.

 Please help.


[web2py] Re: The stability of web2py releases

2010-12-23 Thread cjrh
On Dec 22, 6:05 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 What I do is if my app works with a certain version, I don't ever upgrade
 the web2py unless I need a brand new feature or bugfix that effects me.

+1.  If you don't need anything new, no point in upgrading.


[web2py] Re: The stability of web2py releases

2010-12-23 Thread cjrh
On Dec 22, 9:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 We can change the name. It is not truly a nigthly built. it is closer
 to a release candidate even if the final release is not equivalent to
 the latest nightly built.

You should definitely change the name from nightly to release
candidate.  In many other open-source projects, the quality of
nightly builds is so random as be almost completely useless.   People
often just use nightly's to confirm whether the project compiles, or
to see which automated tests failed.

Release candidates are the things that get tested, not nightly's.


[web2py] Re: Great summary of web2py

2010-12-23 Thread cjrh
On Dec 23, 8:55 am, mdipierro mdipie...@cs.depaul.edu wrote:
 +1

 I think we should go after PHP, ASP, JSP

I think you shouldn't care.  Just inject as much quality into web2py
as possible, don't worry about the competition.  I would actually
prefer that the hordes of PHP, ASP and JSP developers not join my
beloved web2py, thank you very much :)


Re: [web2py] Re: Great summary of web2py

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 4:16 AM, VP vtp2...@gmail.com wrote:
 I've supported web2py for a long time.  But I think it's time to
 rethink about PR. Frankly, I think this Flask/Django business is a
 distraction.  I think Massimo should completely ignore and do not say
 anything about Flask or Django.

Where did THIS come from? Django is mentioned once by an asker Is
this a good framework to start with? Was looking at web.py, but this
looks more complex yet not as django does., and once in a response
Web2py is much easier to learn than Django and offers much more
productivity than web.py.. Flask isn't mentioned at all. Or am I
missing something?

In the summary, also no mention of Django or Flask.

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread cjrh
On Dec 23, 2:04 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I can add a try except so that web2py does not tries to compute fields
 when there is not enough information. The downside is that a typo will
 result in a silent failure to compute. Perhaps we should do this
 anyway.

If you're going to be doing work in the area of compute anyway, is
there a posssibility of making another change that the current value
of the compute-ed field can be passed to the compute method?


Re: [web2py] another funtion in view

2010-12-23 Thread Arun K.Rajeevan
Is it that, you need the view index.html to render the results from both 
view and index controller?

In that case,
within index.html use ajax LOAD function to get content of view.html.
here, view.html doesn't have to extend layout.html.


Re: [web2py] Re: Sharing sessions and authentication

2010-12-23 Thread Marin Pranjic
Key was the same in app1, app2 ,and app3, but not in shared (don't
know why).
I've set the same key in all apps and it seems to be working now.

Thanks!

On Thu, Dec 23, 2010 at 7:57 AM, mdipierro mdipie...@cs.depaul.edu wrote:

 Yes if they are providing registration/login/change password. If only
 one app provides registration/login/change password than it does not
 need to be the same.

 On Dec 23, 12:31 am, ron_m ron.mco...@gmail.com wrote:
  Would this key have to be the same in all applications?
 
  auth.settings.hmac_key = 'sha512:63f0a5e7-e395-4a28-8488-cf072a0464b6'
 #
  before define_tables()
 
  not the same as this particular one but consistent across all of the
  applications you have since you are sharing your auth_user table and this
  key is used to encrypt the password field of the table.
 
  This line is in the original models/db.py file of the application.
 
  Ron



Re: [web2py] Merry Christmas

2010-12-23 Thread Stef Mientki
+1,

btw, what a nice signature !!
cheers,
Stef
On 23-12-2010 08:17, ? Kuldeep Singh PHP FreeLancer Web Developer,SEO 
Services wrote:
 Marry Christmas to all of you ...From Kaysellers.com

 On 23 December 2010 12:40, ma...@rockiger.com mailto:ma...@rockiger.com 
 rocki...@googlemail.com
 mailto:rocki...@googlemail.com wrote:

 Merry Christmas and a happy new your to all you web2py-contributors.

 You do an awesome work - everyone.


 Marco




 -- 
 Kuldeep Singh...
 WebDeveloper And Freelancer Kay Sellers,
 Owner:http://kaysellers.com
 +9199142-41733,*+91-9501710226(Allways Switched On)*
 Skype ID : kaydeveloper
 Yahoo:deepulove123321
 On Twitter:http://twitter.com/ruhisoftect
 We Provide:-
 Adobe AIR,E-Commerce PHP Web and Desktop Applications,Wordpress
 Themes,Drupal Themes,Joomla Templates,Joomla Components Modules
 Plugins,Java,ERP,MLM Development and Logic Design,Ajax,Jquery,RSS
 Feeds,PhotoShop,Flex,Payment Solutions.





[web2py] App admin error

2010-12-23 Thread Arun K.Rajeevan
I've following in model

db.define_table('languages',
Field 
http://127.0.0.1:8000/examples/global/vars/Field('full', 'string', length=30, 
notnull=True, required=True),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('short', 'string', length=10 
, notnull=True, required=True),
format='%(full)s - %(short)s')

db.define_table('words',
Field 
http://127.0.0.1:8000/examples/global/vars/Field('word', 'string', 
notnull=True, required=True),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('lang', db.languages, 
notnull=True, readable=False, writable=False),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('entry_by', db.auth_user, 
notnull=True, readable=False, writable=False))

db.define_table('pictures',
Field 
http://127.0.0.1:8000/examples/global/vars/Field('image', 'upload', 
notnull=True, required=True, label='Visual Lingua'),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('word', 'list:reference 
words', readable=False, writable=False, required=True),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('total', 'integer', 
notnull=True, readable=False, writable=False, default=2),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('clicks', 'integer', 
notnull=True, readable=False, writable=False, default=1),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('rating', 'double', 
notnull=True, readable=False, writable=False, compute=lambda row: 
row['total']/row['clicks']),
Field 
http://127.0.0.1:8000/examples/global/vars/Field('entry_by', db.auth_user, 
notnull=True, readable=False, writable=False))
'''
db.define_table('symbolize',
Field('image', db.pictures, notnull=True, readable=False, 
writable=False, required=True ),
Field('word', db.words, notnull=True, readable=False, 
writable=False, required=True))
'''  



I got following error when I select table '*pictures*' on appadmin.
Isn't that an error?
Other table's pages are rendered correct.

Version  web2py™ Version 1.91.4 (2010-12-22 17:31:23)  Python Python 2.5.1: 
C:\Python25\python.exe  Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\restricted.py,
 line 188, in restricted
exec ccode in environment
  File 
I:/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/applications/init/views/appadmin.html
 http://127.0.0.1:8000/admin/default/edit/init/views/appadmin.html, line 165, 
in module
p
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\sqlhtml.py,
 line 1329, in __init__
r = field.represent(r)
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\dal.py,
 line 3012, in list_ref_repr
return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')
TypeError: sequence item 0: expected string, int found

 Error snapshot [image: help] Detailed traceback description 

type 'exceptions.TypeError'(sequence item 0: expected string, int found)


Function argument list 

(ids=[2], r=Table {'lang': gluon.dal.Field object at 0x021..., 'id': 
gluon.dal.Field object at 0x021B8550}, f=function ff at 0x021C4430)
 Code listing 

3007.
3008.
3009.
3010.
3011.
3012.

3013.
3014.
3015.
3016.

field_type.find('.')  0 and \
field_type[15:] in field.db.tables:
referenced = field.db[field_type[15:]]
def list_ref_repr(ids, r=referenced, f=ff):
refs = r._db(r.id.belongs(ids)).select(r.id)
return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')

field.represent = list_ref_repr
if hasattr(referenced, '_format') and referenced._format:
requires = validators.IS_IN_DB(field.db,referenced.id,
   referenced._format,multiple=True)

 Variables ', '.join undefined  f function ff at 0x021C4430  refs 
gluon.dal.Rows 
object at 0x020A94D0  ids [2]  r Table {'lang': gluon.dal.Field object at 
0x021..., 'id': gluon.dal.Field object at 0x021B8550}  ref undefined




[web2py] Re: customizing registration layout

2010-12-23 Thread Plumo
OK, so there isn't a better way than half a year back.

Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread rochacbruno
You need to edit /static/CSS/base.css

The form and imputs width is defined there. 

Enviado via iPhone

Em 23/12/2010, às 09:38, Sahil Arora sahilarora...@gmail.com escreveu:

 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox 
 field to the right of it 
 
 
 {{=form.custom.begin}}
 table
 
 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription 
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time 
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
  /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table
 
 {{=form.custom.end}}
 
 -- 
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046
 Screenshot-2.png


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Sahil Arora
but i want only a particular field size to be decreased not all. Is
there any other alternative?

On 12/23/10, rochacbruno rochacbr...@gmail.com wrote:
 You need to edit /static/CSS/base.css

 The form and imputs width is defined there.

 Enviado via iPhone

 Em 23/12/2010, às 09:38, Sahil Arora sahilarora...@gmail.com escreveu:

 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 table

 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
 /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046
 Screenshot-2.png



-- 
Sahil Arora
B.Tech 2nd year
Computer Science and Engineering
IIT Delhi
Contact No: +91 9871491046


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Arun K.Rajeevan
add a new css rule in /static/CSS/base.css than editing what's already 
there.
So will render elements properly in other parts of page


[web2py] Field type problem in SQLFORM.factory in 1.91.4 possible before

2010-12-23 Thread szimszon
In SQLFORM.factory's Field field:

Field( 'user_id', db.auth_user,
  label = 'Felhasználó e-mail',
  requires = IS_NULL_OR( IS_IN_DB( db, db.auth_user.id, '%
(first_name)s' ) ) ),

But works in 1.79.2 and seems to work if I use 'integer' and not
db.auth_user




I have

db.define_table( 'auth_user',
Field( 'id', 'id',
  represent = lambda id:SPAN( id, ' ', A( 'view', _href =
URL( 'auth_user_read', args = id ) ) ) ),
Field( 'username', type = 'string',
  label = T( 'Username' ) ),
Field( 'first_name', type = 'string',
  label = T( 'First Name' ) ),
Field( 'last_name', type = 'string',
  label = T( 'Last Name' ) ),
Field( 'email', type = 'string',
  label = T( 'Email' ) ),
Field( 'password', type = 'password',
  readable = False,
  label = T( 'Password' ) ),
Field( 'created_on', 'datetime', default = request.now,
  label = T( 'Created On' ), writable = False, readable =
False ),
Field( 'modified_on', 'datetime', default = request.now,
  label = T( 'Modified On' ), writable = False, readable =
False,
  update = request.now ),
Field( 'registration_key', default = '',
  writable = False, readable = False ),
Field( 'reset_password_key', default = '',
  writable = False, readable = False ),
Field( 'registration_id', default = '',
  writable = False, readable = False ),
format = '%(username)s',
migrate = settings.migrate )

auth.define_tables( migrate = settings.migrate )


Traceback:

Traceback (most recent call last):
  File /home/szimszon_nfs/web2py/gluon/restricted.py, line 188, in
restricted
exec ccode in environment
  File /home/szimszon_nfs/web2py/applications/reboot/controllers/
default.py, line 113, in module
  File /home/szimszon_nfs/web2py/gluon/globals.py, line 95, in
lambda
self._caller = lambda f: f()
  File /home/szimszon_nfs/web2py/gluon/tools.py, line 2292, in f
return action(*a, **b)
  File /home/szimszon_nfs/web2py/applications/reboot/controllers/
default.py, line 90, in logok
label = 'Leírás', ),
  File /home/szimszon_nfs/web2py/gluon/sqlhtml.py, line 1182, in
factory
return SQLFORM(SQLDB(None).define_table(table_name, *fields),
  File /home/szimszon_nfs/web2py/gluon/dal.py, line 3314, in
define_table
t._create_references()
  File /home/szimszon_nfs/web2py/gluon/dal.py, line 3607, in
_create_references
rtable = self._db[rtablename]
  File /home/szimszon_nfs/web2py/gluon/dal.py, line 3335, in
__getitem__
return dict.__getitem__(self, str(key))
KeyError: 'auth_user'

type 'exceptions.KeyError'('auth_user')

builtinstr  type 'str'
selfDAL {'_lastsql': '', '_db_codec': 'UTF-8', 'no_..._uri': None,
'_migrate': False, '_pool_size': 0}
dict.__getitem__method '__getitem__' of 'dict' objects
builtindict type 'dict'
key 'auth_user'

def __iter__(self):
for tablename in self.tables:
yield self[tablename]

def __getitem__(self, key):
return dict.__getitem__(self, str(key))


def __setitem__(self, key, value):
dict.__setitem__(self, str(key), value)


[web2py] export_to_csv_file and colnames

2010-12-23 Thread howesc
Massimo and crew,

I am trying to use export_to_csv_file() on a rows object with the colnames 
parameter on google app engine.  it turns out that the method (in both 
sql.py and the new dal.py) outputs the proper column names, but then outputs 
data for every column in the table.

the culprit is on line 4741 of dal.py (from trunk):
for col in self.colnames:
should be
for col in colnames:

and then, so long as the user's colnames are in the format 
'table_name.field_name' it works as desired (at least from my 
perspective).

does this sounds correct?  if so, do you mind adding it to trunk?

thanks!

christian



Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Martín Mulone
Can you show me the source html of this form generated?

2010/12/23 Sahil Arora sahilarora...@gmail.com:
 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 table

 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
 /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


Re: [web2py] Merry Christmas

2010-12-23 Thread Martín Mulone
Merry Christmas and a happy new to the group.

2010/12/23 Stef Mientki stef.mien...@gmail.com:
 +1,

 btw, what a nice signature !!
 cheers,
 Stef
 On 23-12-2010 08:17, ⎝⏠⏝⏠⎠ Kuldeep Singh PHP FreeLancer Web Developer,SEO
 Services wrote:

 Marry Christmas to all of you ...From Kaysellers.com

 On 23 December 2010 12:40, ma...@rockiger.com rocki...@googlemail.com
 wrote:

 Merry Christmas and a happy new your to all you web2py-contributors.
 You do an awesome work - everyone.

 Marco


 --
 Kuldeep Singh...
 WebDeveloper And Freelancer Kay Sellers,
 Owner:http://kaysellers.com
 +9199142-41733,*+91-9501710226(Allways Switched On)*
 Skype ID : kaydeveloper
 Yahoo:deepulove123321
 On Twitter:http://twitter.com/ruhisoftect
 We Provide:-
 Adobe AIR,E-Commerce PHP Web and Desktop Applications,Wordpress
 Themes,Drupal Themes,Joomla Templates,Joomla Components Modules
 Plugins,Java,ERP,MLM Development and Logic Design,Ajax,Jquery,RSS
 Feeds,PhotoShop,Flex,Payment Solutions.







-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


[web2py] New to web2py

2010-12-23 Thread Monte Milanuk

Hello all,

New guy here... I've been looking all over the web for something that
meets all the needs of a couple projects I want to do, and it looks like
web2py will just about cover them!

I'm getting my feet wet with the examples, and got sidetracked ;) by the
gae sql designer - holy cow that thing is sweet, not too complicated,
just right!  I was noticing that it seems to use the old DAL language of
'SQLField' instead of 'Field' for the table definitions... is there an
update or change in the works for that?

Also... maybe my understanding of foreign keys as used in web2py (or at 
least the gae sql designer) is not up to snuff... it seems like this:


dbOBJECT.tbl_phone_numbers.id_tbl_members.requires=IS_IN_DB(dbOBJECT,
'tbl_members.id','tbl_members.title','tbl_members.first_name',
'tbl_members.mid_init','tbl_members.last_name','tbl_members.suffix',
'tbl_members.street1','tbl_members.street2','tbl_members.city','tbl_members.state',
'tbl_members.post_code','tbl_members.country','tbl_members.gender','tbl_members.nra_id')

should be just:

dbOBJECT.tbl_phone_numbers.id_tbl_members.requires=IS_IN_DB(dbOBJECT,'tbl_members.id')

since I'm just wanting to tie those two fields together, not the one 
field to the whole other table... yes/no/maybe?


TIA,

Monte



[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread mdipierro
Need to think about it.

On Dec 23, 3:51 am, cjrh caleb.hatti...@gmail.com wrote:
 On Dec 23, 2:04 am, mdipierro mdipie...@cs.depaul.edu wrote:

  I can add a try except so that web2py does not tries to compute fields
  when there is not enough information. The downside is that a typo will
  result in a silent failure to compute. Perhaps we should do this
  anyway.

 If you're going to be doing work in the area of compute anyway, is
 there a posssibility of making another change that the current value
 of the compute-ed field can be passed to the compute method?


[web2py] Re: App admin error

2010-12-23 Thread mdipierro
At some point in time you changed

Field('word', 'reference words', ...)

to

Field('word', 'list:reference words', ...)

and you had data in the database. SQLite let you do that (because
SQLite does not check field type and does not support alter table), so
now you have corrupted data in the table and you cannot select it any
more.

You need do delete your database

   rm applications/app/databases/*

and start clean.


On Dec 23, 4:54 am, Arun K.Rajeevan the1.a...@gmail.com wrote:
 I've following in model

 db.define_table('languages',
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('full', 'string', 
 length=30, notnull=True, required=True),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('short', 'string', 
 length=10 , notnull=True, required=True),
                 format='%(full)s - %(short)s')

 db.define_table('words',
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('word', 'string', 
 notnull=True, required=True),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('lang', db.languages, 
 notnull=True, readable=False, writable=False),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('entry_by', db.auth_user, 
 notnull=True, readable=False, writable=False))

 db.define_table('pictures',
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('image', 'upload', 
 notnull=True, required=True, label='Visual Lingua'),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('word', 'list:reference 
 words', readable=False, writable=False, required=True),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('total', 'integer', 
 notnull=True, readable=False, writable=False, default=2),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('clicks', 'integer', 
 notnull=True, readable=False, writable=False, default=1),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('rating', 'double', 
 notnull=True, readable=False, writable=False, compute=lambda row: 
 row['total']/row['clicks']),
                 Field 
 http://127.0.0.1:8000/examples/global/vars/Field('entry_by', db.auth_user, 
 notnull=True, readable=False, writable=False))
 '''
 db.define_table('symbolize',
                 Field('image', db.pictures, notnull=True, readable=False, 
 writable=False, required=True ),
                 Field('word', db.words, notnull=True, readable=False, 
 writable=False, required=True))
 '''              

 I got following error when I select table '*pictures*' on appadmin.
 Isn't that an error?
 Other table's pages are rendered correct.

 Version  web2py™ Version 1.91.4 (2010-12-22 17:31:23)  Python Python 2.5.1:
 C:\Python25\python.exe  Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.

 Traceback (most recent call last):
   File 
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\restricted.py,
  line 188, in restricted
     exec ccode in environment
   File 
 I:/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/applications/init/views/appadmin.html
  http://127.0.0.1:8000/admin/default/edit/init/views/appadmin.html, line 
 165, in module
     p
   File 
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\sqlhtml.py,
  line 1329, in __init__
     r = field.represent(r)
   File 
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon\dal.py,
  line 3012, in list_ref_repr
     return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')
 TypeError: sequence item 0: expected string, int found

  Error snapshot [image: help] Detailed traceback description

 type 'exceptions.TypeError'(sequence item 0: expected string, int found)

 Function argument list

 (ids=[2], r=Table {'lang': gluon.dal.Field object at 0x021..., 'id':
 gluon.dal.Field object at 0x021B8550}, f=function ff at 0x021C4430)
  Code listing

 3007.
 3008.
 3009.
 3010.
 3011.
 3012.

 3013.
 3014.
 3015.
 3016.

             field_type.find('.')  0 and \
             field_type[15:] in field.db.tables:
         referenced = field.db[field_type[15:]]
         def list_ref_repr(ids, r=referenced, f=ff):
             refs = r._db(r.id.belongs(ids)).select(r.id)
             return (ids and ', '.join(f(r,ref.id) for ref in refs) or '')

         field.represent = list_ref_repr
         if hasattr(referenced, '_format') and referenced._format:
             requires = validators.IS_IN_DB(field.db,referenced.id,
                                            referenced._format,multiple=True)

  Variables ', '.join undefined  f function ff at 0x021C4430  refs 
 gluon.dal.Rows
 object at 0x020A94D0  ids [2]  r Table {'lang': gluon.dal.Field object at
 0x021..., 'id': gluon.dal.Field object at 0x021B8550}  ref undefined


[web2py] Re: Merry Christmas

2010-12-23 Thread mdipierro
same here to all of you!

On Dec 23, 7:24 am, Martín Mulone mulone.mar...@gmail.com wrote:
 Merry Christmas and a happy new to the group.

 2010/12/23 Stef Mientki stef.mien...@gmail.com:



  +1,

  btw, what a nice signature !!
  cheers,
  Stef
  On 23-12-2010 08:17, ⎝⏠⏝⏠⎠ Kuldeep Singh PHP FreeLancer Web Developer,SEO
  Services wrote:

  Marry Christmas to all of you ...From Kaysellers.com

  On 23 December 2010 12:40, ma...@rockiger.com rocki...@googlemail.com
  wrote:

  Merry Christmas and a happy new your to all you web2py-contributors.
  You do an awesome work - everyone.

  Marco

  --
  Kuldeep Singh...
  WebDeveloper And Freelancer Kay Sellers,
  Owner:http://kaysellers.com
  +9199142-41733,*+91-9501710226(Allways Switched On)*
  Skype ID : kaydeveloper
  Yahoo:deepulove123321
  On Twitter:http://twitter.com/ruhisoftect
  We Provide:-
  Adobe AIR,E-Commerce PHP Web and Desktop Applications,Wordpress
  Themes,Drupal Themes,Joomla Templates,Joomla Components Modules
  Plugins,Java,ERP,MLM Development and Logic Design,Ajax,Jquery,RSS
  Feeds,PhotoShop,Flex,Payment Solutions.

 --
 My blog: http://martin.tecnodoc.com.ar
 My portfolio *spanish*: http://www.tecnodoc.com.ar
 Checkout my last proyect instant-press:http://www.instant2press.com


[web2py] Re: form.accepts = False. How to find out why

2010-12-23 Thread DenesL

Two things to check:
1) you might have session.forget() in the controller, maybe outside
the action.
2) you might be using a custom form and it is missing the hidden
fields,
   if you don't have the _formkey then the form will not be accepted.


On Dec 23, 2:39 am, Johann Spies johann.sp...@gmail.com wrote:
 On 22 December 2010 22:36, Jonathan Lundell jlund...@pobox.com wrote:



  When accepts() returns False, look at form.errors. It's a dict (Storage,
  actually, but you can treat it as a dict) that is keyed, typically, by field
  names, with error messages as values.

  (accepts() will also return False before the form has been submitted, but
  in that case form.errors is empty.)

 Thanks.  I have tried that before also but it just reports Storage{}

 So why is that empty?

 Regards
 Johann

 --
  May grace and peace be yours in abundance through the full knowledge of God
 and of Jesus our Lord!  His divine power has given us everything we need for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
                                                     2 Pet. 1:2b,3a


[web2py] Re: Merry Christmas

2010-12-23 Thread DenesL
+1

On Dec 23, 9:20 am, mdipierro mdipie...@cs.depaul.edu wrote:
 same here to all of you!


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Sahil Arora
h1Create a new task/h1
form  action= enctype=multipart/form-data method=post
table

tr
tdbType :/b/tdtddivselect class=reference
id=task_type name=typeoption value=/optionoption
value=2Coding/optionoption value=1Designing/optionoption
value=3Testing/option/select/div/td
/trtr
tdbTitle :/b/tdtddivinput class=string id=task_title
name=title type=text value= //div/td
/trtr
tdbDescription :/b/tdtddivtextarea class=text cols=40
id=task_description name=description
rows=10/textarea/div/td
/trtr
tdbEstimated Time :/b/tddiv'tdinput class=string
id=task_estimated_time name=estimated_time type=text value=
/select class=string id=task_estimated_time_unit
name=estimated_time_unitoption value=/optionoption
selected=selected value=daysdays/optionoption
value=hourshours/option/select/td /div

/tr
tr
td/tdtddiv align='center'input type=submit value=Submit
//div/td
/tr
/table


On 12/23/10, Martín Mulone mulone.mar...@gmail.com wrote:
 Can you show me the source html of this form generated?

 2010/12/23 Sahil Arora sahilarora...@gmail.com:
 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 table

 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
 /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




 --
 My blog: http://martin.tecnodoc.com.ar
 My portfolio *spanish*: http://www.tecnodoc.com.ar
 Checkout my last proyect instant-press: http://www.instant2press.com



-- 
Sahil Arora
B.Tech 2nd year
Computer Science and Engineering
IIT Delhi
Contact No: +91 9871491046


[web2py] Re: Merry Christmas

2010-12-23 Thread Anthony
Indeed, Merry Christmas and Happy New Year to all the fine folks here. :D
 
Anthony
 


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Bruno Rocha
I wish a happy new year to all of the group. and that 2011 will be a year of
achievements and more good developments for our dear web framework.

This year I were actively connected with the web2py development. I put aside
other technologies (kicked the ass of my bosses) and founded my own
small-company and we had a great year working with 100% of the projects
developed with free software and Python (almost all in web2py)

I thank Massimo and all group for everything that I learned here in 2010.

We hope 2011 to be a great year to everyone. (Let's kick asses creating
great open source systems with web2py in 2011)

(we are going to take a break, no internets or code until next year)

Happy new year to you all!.

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Martín Mulone
Add to your css definition or in /static/CSS/base.css this rule and
tell if this is working:

#task_estimated_time_unit {width: 80px;}

2010/12/23 Sahil Arora sahilarora...@gmail.com:
 h1Create a new task/h1
 form  action= enctype=multipart/form-data method=post
 table

 tr
 tdbType :/b/tdtddivselect class=reference
 id=task_type name=typeoption value=/optionoption
 value=2Coding/optionoption value=1Designing/optionoption
 value=3Testing/option/select/div/td
 /trtr
 tdbTitle :/b/tdtddivinput class=string id=task_title
 name=title type=text value= //div/td
 /trtr
 tdbDescription :/b/tdtddivtextarea class=text cols=40
 id=task_description name=description
 rows=10/textarea/div/td
 /trtr
 tdbEstimated Time :/b/tddiv'tdinput class=string
 id=task_estimated_time name=estimated_time type=text value=
 /select class=string id=task_estimated_time_unit
 name=estimated_time_unitoption value=/optionoption
 selected=selected value=daysdays/optionoption
 value=hourshours/option/select/td /div

 /tr
 tr
 td/tdtddiv align='center'input type=submit value=Submit
 //div/td
 /tr
 /table


 On 12/23/10, Martín Mulone mulone.mar...@gmail.com wrote:
 Can you show me the source html of this form generated?

 2010/12/23 Sahil Arora sahilarora...@gmail.com:
 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 table

 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
 /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




 --
 My blog: http://martin.tecnodoc.com.ar
 My portfolio *spanish*: http://www.tecnodoc.com.ar
 Checkout my last proyect instant-press: http://www.instant2press.com



 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Hello Massimo,

I have one more question about the process of pickle the translation
file...
Do you lock file with flock? Or just open the file and close it after the
pickling and applying transformation to the dict is enough to lock the file
during the process?

Is this code correct to not having concurent access problem?? :

f = open(file.dat,wb)
pickle.dump(x,f)
f.close()

f = open(file.dat,rb)
y = pickle.load(f)
f.close()


Thank you

Richard

On Tue, Dec 7, 2010 at 12:17 PM, mdipierro mdipie...@cs.depaul.edu wrote:

 The language files are just python pickles of
 {'original':'translation',...} where original and translation are UTF8
 strings.
 You can open, lock, unpickle, do whatever you need to do, re-pickle,
 unlock, close.

 On Dec 7, 11:03 am, Richard Vézina ml.richard.vez...@gmail.com
 wrote:
  Hello,
 
  I would like to update the different language file for certain entry
with
  translation contained in database...
 
  So I would do something like that :
 
  fr-ca.py dict.update(translate_ui_tables_names)
  or
  fr-fr.py dict.update(translate_ui_tables_names)
 
  But I don't know the name of the the variable name of the different dict
  that are contained in language files...
 
  And since those file are automatically generated I can't just do :
 
  fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
 
  Where could I add my update to the regular process of web2py?
 
  Or trigger a function...
 
  Richard
 
  On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina 
ml.richard.vez...@gmail.com
 
   wrote:
   Hello,
 
   I come with that solution... I would have comment...
 
   I get my translations like this :
 
  
translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
   for r in db().select(db.dict_database.ALL))
 
   Then I just have to :
 
   language translation dict*.append(translate_ui_tables_names)
 
   * Still searching for the name of the dict of the differents language
file
   (ex.: fr-ca.py or fr-fr.py)
 
   ;-)
 
   Richard
 
 


Re: [web2py] customizing size of form fields created using field.custom.widget

2010-12-23 Thread Sahil Arora
thanks...that worked

On 12/23/10, Martín Mulone mulone.mar...@gmail.com wrote:
 Add to your css definition or in /static/CSS/base.css this rule and
 tell if this is working:

 #task_estimated_time_unit {width: 80px;}

 2010/12/23 Sahil Arora sahilarora...@gmail.com:
 h1Create a new task/h1
 form  action= enctype=multipart/form-data method=post
 table

 tr
 tdbType :/b/tdtddivselect class=reference
 id=task_type name=typeoption value=/optionoption
 value=2Coding/optionoption value=1Designing/optionoption
 value=3Testing/option/select/div/td
 /trtr
 tdbTitle :/b/tdtddivinput class=string id=task_title
 name=title type=text value= //div/td
 /trtr
 tdbDescription :/b/tdtddivtextarea class=text cols=40
 id=task_description name=description
 rows=10/textarea/div/td
 /trtr
 tdbEstimated Time :/b/tddiv'tdinput class=string
 id=task_estimated_time name=estimated_time type=text value=
 /select class=string id=task_estimated_time_unit
 name=estimated_time_unitoption value=/optionoption
 selected=selected value=daysdays/optionoption
 value=hourshours/option/select/td /div

 /tr
 tr
 td/tdtddiv align='center'input type=submit value=Submit
 //div/td
 /tr
 /table


 On 12/23/10, Martín Mulone mulone.mar...@gmail.com wrote:
 Can you show me the source html of this form generated?

 2010/12/23 Sahil Arora sahilarora...@gmail.com:
 I used the following code to generate a form in attached image.
 Is it possible to change the size of the fields in the form.
 I want to decrease size of input field of Estimated time and the dropbox
 field to the right of it


 {{=form.custom.begin}}
 table

 tabletr
 tdbType :/b/tdtddiv{{=form.custom.widget.type}}/div/td
 /trtr
 tdbTitle :/b/tdtddiv{{=form.custom.widget.title}}/div/td
 /trtr
 tdbDescription
 :/b/tdtddiv{{=form.custom.widget.description}}/div/td
 /trtr
 tdbEstimated Time
 :/b/tddiv'td{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}/td
 /div
 /tr
 tr
 td/tdtddiv align='center'{{=form.custom.submit}}/div/td
 /tr
 /table

 {{=form.custom.end}}

 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




 --
 My blog: http://martin.tecnodoc.com.ar
 My portfolio *spanish*: http://www.tecnodoc.com.ar
 Checkout my last proyect instant-press: http://www.instant2press.com



 --
 Sahil Arora
 B.Tech 2nd year
 Computer Science and Engineering
 IIT Delhi
 Contact No: +91 9871491046




 --
 My blog: http://martin.tecnodoc.com.ar
 My portfolio *spanish*: http://www.tecnodoc.com.ar
 Checkout my last proyect instant-press: http://www.instant2press.com



-- 
Sahil Arora
B.Tech 2nd year
Computer Science and Engineering
IIT Delhi
Contact No: +91 9871491046


Re: [web2py] export_to_csv_file and colnames

2010-12-23 Thread Thadeus Burgess
that would be a bug for sure :p

--
Thadeus




On Thu, Dec 23, 2010 at 6:59 AM, howesc how...@umich.edu wrote:

 Massimo and crew,

 I am trying to use export_to_csv_file() on a rows object with the colnames
 parameter on google app engine.  it turns out that the method (in both
 sql.py and the new dal.py) outputs the proper column names, but then outputs
 data for every column in the table.

 the culprit is on line 4741 of dal.py (from trunk):
 for col in self.colnames:
 should be
 for col in colnames:

 and then, so long as the user's colnames are in the format
 'table_name.field_name' it works as desired (at least from my
 perspective).

 does this sounds correct?  if so, do you mind adding it to trunk?

 thanks!

 christian




Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
There is also this lib :

http://pypi.python.org/pypi/lockfile/

http://www.mail-archive.com/spambayes-dev@python.org/msg00727.html


Richard


On Thu, Dec 23, 2010 at 10:13 AM, Richard Vézina 
ml.richard.vez...@gmail.com wrote:

 Hello Massimo,

 I have one more question about the process of pickle the translation
 file...
 Do you lock file with flock? Or just open the file and close it after the
 pickling and applying transformation to the dict is enough to lock the file
 during the process?

 Is this code correct to not having concurent access problem?? :

 f = open(file.dat,wb)
 pickle.dump(x,f)
 f.close()

 f = open(file.dat,rb)
 y = pickle.load(f)
 f.close()


 Thank you

 Richard

 On Tue, Dec 7, 2010 at 12:17 PM, mdipierro mdipie...@cs.depaul.edu
 wrote:
 
  The language files are just python pickles of
  {'original':'translation',...} where original and translation are UTF8
  strings.
  You can open, lock, unpickle, do whatever you need to do, re-pickle,
  unlock, close.
 
  On Dec 7, 11:03 am, Richard Vézina ml.richard.vez...@gmail.com
  wrote:
   Hello,
  
   I would like to update the different language file for certain entry
 with
   translation contained in database...
  
   So I would do something like that :
  
   fr-ca.py dict.update(translate_ui_tables_names)
   or
   fr-fr.py dict.update(translate_ui_tables_names)
  
   But I don't know the name of the the variable name of the different
 dict
   that are contained in language files...
  
   And since those file are automatically generated I can't just do :
  
   fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
  
   Where could I add my update to the regular process of web2py?
  
   Or trigger a function...
  
   Richard
  
   On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina 
 ml.richard.vez...@gmail.com
  
wrote:
Hello,
  
I come with that solution... I would have comment...
  
I get my translations like this :
  
   
 translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
for r in db().select(db.dict_database.ALL))
  
Then I just have to :
  
language translation dict*.append(translate_ui_tables_names)
  
* Still searching for the name of the dict of the differents language
 file
(ex.: fr-ca.py or fr-fr.py)
  
;-)
  
Richard
  
  



[web2py] Re: Cache stored at request, does not sync with other threads until new request

2010-12-23 Thread Dragonfyre13
So I've gone back and forth on this again and again. It looks like
cache.ram being process bound (so even though I only have one web2py
instance, it's running across multiple wsgi processes?) was the
problem. The issue is, I'm having similar issues (in a very different
location) using cache.disk. I though maybe it might be better to use
memcache instead, but I get a keyerror when trying to use memcache to
cache the DAL, since my key regularly exceeds 250 chars (relatively
small query, but lists every field it looks like)

On Dec 21, 5:54 pm, Tim Alexander dragonfyr...@gmail.com wrote:
 It occurs to me, I'm using uwsgi. I'm assuming cache.ram is per process,
 meaning that if my Ajax side and xmlrpc side are not on the same process,
 this will completely not work properly. I'll try flipping over to cache.disk
 tomorrow morning to verify.
 On Dec 21, 2010 5:20 PM, Dragonfyre13 dragonfyr...@gmail.com wrote:

  At least I think the subject seems to define the behavior.

  I have a function that exposes as an XMLRPC service. It puts something
  in a DB, and then polls to see if there is a response to it from
  another system talking to that same DB. (yes I realize that polling a
  DB is a bad thing but necessary for various reasons in this case)

  The difficulty is, there's an xmlrpc side, and an ajax side. The ajax
  side is a longpoll (simulated server side push) with a loop like this:

  while endtime  datetime.datetime.now():
  # This keeps finding a cached value, even when it's cleared
  by
  # another request.
  #for k in cache.ram.storage.keys():
  #logging.debug(k,v)
  #if k.find(next_action.ccid= + str(ccid)) != -1:
  # logging.debug(str(ccid) + found cached value)
  actionrow = localdb(localdb.next_action.ccid == ccid).select(
  cache=(cache.ram,600)).first()
  if actionrow and len(actionrow) and actionrow.action_str !=
  None and \
  actionrow.return_str == None:
  return dict(action_xml=actionrow.action_str,
  ccid=ccid)
  time.sleep(.5)

  The XMLRPC side is much the same. ccid is a unique key for the
  conversation for both of them to use. The action string is where the
  XMLRPC side pushes information, and return_str is data that is handed
  back after the ajax longpoll fulfills the action string's needs.

  My problem in all of this is the comments above. Even though when I do
  an update on the XMLRPC side, I clear cache for this select statement
  (via setting timeout to 0 for that select statement in cache) it still
  maintains the value pulled from cache in the ajax request above. So I
  don't pull out the actual value in the DB until cache expires in this
  function, even though I've cleared the cache via setting timeout to 0
  in the other function:
  localdb(localdb.next_action.ccid == ccid).select(cache=(cache.ram, 0))

  Any ideas? For now, I really don't know what I'm looking at for an
  issue or resolution, but even a yep, makes a copy when your request
  object is created would work if someone knows. Or you're an idiot,
  do it like this would be even better!


[web2py] Re: Merry Christmas

2010-12-23 Thread ron_m
+1


[web2py] Re: couchdb support again

2010-12-23 Thread ron_m
ii  python-couchdb  
0.6-1   
from Ubuntu 10.04.1 dpkg -l
I have to go visit a customer site today so will look again tonight. I think 
it is probably time for me to update direct from Apache. This may be a 
problem since the rest of the release actually uses CouchDb. I am very 
interested in getting this going so will do what I can - this I am thinking 
would be a good database for me to store configuration data in since it has 
a multi-master disconnect model that still resolves replication issues. I 
would have to go into it a lot deeper to explain why but will skip it for 
now.

Merry Christmas and all the best for the New Year.
Ron


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Ok, I think I found what you do :

From the DAL.py

Version 1.88.2

tfile = open(self._dbt, 'w')
portalocker.lock(tfile, portalocker.LOCK_EX)
cPickle.dump(sql_fields, tfile)
portalocker.unlock(tfile)
tfile.close()
if self._dbt:
if fake_migrate:
logfile.write('faked!\n')
else:
logfile.write('success!\n')
else:
tfile = open(self._dbt, 'r')
portalocker.lock(tfile, portalocker.LOCK_SH)
sql_fields_old = cPickle.load(tfile)
portalocker.unlock(tfile)
tfile.close()

Richard

On Thu, Dec 23, 2010 at 10:36 AM, Richard Vézina 
ml.richard.vez...@gmail.com wrote:

 There is also this lib :

 http://pypi.python.org/pypi/lockfile/

 http://www.mail-archive.com/spambayes-dev@python.org/msg00727.html


 Richard


 On Thu, Dec 23, 2010 at 10:13 AM, Richard Vézina 
 ml.richard.vez...@gmail.com wrote:

 Hello Massimo,

 I have one more question about the process of pickle the translation
 file...
 Do you lock file with flock? Or just open the file and close it after
 the pickling and applying transformation to the dict is enough to lock the
 file during the process?

 Is this code correct to not having concurent access problem?? :

 f = open(file.dat,wb)
 pickle.dump(x,f)
 f.close()

 f = open(file.dat,rb)
 y = pickle.load(f)
 f.close()


 Thank you

 Richard

 On Tue, Dec 7, 2010 at 12:17 PM, mdipierro mdipie...@cs.depaul.edu
 wrote:
 
  The language files are just python pickles of
  {'original':'translation',...} where original and translation are UTF8
  strings.
  You can open, lock, unpickle, do whatever you need to do, re-pickle,
  unlock, close.
 
  On Dec 7, 11:03 am, Richard Vézina ml.richard.vez...@gmail.com
  wrote:
   Hello,
  
   I would like to update the different language file for certain entry
 with
   translation contained in database...
  
   So I would do something like that :
  
   fr-ca.py dict.update(translate_ui_tables_names)
   or
   fr-fr.py dict.update(translate_ui_tables_names)
  
   But I don't know the name of the the variable name of the different
 dict
   that are contained in language files...
  
   And since those file are automatically generated I can't just do :
  
   fr-ca.py file dict : {key:vaule}.update(translate_ui_tables_names)
  
   Where could I add my update to the regular process of web2py?
  
   Or trigger a function...
  
   Richard
  
   On Mon, Dec 6, 2010 at 12:30 PM, Richard Vézina 
 ml.richard.vez...@gmail.com
  
wrote:
Hello,
  
I come with that solution... I would have comment...
  
I get my translations like this :
  
   
 translate_ui_tables_names=dict((r.table_name_en_ui,r.table_name_fr_ui)\
for r in db().select(db.dict_database.ALL))
  
Then I just have to :
  
language translation dict*.append(translate_ui_tables_names)
  
* Still searching for the name of the dict of the differents
 language file
(ex.: fr-ca.py or fr-fr.py)
  
;-)
  
Richard
  
  





Re: [web2py] Re: translation dict name

2010-12-23 Thread ron_m
web2py uses portalocker.py look under gluon. There are many examples of use 
such as locking the session file in globals.py



Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Find it!

My only remaning problem is the # coding: utf8 at the top of translation
file... I don't see how dal.py manage it... I could made a readline and
remove it in a other instance of the open file or something like that, but
should have a simpler way to manage it.

Richard

On Thu, Dec 23, 2010 at 11:06 AM, ron_m ron.mco...@gmail.com wrote:

 web2py uses portalocker.py look under gluon. There are many examples of use
 such as locking the session file in globals.py




Re: [web2py] Re: form.accepts = False. How to find out why

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 6:42 AM, DenesL wrote:
 
 
 Two things to check:
 1) you might have session.forget() in the controller, maybe outside
 the action.
 2) you might be using a custom form and it is missing the hidden
 fields,
   if you don't have the _formkey then the form will not be accepted.

Also, if the submit results in a database insert, and the insert fails. I think.

And if there's a formname mismatch.

It seems to me that if accepts() fails, there always ought to be a reason 
reported. Would it break compatibility to report these errors in form.errors? 
If so, how about creating form.formerrors and guaranteeing that if accepts 
returns False, formerrors will say why.

 The Form docstring says:
 
 form has one important method::
 
 form.accepts(request.vars, session)
 
 if form is accepted (and all validators pass) form.vars contains the
 accepted vars, otherwise form.errors contains the errors.
 in case of errors the form is modified to present the errors to the user.
 
...but that's not really true. There are several reasons for failure that are 
not reported in form.errors.

(One of them is that the form has not been submitted yet. I find that logic 
really confusing: what's the path, exactly?)

 
 
 On Dec 23, 2:39 am, Johann Spies johann.sp...@gmail.com wrote:
 On 22 December 2010 22:36, Jonathan Lundell jlund...@pobox.com wrote:
 
 
 
 When accepts() returns False, look at form.errors. It's a dict (Storage,
 actually, but you can treat it as a dict) that is keyed, typically, by field
 names, with error messages as values.
 
 (accepts() will also return False before the form has been submitted, but
 in that case form.errors is empty.)
 
 Thanks.  I have tried that before also but it just reports Storage{}
 
 So why is that empty?
 
 Regards
 Johann
 
 --
  May grace and peace be yours in abundance through the full knowledge of God
 and of Jesus our Lord!  His divine power has given us everything we need for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
 2 Pet. 1:2b,3a




Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Ok, everything seems to be in languages.py...

I didn't noticed at first read that the code I was seeking for was there...

I will see if I get what I want... [?]

Richard

On Thu, Dec 23, 2010 at 11:31 AM, Richard Vézina 
ml.richard.vez...@gmail.com wrote:

 Find it!

 My only remaning problem is the # coding: utf8 at the top of translation
 file... I don't see how dal.py manage it... I could made a readline and
 remove it in a other instance of the open file or something like that, but
 should have a simpler way to manage it.

 Richard


 On Thu, Dec 23, 2010 at 11:06 AM, ron_m ron.mco...@gmail.com wrote:

 web2py uses portalocker.py look under gluon. There are many examples of
 use such as locking the session file in globals.py



32F.gif

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 1:04 AM, cjrh wrote:
 
 On Dec 22, 6:05 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 What I do is if my app works with a certain version, I don't ever upgrade
 the web2py unless I need a brand new feature or bugfix that effects me.
 
 +1.  If you don't need anything new, no point in upgrading.

The problem is that if you *do* need a bugfix, you ordinarily can't get it 
without adopting all the changes since the version you're currently using 
(unless you do your own patching).

[web2py] web2py_utils bug

2010-12-23 Thread Francisco Feijoo
Hello everybody,

this is my first post in the group. THANKS for this great web
framework.

I want to include tests in my project. Searching I found web2py_utils
(web2py_utils-0.0.13dev) and test_runner as the best tool for web2py
and unit test.

Running the tests I have this error:

File /usr/lib/python2.4/site-packages/web2py_utils-0.0.13dev-
py2.4.egg/web2py_utils/test_runner.py, line 193
test_db.define_table(tablename, *table_copy, migrate=True)
   ^
SyntaxError: invalid syntax


I have replaced the line with:
 test_db.define_table(tablename, migrate=True, *table_copy)


Is web2py_utils a good tool for testing web2py applications? Is
someone resposible for utils project to update the code?

Cheers


Re: [web2py] Re: translation dict name

2010-12-23 Thread Richard Vézina
Bingo!

Richard

On Thu, Dec 23, 2010 at 11:37 AM, Richard Vézina 
ml.richard.vez...@gmail.com wrote:

 Ok, everything seems to be in languages.py...

 I didn't noticed at first read that the code I was seeking for was there...

 I will see if I get what I want... [?]

 Richard


 On Thu, Dec 23, 2010 at 11:31 AM, Richard Vézina 
 ml.richard.vez...@gmail.com wrote:

 Find it!

 My only remaning problem is the # coding: utf8 at the top of translation
 file... I don't see how dal.py manage it... I could made a readline and
 remove it in a other instance of the open file or something like that, but
 should have a simpler way to manage it.

 Richard


 On Thu, Dec 23, 2010 at 11:06 AM, ron_m ron.mco...@gmail.com wrote:

 web2py uses portalocker.py look under gluon. There are many examples of
 use such as locking the session file in globals.py




32F.gif

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 5:37 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 23, 2010, at 1:04 AM, cjrh wrote:

 On Dec 22, 6:05 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 What I do is if my app works with a certain version, I don't ever upgrade
 the web2py unless I need a brand new feature or bugfix that effects me.

 +1.  If you don't need anything new, no point in upgrading.

 The problem is that if you *do* need a bugfix, you ordinarily can't get it 
 without adopting all the changes since the version you're currently using 
 (unless you do your own patching).

That's another reason why you want to help test the 'release
candidate', right? :)

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] Possible bug in URL

2010-12-23 Thread mr.freeze
Given this url:
URL(args=1,vars=dict(v='yes'),anchor='end')
It produces:
http://server/app/default/index/1#end?v=yes
Problem:
request.vars is empty

This url:
http://server/app/default/index/1?v=yes#end
request.vars is populated and the anchor works

Shouldn't the anchor be at the end of the query string? I'm running
the latest trunk.


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 8:58 AM, Branko Vukelić wrote:
 
 On Thu, Dec 23, 2010 at 5:37 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 23, 2010, at 1:04 AM, cjrh wrote:
 
 On Dec 22, 6:05 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 What I do is if my app works with a certain version, I don't ever upgrade
 the web2py unless I need a brand new feature or bugfix that effects me.
 
 +1.  If you don't need anything new, no point in upgrading.
 
 The problem is that if you *do* need a bugfix, you ordinarily can't get it 
 without adopting all the changes since the version you're currently using 
 (unless you do your own patching).
 
 That's another reason why you want to help test the 'release
 candidate', right? :)

Seriously: no.

That is, if I'm using a release from six months ago, and all I need is a point 
fix, there's no reason for me to spend any time testing new release candidates. 
The bulk of web2py users, presumably, are not focused on web2py development; 
they're simply using web2py as a (very effective) tool to get their real work 
done. And there's nothing wrong with that.

Re: [web2py] Possible bug in URL

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:
 
 Given this url:
 URL(args=1,vars=dict(v='yes'),anchor='end')
 It produces:
 http://server/app/default/index/1#end?v=yes
 Problem:
 request.vars is empty
 
 This url:
 http://server/app/default/index/1?v=yes#end
 request.vars is populated and the anchor works
 
 Shouldn't the anchor be at the end of the query string? I'm running
 the latest trunk.

Yes; that's an error, per RFC 3986.

  URI = scheme : hier-part [ ? query ] [ # fragment ]


Not only that, but '?' is legal in a fragment identifier, as is '=', so in your 
first example, end?v=yes is itself the entire (legal) anchor.

I wouldn't be terribly surprised if some browsers treated this inconsistently, 
but we should be adhering to the RFC here.

The fix looks easy; change:

if anchor:
other += '#' + urllib.quote(str(anchor))
if vars:
other += '?%s' % m_vars

to:

if vars:
other += '?%s' % m_vars
if anchor:
other += '#' + urllib.quote(str(anchor))

...and fix the doctest. Though I'm not sure that urllib.quote is right for an 
anchor.

[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread Magnitus
I've thought about the dependencies problem a little bit.

Maybe add some kind of hook so that the user can define the
dependencies of the computed field himself.

If he doesn't define them, the current behavior occurs.

If he defines them, the behavior could be as follow:

1) All the dependencies are present in the input

The field is updated from the input

2) Part of the dependencies are present in the input

The current behavior occurs. Alternatively, try to read the missing
dependencies from the DB (for an update) or from the default values
(for an insert), but I'm not sure how complicated that would be.

3) None of the dependencies are present in the input

The computed field is not updated.

From the above, you'd get the best of all worlds.

1) User friendliness: The user doesn't have to define dependencies if
he doesn't want to and he'd get the current behavior.

2) Flexibility: The user can define dependencies in which case the
computed field doesn't restrict updates that don't include the
dependencies on the field.

3) Correctness: Exceptions due to mistyping variables are not caught
and properly raised.

On Dec 23, 9:11 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Need to think about it.

 On Dec 23, 3:51 am, cjrh caleb.hatti...@gmail.com wrote:



  On Dec 23, 2:04 am, mdipierro mdipie...@cs.depaul.edu wrote:

   I can add a try except so that web2py does not tries to compute fields
   when there is not enough information. The downside is that a typo will
   result in a silent failure to compute. Perhaps we should do this
   anyway.

  If you're going to be doing work in the area of compute anyway, is
  there a posssibility of making another change that the current value
  of the compute-ed field can be passed to the compute method?- Hide quoted 
  text -

 - Show quoted text -


[web2py] Re: Cache stored at request, does not sync with other threads until new request

2010-12-23 Thread Dragonfyre13
Nevermind, I wasn't clearing the cache in one place, so cache simply
didn't get updated with the right value when it needed to.

On Dec 23, 9:27 am, Dragonfyre13 dragonfyr...@gmail.com wrote:
 So I've gone back and forth on this again and again. It looks like
 cache.ram being process bound (so even though I only have one web2py
 instance, it's running across multiple wsgi processes?) was the
 problem. The issue is, I'm having similar issues (in a very different
 location) using cache.disk. I though maybe it might be better to use
 memcache instead, but I get a keyerror when trying to use memcache to
 cache the DAL, since my key regularly exceeds 250 chars (relatively
 small query, but lists every field it looks like)

 On Dec 21, 5:54 pm, Tim Alexander dragonfyr...@gmail.com wrote:

  It occurs to me, I'm using uwsgi. I'm assuming cache.ram is per process,
  meaning that if my Ajax side and xmlrpc side are not on the same process,
  this will completely not work properly. I'll try flipping over to cache.disk
  tomorrow morning to verify.
  On Dec 21, 2010 5:20 PM, Dragonfyre13 dragonfyr...@gmail.com wrote:

   At least I think the subject seems to define the behavior.

   I have a function that exposes as an XMLRPC service. It puts something
   in a DB, and then polls to see if there is a response to it from
   another system talking to that same DB. (yes I realize that polling a
   DB is a bad thing but necessary for various reasons in this case)

   The difficulty is, there's an xmlrpc side, and an ajax side. The ajax
   side is a longpoll (simulated server side push) with a loop like this:

   while endtime  datetime.datetime.now():
   # This keeps finding a cached value, even when it's cleared
   by
   # another request.
   #for k in cache.ram.storage.keys():
   #logging.debug(k,v)
   #if k.find(next_action.ccid= + str(ccid)) != -1:
   # logging.debug(str(ccid) + found cached value)
   actionrow = localdb(localdb.next_action.ccid == ccid).select(
   cache=(cache.ram,600)).first()
   if actionrow and len(actionrow) and actionrow.action_str !=
   None and \
   actionrow.return_str == None:
   return dict(action_xml=actionrow.action_str,
   ccid=ccid)
   time.sleep(.5)

   The XMLRPC side is much the same. ccid is a unique key for the
   conversation for both of them to use. The action string is where the
   XMLRPC side pushes information, and return_str is data that is handed
   back after the ajax longpoll fulfills the action string's needs.

   My problem in all of this is the comments above. Even though when I do
   an update on the XMLRPC side, I clear cache for this select statement
   (via setting timeout to 0 for that select statement in cache) it still
   maintains the value pulled from cache in the ajax request above. So I
   don't pull out the actual value in the DB until cache expires in this
   function, even though I've cleared the cache via setting timeout to 0
   in the other function:
   localdb(localdb.next_action.ccid == ccid).select(cache=(cache.ram, 0))

   Any ideas? For now, I really don't know what I'm looking at for an
   issue or resolution, but even a yep, makes a copy when your request
   object is created would work if someone knows. Or you're an idiot,
   do it like this would be even better!


Re: [web2py] Possible bug in URL

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 9:29 AM, Jonathan Lundell wrote:
 
 On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:
 
 Given this url:
 URL(args=1,vars=dict(v='yes'),anchor='end')
 It produces:
 http://server/app/default/index/1#end?v=yes
 Problem:
 request.vars is empty
 
 This url:
 http://server/app/default/index/1?v=yes#end
 request.vars is populated and the anchor works
 
 Shouldn't the anchor be at the end of the query string? I'm running
 the latest trunk.
 
 Yes; that's an error, per RFC 3986.
 
  URI = scheme : hier-part [ ? query ] [ # fragment ]
 
 
 Not only that, but '?' is legal in a fragment identifier, as is '=', so in 
 your first example, end?v=yes is itself the entire (legal) anchor.
 
 I wouldn't be terribly surprised if some browsers treated this 
 inconsistently, but we should be adhering to the RFC here.
 
 The fix looks easy; change:
 
if anchor:
other += '#' + urllib.quote(str(anchor))
if vars:
other += '?%s' % m_vars
 
 to:
 
if vars:
other += '?%s' % m_vars
if anchor:
other += '#' + urllib.quote(str(anchor))
 
 ...and fix the doctest. Though I'm not sure that urllib.quote is right for an 
 anchor.

Following up: as I read the RFC, the quoting doesn't hurt.

[web2py] Re: Possible bug in URL

2010-12-23 Thread mr.freeze
Thanks for confirming. I will send Massimo a patch.

On Dec 23, 11:56 am, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 23, 2010, at 9:29 AM, Jonathan Lundell wrote:











  On Dec 23, 2010, at 9:09 AM, mr.freeze wrote:

  Given this url:
  URL(args=1,vars=dict(v='yes'),anchor='end')
  It produces:
 http://server/app/default/index/1#end?v=yes
  Problem:
  request.vars is empty

  This url:
 http://server/app/default/index/1?v=yes#end
  request.vars is populated and the anchor works

  Shouldn't the anchor be at the end of the query string? I'm running
  the latest trunk.

  Yes; that's an error, per RFC 3986.

       URI         = scheme : hier-part [ ? query ] [ # fragment ]

  Not only that, but '?' is legal in a fragment identifier, as is '=', so in 
  your first example, end?v=yes is itself the entire (legal) anchor.

  I wouldn't be terribly surprised if some browsers treated this 
  inconsistently, but we should be adhering to the RFC here.

  The fix looks easy; change:

     if anchor:
         other += '#' + urllib.quote(str(anchor))
     if vars:
         other += '?%s' % m_vars

  to:

     if vars:
         other += '?%s' % m_vars
     if anchor:
         other += '#' + urllib.quote(str(anchor))

  ...and fix the doctest. Though I'm not sure that urllib.quote is right for 
  an anchor.

 Following up: as I read the RFC, the quoting doesn't hurt.


[web2py] Re: App admin error

2010-12-23 Thread Arun K.Rajeevan
Thank you for reply.
I thought it's the case.

But as far as I can remember, I removed database folder earlier and started 
again.
Anyway, I'll try again and see, if that's the problem.


[web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
See following code, 
I expect it to redirect to a url 
1) if user don't touch dropdown: 
http://127.0.0.1:8000/init/default/search/lang/word?indx=0
   but it shows http://127.0.0.1:8000/init/default/search/lang/word. *Why 
no vars?*
2) if user altered dropdown: 
http://127.0.0.1:8000/init/default/search/lang/word*?indx=5*
 it's ok for first time. But if user select another item from select box 
*?indx=['10'%2C+'5'] 
*
 and if select another one *?indx=['19'%2C+['10'%2C+'5']]

Where did I went wrong?
*

In controller, before all functions, I've following,

options = [OPTION(row.full + '  - ' + row.short, _value=row.id) 
for row in db().select(db.languages.ALL, 
cache=(cache.ram,3600)).sort(lambda a: a.full)]
options.insert(0, OPTION('All Langauges', _value=0))
search_form = FORM(LABEL('Search a word: ', _for='word', _id='word_label', 
_name='word_label'),
INPUT(_id='word', _name='word', 
requires=IS_NOT_EMPTY()), 
SELECT(_onblur=var f = document.search_form; 
f.indx.value = this.selectedIndex;, 
_name='languages', _id='languages', 
requires=IS_IN_DB(db,'languages.id'), *options),
INPUT(_type='hidden', _name='indx', _id='indx', 
value='0'),
INPUT(_type=submit,_value=SEARCH),
 _name='search_form')

# form verficaion logic on submission
if search_form.accepts(request.vars, formname='search_form', 
hideerror=True):
lang = search_form.vars.languages
word = search_form.vars.word
indx = dict(indx = search_form.vars.indx)
redirect(URL(r=request, f='search', args=[lang, word], vars=indx))
elif search_form.errors: #adding an element in option out of the db braked 
prev mechanism. (ie., showing a flash. now that's done by show() itself.
lang = search_form.vars.languages
word = search_form.vars.word
redirect(URL(r=request, f='search', args=[lang, word]))
else:
#page loads first time
pass




Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 10:15 AM, Arun K.Rajeevan wrote:
 See following code, 
 I expect it to redirect to a url 
 1) if user don't touch dropdown: 
 http://127.0.0.1:8000/init/default/search/lang/word?indx=0
but it shows http://127.0.0.1:8000/init/default/search/lang/word. Why 
 no vars?
 2) if user altered dropdown: 
 http://127.0.0.1:8000/init/default/search/lang/word?indx=5
  it's ok for first time. But if user select another item from select box 
 ?indx=['10'%2C+'5'] 
  and if select another one ?indx=['19'%2C+['10'%2C+'5']]

Massimo:

Perhaps you can explain why indx is becoming a nested list, but setting that 
aside, if it *is* a list, I think the query string should be something like:

?indx=19index=10indx=5

That would require some additional logic in URL() for vars.

 
 Where did I went wrong?
 
 In controller, before all functions, I've following,
 
 options = [OPTION(row.full + '  - ' + row.short, _value=row.id) 
 for row in db().select(db.languages.ALL, 
 cache=(cache.ram,3600)).sort(lambda a: a.full)]
 options.insert(0, OPTION('All Langauges', _value=0))
 search_form = FORM(LABEL('Search a word: ', _for='word', _id='word_label', 
 _name='word_label'),
 INPUT(_id='word', _name='word', requires=IS_NOT_EMPTY()), 
 SELECT(_onblur=var f = document.search_form; 
 f.indx.value = this.selectedIndex;, 
 _name='languages', _id='languages', 
 requires=IS_IN_DB(db,'languages.id'), *options),
 INPUT(_type='hidden', _name='indx', _id='indx', 
 value='0'),
 INPUT(_type=submit,_value=SEARCH),
  _name='search_form')
 
 # form verficaion logic on submission
 if search_form.accepts(request.vars, formname='search_form', hideerror=True):
 lang = search_form.vars.languages
 word = search_form.vars.word
 indx = dict(indx = search_form.vars.indx)
 redirect(URL(r=request, f='search', args=[lang, word], vars=indx))
 elif search_form.errors: #adding an element in option out of the db braked 
 prev mechanism. (ie., showing a flash. now that's done by show() itself.
 lang = search_form.vars.languages
 word = search_form.vars.word
 redirect(URL(r=request, f='search', args=[lang, word]))
 else:
 #page loads first time
 pass
 
 




Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
It's not a list.
Complete logic is given in the first post, where this index is forming.
Hidden field's value is set when select box changes.
and is retrieved in form.accepts() 
that's all.

Each time, I select an item hidden field's value changes. (I tried with 
firebug console.)
And why this is happening? 
I'm not getting any clue.


[web2py] GAE shows problem.

2010-12-23 Thread Arun K.Rajeevan
see GAE error message. (it runs perfectly fine, if web2py run stand alone)
And was running ok, till previos hour.
What I can track is *init/controllers/default.py:index, line 5, in module 

*and that line is perfect (given below) and runs ok in web2py stand alone.
*options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in 
db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a: 
a.full)]*

--
I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
_appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue 
is d
eprecated, please use google.appengine.api.taskqueue
  description)
ERROR2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent 
call
last):
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\restricted.py, line 188, in restricted
exec ccode in environment
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
cations\*init/controllers/default.py:index, line 5, in module*
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py, line 4388, in select
return self.db._adapter.select(self.query,fields,attributes)
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py, line 2654, in select
(items, tablename, fields) = self.select_raw(query,fields,attributes)
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py, line 2611, in select_raw
tablename = self.get_table(query)
  File 
I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
\dal.py, line 894, in get_table
raise RuntimeError, No table selected
RuntimeError: No table selected


Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
Currently , I get selected value, through form.accepts or request.vars.
I need to keep values in form unaltered. and this is the only way.

*That said, If I can get equivalent of selectedIndex in JS in server side, I 
can live without this problem( as of now).*

*But, I'm curious to know, why this is happening.*


[web2py] Re: Merry Christmas

2010-12-23 Thread Pepe Araya
Hey!

Merry Christmas!!

good vibes for all!


[web2py] Re: Merry Christmas

2010-12-23 Thread Niphlod
+1

On Dec 23, 8:51 pm, Pepe Araya pepea...@gmail.com wrote:
 Hey!

 Merry Christmas!!

 good vibes for all!


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Michele Comitini
Other web frameworks can compare with web2py, but no other  has such a
nice supporting community!

Buon Natale, Merry Christmas!


2010/12/23 Pepe Araya pepea...@gmail.com:
 Hey!
 Merry Christmas!!
 good vibes for all!


Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
It's not a list in your logic, but somewhere it's getting turned into a list. 

On Dec 23, 2010, at 11:37 AM, Arun K.Rajeevan the1.a...@gmail.com wrote:

 It's not a list.
 Complete logic is given in the first post, where this index is forming.
 Hidden field's value is set when select box changes.
 and is retrieved in form.accepts() 
 that's all.
 
 Each time, I select an item hidden field's value changes. (I tried with 
 firebug console.)
 And why this is happening? 
 I'm not getting any clue.


Re: [web2py] Url variable's problem

2010-12-23 Thread Arun K.Rajeevan
Exactly,
That's what confuses me.


[web2py] Re: App admin error

2010-12-23 Thread Arun K.Rajeevan
Nope, 
I tried again, by removing all files in database directory and started 
again.
Problem is still there.
If table is empty, it renders form.
But, as soon as there's items in table, it'll cease to render anymore.

BTW., I'm not using this table as a single form, so it's not effecting me 
now. But I want it resolved. Who knows, someday I've to use this.

On Thursday, December 23, 2010 11:35:39 PM UTC+5:30, Arun K.Rajeevan wrote:

 Thank you for reply.
 I thought it's the case.

 But as far as I can remember, I removed database folder earlier and started 
 again.
 Anyway, I'll try again and see, if that's the problem.



Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Arun K.Rajeevan
Merry Christmas and Happy new Year for every single one in this community 
:-)


[web2py] Re: App admin error

2010-12-23 Thread pbreit
Can you look at the db.pictures.word field using a SQLite browser to see if 
there's any corruption or the wrong type?

Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell jlund...@pobox.com wrote:
 Seriously: no.

Seriously: yes. Why? Because it's YOUR work that is going to suffer if
you don't. Why WOULDN'T you test something you are going to deploy?
I've just tested dozen frameworks and even PHP before starting a
project, and I'm a hobbyist. Are you telling me professional
developers aren't expected to make an informed choice about their
platform? If that's the case, professional developers are people I
would NEVER trust to do their job right.

 That is, if I'm using a release from six months ago, and all I need is a 
 point fix,

Then you can dig around the commits and make yourself a patch. At
least that's what I'd do.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 1:11 PM, Branko Vukelić wrote:
 
 On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell jlund...@pobox.com wrote:
 Seriously: no.
 
 Seriously: yes. Why? Because it's YOUR work that is going to suffer if
 you don't. Why WOULDN'T you test something you are going to deploy?
 I've just tested dozen frameworks and even PHP before starting a
 project, and I'm a hobbyist. Are you telling me professional
 developers aren't expected to make an informed choice about their
 platform? If that's the case, professional developers are people I
 would NEVER trust to do their job right.

Because I'm not deploying it (the current version, that is). 

For the same reason we don't tell users that they *must* use Python 2.7.1, and 
re-test their 2.4-based code for compatibility: it works.

Not me personally; I use the latest versions of stuff, pretty much. But I 
understand the reason for not wanting to, or at least not wanting to have to.

 
 That is, if I'm using a release from six months ago, and all I need is a 
 point fix,
 
 Then you can dig around the commits and make yourself a patch. At
 least that's what I'd do.

It's what I'd do too. But it makes web2py less friendly than it could be.

[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
when I issue echo $BROWSER I get firefox. I have not used web2py in a
long time, since I have ArchLinux because of this problem. Is there a
way to change web2py as to where it does not launches any browser
I have no plans of changing my system distribution.


THanks


dan




On Dec 18, 9:57 pm, sushanth sushant...@gmail.com wrote:
 On ubuntu you can change your defualt browser with below steps

 susha...@ubuntu:~$ sudo update-alternatives --config x-www-browser
 [sudo] password for sushanth:
 There are 2 choices for the alternative x-www-browser (providing
 /usr/bin/x-www-browser).

   Selection    Path                    Priority   Status
 
 * 0            /usr/bin/google-chrome   150       auto mode
   1            /usr/bin/firefox         40        manual mode
   2            /usr/bin/google-chrome   150       manual mode

 Press enter to keep the current choice[*], or type selection number:


Re: [web2py] Url variable's problem

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 12:32 PM, Arun K.Rajeevan wrote:
 Exactly,
 That's what confuses me.

I have a theory. Or at least a conjecture.

Try looking request.env.query_string. My guess is that, in the case where 
you're seeing a list, indx is showing up twice in the query string from your 
form. When that happens, web2py puts the values into a list. That's recent (but 
correct) behavior on web2py's part, though it's not handling the URL() case 
correctly yet.



[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
Funny cuz when I try this: webbrowser.get()  I get 'webbrowser' is not
defined


agh





On Dec 23, 1:22 pm, greenpoise danel.sega...@gmail.com wrote:
 when I issue echo $BROWSER I get firefox. I have not used web2py in a
 long time, since I have ArchLinux because of this problem. Is there a
 way to change web2py as to where it does not launches any browser
 I have no plans of changing my system distribution.

 THanks

 dan

 On Dec 18, 9:57 pm, sushanth sushant...@gmail.com wrote:



  On ubuntu you can change your defualt browser with below steps

  susha...@ubuntu:~$ sudo update-alternatives --config x-www-browser
  [sudo] password for sushanth:
  There are 2 choices for the alternative x-www-browser (providing
  /usr/bin/x-www-browser).

    Selection    Path                    Priority   Status
  
  * 0            /usr/bin/google-chrome   150       auto mode
    1            /usr/bin/firefox         40        manual mode
    2            /usr/bin/google-chrome   150       manual mode

  Press enter to keep the current choice[*], or type selection number:


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Seriously: no.

I have way to many new features to add to the site and too little time to
worry about testing each time I upgrade.

--
Thadeus




On Thu, Dec 23, 2010 at 3:16 PM, Jonathan Lundell jlund...@pobox.comwrote:

 On Dec 23, 2010, at 1:11 PM, Branko Vukelić wrote:
 
  On Thu, Dec 23, 2010 at 6:19 PM, Jonathan Lundell jlund...@pobox.com
 wrote:
  Seriously: no.
 
  Seriously: yes. Why? Because it's YOUR work that is going to suffer if
  you don't. Why WOULDN'T you test something you are going to deploy?
  I've just tested dozen frameworks and even PHP before starting a
  project, and I'm a hobbyist. Are you telling me professional
  developers aren't expected to make an informed choice about their
  platform? If that's the case, professional developers are people I
  would NEVER trust to do their job right.

 Because I'm not deploying it (the current version, that is).

 For the same reason we don't tell users that they *must* use Python 2.7.1,
 and re-test their 2.4-based code for compatibility: it works.

 Not me personally; I use the latest versions of stuff, pretty much. But I
 understand the reason for not wanting to, or at least not wanting to have
 to.

 
  That is, if I'm using a release from six months ago, and all I need is a
 point fix,
 
  Then you can dig around the commits and make yourself a patch. At
  least that's what I'd do.

 It's what I'd do too. But it makes web2py less friendly than it could be.


Re: [web2py] Re: Unable to detect your browser

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 10:22 PM, greenpoise danel.sega...@gmail.com wrote:
 when I issue echo $BROWSER I get firefox. I have not used web2py in a
 long time, since I have ArchLinux because of this problem. Is there a
 way to change web2py as to where it does not launches any browser
 I have no plans of changing my system distribution.

Arch is defaulting to Py3k. Just run into this minutes ago. :D

Try this:

$ export PYTHON='/usr/bin/python2'; python2 ./web2py

You can add an alias for this in your ~/.bashrc


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread pbreit
I think it's definitely a worthwhile goal to evolve the release schedule 
into stable and feature branches with bugs getting back-ported but suspect 
it will take some time to get there.

Part of the value of a framework is being able to count on its stability. 
For now, we can upgrade more slowly and pay attention to stability reports 
of new releases.


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Branko Vukelić
On Thu, Dec 23, 2010 at 10:40 PM, pbreit pbreitenb...@gmail.com wrote:
 Part of the value of a framework is being able to count on its stability.
 For now, we can upgrade more slowly and pay attention to stability reports
 of new releases.

Yes, yes. Sit around and wait. For what reports again? Based on what
bug reports again? Everyone was sitting and waiting for Massimo to
actually label it as stable release. How wonderful. I'm sure that's
the BEST strategy to ensure web2py is bug free in future releases. Oh,
and what happens if Massimo's stable release turns out to be not that
stable after all? Well, this thread happens.

Last I've heard, Massimo was a single person. I don't know if he can
multiply like amoebae, but I'm sure it'd help if we all just dug into
release candidates or even trunk and _at least_ poked around. Even
better, why not deploy your latest awesome project on the new release
and give it a spin?

All in all, some of you guys are just... I dunno. Irrational. (Or
retarded, but I hope not.) You take far too many things for granted.
FAR too many things. And you fight any notion that doesn't match that
vision. So you don't see the beauty of free software, fine. But what's
this?! Even free as in beer isn't enough for you! You want it ALL. And
what IS the 'all'? Even you don't know. I'll tell you what you want.
You want open-source projects to submit to YOUR selfish and
self-centered vision. Instead of talking about contribution (of your
valuable time to the project that SAVES your valuable time), you
demand, and demand, and demand.

You keep babbling about your selfish needs, not even considering that
there are actual people who have THEIR OWN needs and yet make time to
listen to you, and implement shit in record time. And again, it has to
be said, that saves you your valuable time. Is that not enough for
you? Doesn't that make you happy? Is that ENOUGH?

Well, you know what. You should all be ashamed. You have absolutely NO
RIGHT to demand anything from Massimo or any other contributor. And
don't tell me about how you love web2py but you just wanted X or Y.
You OWE web2py X and Y, so if you want it, just do it yourself. YOU
label releases as stable, and YOU implement stuff. If Massimo does
that for you, it's a BIG FAT favor, and you should keep that in mind.

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Jonathan Lundell
On Dec 23, 2010, at 2:17 PM, Branko Vukelić wrote:
 
 You keep babbling about your selfish needs, not even considering that
 there are actual people who have THEIR OWN needs and yet make time to
 listen to you, and implement shit in record time. And again, it has to
 be said, that saves you your valuable time. Is that not enough for
 you? Doesn't that make you happy? Is that ENOUGH?

I suspect that we're talking at cross purposes.

[web2py] Re: Unable to detect your browser

2010-12-23 Thread greenpoise
brilliant!! THANKS SO MUCH!




On Dec 23, 1:33 pm, Branko Vukelić stu...@brankovukelic.com wrote:
 On Thu, Dec 23, 2010 at 10:22 PM, greenpoise danel.sega...@gmail.com wrote:
  when I issue echo $BROWSER I get firefox. I have not used web2py in a
  long time, since I have ArchLinux because of this problem. Is there a
  way to change web2py as to where it does not launches any browser
  I have no plans of changing my system distribution.

 Arch is defaulting to Py3k. Just run into this minutes ago. :D

 Try this:

 $ export PYTHON='/usr/bin/python2'; python2 ./web2py

 You can add an alias for this in your ~/.bashrc

 --
 Branko Vukelic

 stu...@brankovukelic.comhttp://www.brankovukelic.com/


Re: [web2py] Re: Unable to detect your browser

2010-12-23 Thread Branko Vukelić
2010/12/23 greenpoise danel.sega...@gmail.com:
 brilliant!! THANKS SO MUCH!

You're welcome. It also helps if you build a virtual environment for
developing your apps. Keeps things clean.

First you get virtualenv package with:

$ easy_install-2.7 virtualenv

Then you just run this:

$ virtualenv --no-site-packages /path/to/my/env
$ cd /path/to/my/env
$ source bin/activate
(env) $ python

You'll notice that the interpreter version is now 2.7.x within the
env, and that '(env)' is printed before your prompt. As far as I know,
you cannot exit the environment other than by exiting the shell
altogether.

The environment is sealed off from your local Python install, so
anything that you install within your environment is available only
within the environment and if you use the ``--no-site-packages`` flag,
no packages installed in your local Python path will not be accessible
within the environment. Now, to develop with web2py within the
virtualenv, you just copy web2py dir into the virtualenv dir, and
that's it. Now you can run ``./web2py.py`` normally and web2py will
use the interpreter installed in the env.


-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Kinda of joking, but also kinda serious. It cost time and money to have to
test something just because a decision was made to upgrade the library (in
this case, web2py).

--
Thadeus




2010/12/23 Branko Vukelić stu...@brankovukelic.com

 On Thu, Dec 23, 2010 at 10:29 PM, Thadeus Burgess thade...@thadeusb.com
 wrote:
  Seriously: no.
 
  I have way to many new features to add to the site and too little time to
  worry about testing each time I upgrade.

 I really hope you're just joking, and I'm just too stupid to get the
 funny part. :P

 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



[web2py] Re: Great summary of web2py

2010-12-23 Thread VP


On Dec 23, 3:44 am, Branko Vukelić stu...@brankovukelic.com wrote:
 Or am I missing something?

 In the summary, also no mention of Django or Flask.


My comment is not just about that specific thread of discussion, but
about a general PR strategy of web2py.   My suggestion to Massimo
still stands.   Forget about Flask and Django !!!  Don't talk about
them at all.  None. Nothing.

People who think that Django/Flask are superior to web2py, and/or
web2py is deeply flawed, aren't changing their minds.  There's no
point to debate, justify, etc.

I do not see much benefit for web2py when Massimo discusses Django/
Flask.   On the other hand, the (serious) newbies will get lost in hot
exchanges between the web2py folks and the Django/Flask folks.
Occasionally, this dude Armin will come around the proclaim web2py to
be the worst thing there is.  And my suggestion to Massimo is that he
will have to live with that, and instead of spending energy to justify
him, turn that energy into making web2py to be a great platform.




Specifically, to attract newbies, I would recommend making Chapter 3
of the book to be better than it currently is.   Right now, it's very
good.  But I think there are places that can be improved.  This
chapter is where web2py can be/should be showcased to attract the
newbies.   This comes from my experience when I first learned about
web2py.






Re: [web2py] Re: The stability of web2py releases

2010-12-23 Thread Thadeus Burgess
Good. Now this thread can go into the list of many archived threads about
this topic.

Nothing will happen and things will continue as they have been, which isn't
so bad because nobody is forcing you to upgrade your web2py version each
time a new release comes out.

However, Branko, part of the problem that nobody else can even perform basic
release management. Nobody but Massimo has access to trunk, and therefore
nobody but Massimo can make releases, create branches, maintain stable etc.
This leaves the project in a odd state that the only thing that can be done
is to complain.

Its free software, if you don't like it, fork it and manage it yourself.

--
Thadeus




2010/12/23 Branko Vukelić stu...@brankovukelic.com

 On Thu, Dec 23, 2010 at 11:21 PM, Jonathan Lundell jlund...@pobox.com
 wrote:
  I suspect that we're talking at cross purposes.

 I have nothing more to say in this ridiculous thread.

 --
 Branko Vukelic

 stu...@brankovukelic.com
 http://www.brankovukelic.com/



Re: [web2py] Re: Great summary of web2py

2010-12-23 Thread Branko Vukelić
2010/12/23 VP vtp2...@gmail.com:
 People who think that Django/Flask are superior to web2py, and/or
 web2py is deeply flawed, aren't changing their minds.  There's no
 point to debate, justify, etc.

True.

Off-topic

I've recently tested Flask briefly. I didn't like it's way of routing.
But then I realized something (and Flask docs confirm that as well).
Flask and web2py are not even in the same league. Flask was developed
to handle small stuff, where having routing stuff dispersed around the
code base is acceptable, because the codebase itself tends to be small
in such projects. But that sucks for larger projects. In contrast,
web2py is geared towards far more organized code, and therefore larger
projects. At least to some extent. I'm not sure about globals, but I
don't develop large projects myself, so it's fine for me.

So I don't even understand how Flask can be compared to web2py at all.
Two different things, with two different design goals.

/Off-topic

-- 
Branko Vukelic

stu...@brankovukelic.com
http://www.brankovukelic.com/


[web2py] executing code from db

2010-12-23 Thread mattynoce
hi all. i know this doesn't sound like a superb idea, but i may have
to do something like it.

i have data coming from the db and being displayed to the user as
instructions. do this, go there, etc.

i'd like to have that data executed in the environment, so i could say
do this, {{=user.first_name}}. but when i say
{{=XML(instruction.step)}} it spits out the raw text but doesn't
execute it.

this only happens for db info that we put in, no user data. is there a
way to run it through the web2py interpreter before displaying it to
the user?

thanks, and happy holidays.

matt


[web2py] Re: Great summary of web2py

2010-12-23 Thread mdipierro
Flask is nice and I am not complaining about it. Yet, if I needed
something small where web2py was too much overhead (and it can be I
guess), I would go with bottle.py+dal.py. The bottle source code is
beautiful and the routing mechanism seems similar to flask.

Massimo

On Dec 23, 5:12 pm, Branko Vukelić stu...@brankovukelic.com wrote:
 2010/12/23 VP vtp2...@gmail.com:

  People who think that Django/Flask are superior to web2py, and/or
  web2py is deeply flawed, aren't changing their minds.  There's no
  point to debate, justify, etc.

 True.

 Off-topic

 I've recently tested Flask briefly. I didn't like it's way of routing.
 But then I realized something (and Flask docs confirm that as well).
 Flask and web2py are not even in the same league. Flask was developed
 to handle small stuff, where having routing stuff dispersed around the
 code base is acceptable, because the codebase itself tends to be small
 in such projects. But that sucks for larger projects. In contrast,
 web2py is geared towards far more organized code, and therefore larger
 projects. At least to some extent. I'm not sure about globals, but I
 don't develop large projects myself, so it's fine for me.

 So I don't even understand how Flask can be compared to web2py at all.
 Two different things, with two different design goals.

 /Off-topic

 --
 Branko Vukelic

 stu...@brankovukelic.comhttp://www.brankovukelic.com/


[web2py] Re: Great summary of web2py

2010-12-23 Thread JmiXIII
Just to give a pleased newbie feed-back :

_I'm newbie to web2py (well a couple of month)
_I've never studied informatics nor did I have an informatic job

BUT I needed something to handle database easely + human interface +
network for my job
I tried a crack access = beurk = begin to learn python
I tried Zope/Plone = too heavy
I tried Django = not enough efficient for what I wanted

THEN
I've seen some comparaison made by Massimo between Django and web2py
'do not remember the url)
AND This is these comparisons which decided me to try web2py
I'm very pleased because it is so efficient

you are right VP , it's a waste of time to fuel the fire. But a short
comparison would help newbies to make their choice and choose to try
web2py. Yet I'm speaking of comparison showing the efficientness of
web2py not long long debates/war.



On 23 déc, 23:51, VP vtp2...@gmail.com wrote:
 On Dec 23, 3:44 am, Branko Vukelić stu...@brankovukelic.com wrote:

  Or am I missing something?

  In the summary, also no mention of Django or Flask.

 My comment is not just about that specific thread of discussion, but
 about a general PR strategy of web2py.   My suggestion to Massimo
 still stands.   Forget about Flask and Django !!!  Don't talk about
 them at all.  None. Nothing.

 People who think that Django/Flask are superior to web2py, and/or
 web2py is deeply flawed, aren't changing their minds.  There's no
 point to debate, justify, etc.

 I do not see much benefit for web2py when Massimo discusses Django/
 Flask.   On the other hand, the (serious) newbies will get lost in hot
 exchanges between the web2py folks and the Django/Flask folks.
 Occasionally, this dude Armin will come around the proclaim web2py to
 be the worst thing there is.  And my suggestion to Massimo is that he
 will have to live with that, and instead of spending energy to justify
 him, turn that energy into making web2py to be a great platform.

 Specifically, to attract newbies, I would recommend making Chapter 3
 of the book to be better than it currently is.   Right now, it's very
 good.  But I think there are places that can be improved.  This
 chapter is where web2py can be/should be showcased to attract the
 newbies.   This comes from my experience when I first learned about
 web2py.


[web2py] ajax polling with web2py

2010-12-23 Thread weheh
How would I do this?
#view
DIV(A('click me',_href='#',_id='parent',_onclick(ajax('clickback',
['parent'],':eval');)))

#controller
def clickback():
  return 'jQuery(#parent).html(%s);' %\
 SCRIPT(alert('hello world');)

So that when I click on click me it calls the clickback, which
inserts the alert on top of the same parent. If overwriting one's
calling div isn't kosher, then I'm OK targeting a second div.


Re: [web2py] Re: Great summary of web2py

2010-12-23 Thread Michele Comitini
Maybe we should keep a comparison just on web2py.com.  Pay attention
to framework lists around and putting a sane description there.
It is useless and even counterproductive starting flame wars in
threaded discussions.  It is more importante that googlers find web2py
when
they search a good framework to work with.


2010/12/24 JmiXIII sylvn.p...@gmail.com:
 Just to give a pleased newbie feed-back :

 _I'm newbie to web2py (well a couple of month)
 _I've never studied informatics nor did I have an informatic job

 BUT I needed something to handle database easely + human interface +
 network for my job
 I tried a crack access = beurk = begin to learn python
 I tried Zope/Plone = too heavy
 I tried Django = not enough efficient for what I wanted

 THEN
 I've seen some comparaison made by Massimo between Django and web2py
 'do not remember the url)
 AND This is these comparisons which decided me to try web2py
 I'm very pleased because it is so efficient

 you are right VP , it's a waste of time to fuel the fire. But a short
 comparison would help newbies to make their choice and choose to try
 web2py. Yet I'm speaking of comparison showing the efficientness of
 web2py not long long debates/war.



 On 23 déc, 23:51, VP vtp2...@gmail.com wrote:
 On Dec 23, 3:44 am, Branko Vukelić stu...@brankovukelic.com wrote:

  Or am I missing something?

  In the summary, also no mention of Django or Flask.

 My comment is not just about that specific thread of discussion, but
 about a general PR strategy of web2py.   My suggestion to Massimo
 still stands.   Forget about Flask and Django !!!  Don't talk about
 them at all.  None. Nothing.

 People who think that Django/Flask are superior to web2py, and/or
 web2py is deeply flawed, aren't changing their minds.  There's no
 point to debate, justify, etc.

 I do not see much benefit for web2py when Massimo discusses Django/
 Flask.   On the other hand, the (serious) newbies will get lost in hot
 exchanges between the web2py folks and the Django/Flask folks.
 Occasionally, this dude Armin will come around the proclaim web2py to
 be the worst thing there is.  And my suggestion to Massimo is that he
 will have to live with that, and instead of spending energy to justify
 him, turn that energy into making web2py to be a great platform.

 Specifically, to attract newbies, I would recommend making Chapter 3
 of the book to be better than it currently is.   Right now, it's very
 good.  But I think there are places that can be improved.  This
 chapter is where web2py can be/should be showcased to attract the
 newbies.   This comes from my experience when I first learned about
 web2py.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Continued ... oops, I hit send ...

of course, I want the alert to be triggered after writing parent div.


Re: [web2py] ajax polling with web2py

2010-12-23 Thread Michele Comitini
I do not know what criteria you would use to understand if #parent is
acceptable or not but you
can pass as many other ids as you need:

DIV(A('click me',_href='#',_id='parent',_onclick(ajax('clickback',
 ['parent', '2nd', '3rd', ... 'nth'],':eval');)))


#controller
def clickback():
 for t in args:
   if kosher(t):
 target = t
 return 'jQuery(# + target).html(%s);' %\
    SCRIPT(alert('hello world');)

2010/12/24 weheh richard_gor...@verizon.net:
 How would I do this?
 #view
 DIV(A('click me',_href='#',_id='parent',_onclick(ajax('clickback',
 ['parent'],':eval');)))

 #controller
 def clickback():
  return 'jQuery(#parent).html(%s);' %\
     SCRIPT(alert('hello world');)

 So that when I click on click me it calls the clickback, which
 inserts the alert on top of the same parent. If overwriting one's
 calling div isn't kosher, then I'm OK targeting a second div.


[web2py] Re: The stability of web2py releases

2010-12-23 Thread weheh
Massimo, good news. Web2py is successfully being adopted by more and
more developers who are using it for very serious purposes. It's going
viral. Therefore, there need to be at most a few major releases a year
and a bunch of incrementals in-between.

I anticipated a challenging release with the latest DAL changes. At
enterprises where I've worked in the past, changes to the db layer
were always considered major releases. That's when the troops were
mustered to test en-mass before pushing the product out the door.

Web2py quality must always be of paramount importance. In the absence
of a delegate, we look to you to lead this issue. It almost goes
without saying that doing it right will ultimately have a larger
impact on web2py's credibility than upgrading the documentation did.
But, doing it wrong will have immediate disastrous consequences.


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Sorry, I'm sure I wasn't clear. The routine I posted does not work.
The parent div is properly updated, however the alert is not executed.
I want the alert to be executed without further action by the user.


On Dec 23, 7:02 pm, Michele Comitini michele.comit...@gmail.com
wrote:
 I do not know what criteria you would use to understand if #parent is
 acceptable or not but you
 can pass as many other ids as you need:

 DIV(A('click me',_href='#',_id='parent',_onclick(ajax('clickback',
  ['parent', '2nd', '3rd', ... 'nth'],':eval');)))

 #controller
 def clickback():
  for t in args:
    if kosher(t):
      target = t
  return 'jQuery(# + target).html(%s);' %\
     SCRIPT(alert('hello world');)

 2010/12/24 weheh richard_gor...@verizon.net:

  How would I do this?
  #view
  DIV(A('click me',_href='#',_id='parent',_onclick(ajax('clickback',
  ['parent'],':eval');)))

  #controller
  def clickback():
   return 'jQuery(#parent).html(%s);' %\
      SCRIPT(alert('hello world');)

  So that when I click on click me it calls the clickback, which
  inserts the alert on top of the same parent. If overwriting one's
  calling div isn't kosher, then I'm OK targeting a second div.




Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Albert Abril
Happy Holidays, happy winter solstice, and happy new year.

No doubt we have a great community!

Kind Regards!

-- 
Albert Abril,
@desmondo


[web2py] Re: ajax polling with web2py

2010-12-23 Thread weheh
Let me try to state this more succinctly:

How do I get a jQuery, which is created by a controller in response to
an ajax call, to execute when loaded into it's target div?


[web2py] Re: The stability of web2py releases

2010-12-23 Thread mdipierro
I think the issue can be solved by labeling releases and posting older
- more stable - releases.

This is what I do now:
- I always work on trunk - trunk is very unstable
- Once in a while when trunk is stable I post a nightly build which
is more like a release candidate. It does not change nightly, but more
likely weekly as more and more features are added.
- When I have no open issues AND I am happy about the nightly built, I
post it as stable.
- The first stable is usually 1.xx.1 - this is when problems usually
starts...
  1) one problem is occasionally build errors that may affect GAE,
Windows or Mac
  2) one problem may be bug in new features that were not very well
tested
  3) one problem may be that new feature break something that use to
work (thisis the thing I am mostly concerned about. It happens for
very obscure features that few users are using and hard to discover
until a major release) Anyway...
- the 1.xx.1 is followed by 1.xx.2 and 1.xx.3 and ... 1.xx.N during a
short period of time (within 48hrs). These are all bug fixed releases
and no new features are added. They usually fix 3) completely in
48hrs. Usually is there is only open ticket remaining it is about a
new experimental feature OR a pre-existing issue.
- keep all previous 1.XX.N versions that had a relatively long life in
http://web2py.com/examples/static/1.XX.N/web2py_src.zip
- I delete the 1.XX.m with mN for space.

-
I could post links to all previous versions. Nothing wrong with that.
But the more people hold on old version instead of moving to 1.XX.1,
the less likely bugs will be discovered and fixed in 48hrs.
-

1.90.1 and later versions are a big of an exception. They included the
new DAL. That means that from 1.89 to 1.90, 5000 lines, ~25% of the
entire web2py python source, code were completely rewritten!

Some of you may look at the 4-5 bug reports that we fixed in 1.90.4
and say those 5 bugs had to be caught before!. I look at it and say
How can it be we rewrote 25% of web2py, from scratch, and we had only
45 backward compatibility issues? And we managed to fix 4 them in 48
hours? (one is still open and will be fixed soon).

The only times when we had a change of comparable importance is when
Thadeus rewrote the template engine and when Jonathan rewrote the
routing module, those too went very well.

Anyway, the point is. We are not going to have a jump of this
magnitude again for some time. Most of the new released have a smaller
set of differences and therefore are less error prone.

Massimo


On Dec 23, 6:55 pm, weheh richard_gor...@verizon.net wrote:
 Massimo, good news. Web2py is successfully being adopted by more and
 more developers who are using it for very serious purposes. It's going
 viral. Therefore, there need to be at most a few major releases a year
 and a bunch of incrementals in-between.

 I anticipated a challenging release with the latest DAL changes. At
 enterprises where I've worked in the past, changes to the db layer
 were always considered major releases. That's when the troops were
 mustered to test en-mass before pushing the product out the door.

 Web2py quality must always be of paramount importance. In the absence
 of a delegate, we look to you to lead this issue. It almost goes
 without saying that doing it right will ultimately have a larger
 impact on web2py's credibility than upgrading the documentation did.
 But, doing it wrong will have immediate disastrous consequences.


[web2py] Re: Left Join with aliased table and the new DAL

2010-12-23 Thread mdipierro
I took a second look. The first problem is indeed fixed. The second
problem is not a new dal issue. It is just that aliased tables in
INNER JOINs never worked well. I will continue to look into it. This
may take a while so could you open a ticket on google code? Thanks.

On Dec 22, 2:52 am, HaM yarib...@gmail.com wrote:
 Ok in order to simplify the problem I have changed my code to this:
 Domain = db.domain
 Client = db.client
 Manager = db.contact.with_alias('manager')

 sql = db((Domain.id==1)(Client.id==Domain.client_id))._select(
                 Domain.name, Client.name, Manager.name,
                 left=[Manager.on(Manager.id==Client.manager_id)])
 print sql

 The result is:
 SELECT  domain.name, client.name, contact.name FROM domain, client,
 contact LEFT JOIN contact AS manager ON (contact.id =
 client.manager_id) WHERE ((domain.id = 1) AND (client.id =
 domain.client_id));

 And this request is not correct for PostgreSQL. I think that it should
 be :
 SELECT  domain.name, client.name, manager.name FROM domain, client
 LEFT JOIN contact as manager ON (manager.id = client.manager_id) WHERE
 ((domain.id = 1) AND (client.id = domain.client_id));

 Which works well.

 In order to push research further I also tried to do only INNER JOIN
 with an aliased table and it partially works:
 Domain = db.domain
 Client = db.client
 Manager = db.contact.with_alias('manager')
 sql = db((Domain.id==1)
         (Client.id==Domain.client_id)
         (Manager.id==Client.manager_id))._select(
         Domain.name, Client.name, Manager.name)
 print sql

 Result:
 SELECT  domain.name, client.name, contact.name FROM domain, client,
 contact WHERE (((domain.id = 1) AND (client.id = domain.client_id))
 AND (contact.id = client.manager_id));

 It works but it doesn't use the alias name for the table contact. Thus
 the resulting dict() doesn't contains the key manager but the key
 contact.

 Thank you for investigating this problem so quickly.

 On Dec 21, 10:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  hmm...

  I am trying your select and it now generates the same sql as the old
  dal. please try this:

  Domain = db.domain
  Client = db.client
  Manager = db.contact.with_alias('manager')
  sql = db(Domain.id==1)._select(
      Domain.ALL, Client.ALL,Manager.ALL,
      left=[Client.on(Client.id==Domain.client_id),
            Manager.on(Manager.id==Client.manager_id)])
  print sql

  what do you get?
  I get

  SELECT  domain.id, domain.name, domain.client_id, client.id,
  client.name, client.manager_id, manager.id, manager.name FROM domain
  LEFT JOIN client ON (client.id = domain.client_id) LEFT JOIN contact
  AS manager ON (manager.id = client.manager_id) WHERE (domain.id = 1);

  On Dec 21, 2:55 pm, HaM yarib...@gmail.com wrote:

   I just tried with the last revision (1414:da25156addab) and the
   problem stills the same.




[web2py] Re: Encountering problem with a computer field

2010-12-23 Thread mdipierro
For now I have a simple try except. I will see if that you suggest is
possible.

Massimo

On Dec 23, 11:33 am, Magnitus fbunny2...@hotmail.com wrote:
 I've thought about the dependencies problem a little bit.

 Maybe add some kind of hook so that the user can define the
 dependencies of the computed field himself.

 If he doesn't define them, the current behavior occurs.

 If he defines them, the behavior could be as follow:

 1) All the dependencies are present in the input

 The field is updated from the input

 2) Part of the dependencies are present in the input

 The current behavior occurs. Alternatively, try to read the missing
 dependencies from the DB (for an update) or from the default values
 (for an insert), but I'm not sure how complicated that would be.

 3) None of the dependencies are present in the input

 The computed field is not updated.

 From the above, you'd get the best of all worlds.

 1) User friendliness: The user doesn't have to define dependencies if
 he doesn't want to and he'd get the current behavior.

 2) Flexibility: The user can define dependencies in which case the
 computed field doesn't restrict updates that don't include the
 dependencies on the field.

 3) Correctness: Exceptions due to mistyping variables are not caught
 and properly raised.

 On Dec 23, 9:11 am, mdipierro mdipie...@cs.depaul.edu wrote:

  Need to think about it.

  On Dec 23, 3:51 am, cjrh caleb.hatti...@gmail.com wrote:

   On Dec 23, 2:04 am, mdipierro mdipie...@cs.depaul.edu wrote:

I can add a try except so that web2py does not tries to compute fields
when there is not enough information. The downside is that a typo will
result in a silent failure to compute. Perhaps we should do this
anyway.

   If you're going to be doing work in the area of compute anyway, is
   there a posssibility of making another change that the current value
   of the compute-ed field can be passed to the compute method?- Hide quoted 
   text -

  - Show quoted text -




Re: [web2py] Re: ajax polling with web2py

2010-12-23 Thread Kuba Kucharski
hi,

that is a very good question. April, f.e:

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


-- 
Kuba


Re: [web2py] Re: Merry Christmas

2010-12-23 Thread Luis Díaz
+1


2010/12/24 Albert Abril albert.ab...@gmail.com

 Happy Holidays, happy winter solstice, and happy new year.

 No doubt we have a great community!

 Kind Regards!

 --
 Albert Abril,
 @desmondo




-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

http://web2pyfacil.blogspot.com/
Facultad de 
Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85


[web2py] Re: GAE shows problem.

2010-12-23 Thread mdipierro
The problem is that the query is missing.
Do you know if this worked in 1.89.x?

On Dec 23, 1:41 pm, Arun K.Rajeevan the1.a...@gmail.com wrote:
 see GAE error message. (it runs perfectly fine, if web2py run stand alone)
 And was running ok, till previos hour.
 What I can track is *init/controllers/default.py:index, line 5, in module

 *and that line is perfect (given below) and runs ok in web2py stand alone.
 *options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in
 db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a:
 a.full)]*

 --
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
 _appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue
 is d
 eprecated, please use google.appengine.api.taskqueue
   description)
 ERROR    2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent
 call
 last):
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \restricted.py, line 188, in restricted
     exec ccode in environment
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
 cations\*init/controllers/default.py:index, line 5, in module*
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 4388, in select
     return self.db._adapter.select(self.query,fields,attributes)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 2654, in select
     (items, tablename, fields) = self.select_raw(query,fields,attributes)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 2611, in select_raw
     tablename = self.get_table(query)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 894, in get_table
     raise RuntimeError, No table selected
 RuntimeError: No table selected


[web2py] job

2010-12-23 Thread mdipierro
I found this:

http://www.i-freelancer.org/php/python-developerqa-odesk/


[web2py] Re: GAE shows problem.

2010-12-23 Thread mdipierro
for now do this instead:

db(db.languages).select(cache=(cache.ram,3600)).sort(lambda a:
a.full)]*

mind that unless you redefined cache.ram as GAE memcache the caching
will not work.

On Dec 23, 1:41 pm, Arun K.Rajeevan the1.a...@gmail.com wrote:
 see GAE error message. (it runs perfectly fine, if web2py run stand alone)
 And was running ok, till previos hour.
 What I can track is *init/controllers/default.py:index, line 5, in module

 *and that line is perfect (given below) and runs ok in web2py stand alone.
 *options = [OPTION(row.full + '  - ' + row.short, _value=row.id) for row in
 db().select(db.languages.ALL, cache=(cache.ram,3600)).sort(lambda a:
 a.full)]*

 --
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\google\appengine\tools\dev
 _appserver.py:1798: DeprecationWarning: google.appengine.api.labs.taskqueue
 is d
 eprecated, please use google.appengine.api.taskqueue
   description)
 ERROR    2010-12-23 19:24:43,640 restricted.py:151] Traceback (most recent
 call
 last):
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \restricted.py, line 188, in restricted
     exec ccode in environment
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\appli
 cations\*init/controllers/default.py:index, line 5, in module*
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 4388, in select
     return self.db._adapter.select(self.query,fields,attributes)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 2654, in select
     (items, tablename, fields) = self.select_raw(query,fields,attributes)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 2611, in select_raw
     tablename = self.get_table(query)
   File
 I:\Evolve\Work\web2py_src_downloaded\google_appengine\visuallingua\gluon
 \dal.py, line 894, in get_table
     raise RuntimeError, No table selected
 RuntimeError: No table selected


  1   2   >