[web2py] Re: Problem with basic auth

2010-12-29 Thread Adi
Sorry for the late response. I tried putting print statements in this
method, but I don't see anything on the console. Is there an option
while starting web2py to enable this?

On Dec 15, 10:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Hmmm... look into gluon/tools.py

     def basic(self):
         if not self.settings.allow_basic_login:
             return False
         basic = self.environment.request.env.http_authorization
         if not basic or not basic[:6].lower() == 'basic ':
             return False
         (username, password) = base64.b64decode(basic[6:]).split(':')
         return self.login_bare(username, password)

 Can you add some print debug statements as see where it fails?

 On Dec 15, 10:23 am, Adi aditya.sa...@gmail.com wrote:







  Hi,

  I'm trying to set up a function for authenticating users over a service.

  This is my method:

  def authenticate():

  is_loggedin = auth and auth.user

  if not is_loggedin:

  auth.allow_basic_login = True

  is_loggedin = auth.basic()

  return is_loggedin

  This is how I call it: curl -u 
  a%40b.com:testhttp://127.0.0.1:8000/app/default/authenticate

   a...@b.com is the username, test is the password. This is returning False 
  when
  I expected True. What am I missing?


[web2py] [CLOSED] Re: Problem with basic auth

2010-12-29 Thread Adi
Update: Needed to restart web2py (sorry I'm spoilt!)

Ok it works as expected. It seems I need to unescape the @ symbol in
username before calling basic(). I was using the encoded %40 instead.


On Dec 29, 1:10 pm, Adi aditya.sa...@gmail.com wrote:
 Sorry for the late response. I tried putting print statements in this
 method, but I don't see anything on the console. Is there an option
 while starting web2py to enable this?

 On Dec 15, 10:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:







  Hmmm... look into gluon/tools.py

      def basic(self):
          if not self.settings.allow_basic_login:
              return False
          basic = self.environment.request.env.http_authorization
          if not basic or not basic[:6].lower() == 'basic ':
              return False
          (username, password) = base64.b64decode(basic[6:]).split(':')
          return self.login_bare(username, password)

  Can you add some print debug statements as see where it fails?

  On Dec 15, 10:23 am, Adi aditya.sa...@gmail.com wrote:

   Hi,

   I'm trying to set up a function for authenticating users over a service.

   This is my method:

   def authenticate():

   is_loggedin = auth and auth.user

   if not is_loggedin:

   auth.allow_basic_login = True

   is_loggedin = auth.basic()

   return is_loggedin

   This is how I call it: curl -u 
   a%40b.com:testhttp://127.0.0.1:8000/app/default/authenticate

    a...@b.com is the username, test is the password. This is returning 
   False when
   I expected True. What am I missing?


[web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread canna
Thank you guys for your answers,
ron - it was just an example
Luther - this table was migrated from our old data and we do intent to
use auth instead

still, it's good practice to always have unique field or combination
of fields in a table besides the id, id is for machines, not suitable
for the real world

my understanding is that IS_NOT_IN_DB is not forced at the database
level like the unique keyword, I'm looking for something like the
unique keyword only for multiple fields, not just one
is there something like this?






[web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread canna
Thank you guys for your answers,
ron - it was just an example
Luther - this table was migrated from our old data and we do intent to
use auth instead

still, it's good practice to always have unique field or combination
of fields in a table besides the id, id is for machines, not suitable
for the real world

my understanding is that IS_NOT_IN_DB is not forced at the database
level like the unique keyword, I'm looking for something like the
unique keyword only for multiple fields, not just one
is there something like this?






Re: [web2py] Re: Web2Py Foundation?

2010-12-29 Thread Graham Dumpleton


On Wednesday, December 29, 2010 6:48:51 PM UTC+11, stu...@brankovukelic.com 
wrote:

  It is an open question whether distribution of such modified copies are
  legally allowed to still be called web2py if Massimo has sole legal 
 rights
  on the name. Thus, you may be able to do that, but you likely would have 
 to
  call it something other than web2py.

 Well, uneless dead people can sue you in court, it's probably as legal
 as written permission

Sorry,  his heir could most likely sue you.

Graham

 -- 

 Branko Vukelic

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



[web2py] Problems in web2py 1.83.2

2010-12-29 Thread Maurice Ling
Hi

I have a problem since version 1.83.2. It gives me this error:

Traceback (most recent call last):
  File D:\web2py\gluon\restricted.py, line 186, in restricted
exec ccode in environment
  File D:/web2py/applications/init/controllers/default.py, line 91,
in module
  File D:\web2py\gluon\globals.py, line 96, in lambda
self._caller = lambda f: f()
  File D:/web2py/applications/init/controllers/default.py, line 55,
in index
name = check_login()
  File D:/web2py/applications/init/controllers/default.py, line 38,
in check_login
redirect(URL(r=request, f='../account/log_in'))
  File D:\web2py\gluon\html.py, line 226, in _URL
return URL(*args, **kwargs)
  File D:\web2py\gluon\html.py, line 186, in URL
raise SyntaxError, 'not enough information to build the url'
SyntaxError: not enough information to build the url

My codes worked up to version 1.82.1.

I am using my own authorization/login codes which is in controllers/
account.py. The offending code (check_login function) is as follows:

def check_login(session=session):
if session.login_time == None:
session.login_time = 0
if session.username == None or \
session.login_time + login_expiry * 3600  int(time.time()):
redirect(URL(r=request, f='../account/log_in'))
else:
return session.username

In version 1.82.1, check_login (called by http://localhost:8000/init)
redirects to http://localhost:8000/init/account/login. But from
version 1.83.2, it seems to redirect to 
http://localhost:8000/init/default/init/account/login
which is non-existent.

Any ideas what might be happening?

Thanks
Maurice Ling


Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Kenneth Lundström

If I remember correctly there was something about this on the list.

I think you use the URL the wrong way and until version 1.83.2 the 
helper worked wrongly. In your case it worked but it has been 
corrected and it doesn´t work anymore.


Try something like URL(c='account', f='log_in')


Kenneth



Hi

I have a problem since version 1.83.2. It gives me this error:

Traceback (most recent call last):
   File D:\web2py\gluon\restricted.py, line 186, in restricted
 exec ccode in environment
   File D:/web2py/applications/init/controllers/default.py, line 91,
inmodule
   File D:\web2py\gluon\globals.py, line 96, inlambda
 self._caller = lambda f: f()
   File D:/web2py/applications/init/controllers/default.py, line 55,
in index
 name = check_login()
   File D:/web2py/applications/init/controllers/default.py, line 38,
in check_login
 redirect(URL(r=request, f='../account/log_in'))
   File D:\web2py\gluon\html.py, line 226, in _URL
 return URL(*args, **kwargs)
   File D:\web2py\gluon\html.py, line 186, in URL
 raise SyntaxError, 'not enough information to build the url'
SyntaxError: not enough information to build the url

My codes worked up to version 1.82.1.

I am using my own authorization/login codes which is in controllers/
account.py. The offending code (check_login function) is as follows:

def check_login(session=session):
 if session.login_time == None:
 session.login_time = 0
 if session.username == None or \
 session.login_time + login_expiry * 3600  int(time.time()):
 redirect(URL(r=request, f='../account/log_in'))
 else:
 return session.username

In version 1.82.1, check_login (called by http://localhost:8000/init)
redirects to http://localhost:8000/init/account/login. But from
version 1.83.2, it seems to redirect to 
http://localhost:8000/init/default/init/account/login
which is non-existent.

Any ideas what might be happening?

Thanks
Maurice Ling




[web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread mdipierro
or

URL('account', 'log_in')

On Dec 29, 3:14 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 If I remember correctly there was something about this on the list.

 I think you use the URL the wrong way and until version 1.83.2 the
 helper worked wrongly. In your case it worked but it has been
 corrected and it doesn t work anymore.

 Try something like URL(c='account', f='log_in')

 Kenneth

  Hi

  I have a problem since version 1.83.2. It gives me this error:

  Traceback (most recent call last):
     File D:\web2py\gluon\restricted.py, line 186, in restricted
       exec ccode in environment
     File D:/web2py/applications/init/controllers/default.py, line 91,
  inmodule
     File D:\web2py\gluon\globals.py, line 96, inlambda
       self._caller = lambda f: f()
     File D:/web2py/applications/init/controllers/default.py, line 55,
  in index
       name = check_login()
     File D:/web2py/applications/init/controllers/default.py, line 38,
  in check_login
       redirect(URL(r=request, f='../account/log_in'))
     File D:\web2py\gluon\html.py, line 226, in _URL
       return URL(*args, **kwargs)
     File D:\web2py\gluon\html.py, line 186, in URL
       raise SyntaxError, 'not enough information to build the url'
  SyntaxError: not enough information to build the url

  My codes worked up to version 1.82.1.

  I am using my own authorization/login codes which is in controllers/
  account.py. The offending code (check_login function) is as follows:

  def check_login(session=session):
       if session.login_time == None:
           session.login_time = 0
       if session.username == None or \
           session.login_time + login_expiry * 3600  int(time.time()):
           redirect(URL(r=request, f='../account/log_in'))
       else:
           return session.username

  In version 1.82.1, check_login (called byhttp://localhost:8000/init)
  redirects tohttp://localhost:8000/init/account/login. But from
  version 1.83.2, it seems to redirect 
  tohttp://localhost:8000/init/default/init/account/login
  which is non-existent.

  Any ideas what might be happening?

  Thanks
  Maurice Ling




Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Branko Vukelić
2010/12/29 Kenneth Lundström kenneth.t.lundst...@gmail.com:
 If I remember correctly there was something about this on the list.

 I think you use the URL the wrong way and until version 1.83.2 the helper
 worked wrongly. In your case it worked but it has been corrected and it
 doesn´t work anymore.

Hm. Isn't that technically a case of breaking backwards compatibility?

-- 
Branko Vukelic

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


Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Kenneth Lundström
I might be completly wrong but I think the way URL was used by Maurice 
was wrong, it should not have worked, but thanks to a bug in URL it 
worked the way Maurice wanted.


So I guess it depends on how you look at it. Did it break backwards 
compatibility.


If your are using a bug and somebody repairs that bug your application 
stops working.



Kenneth


2010/12/29 Kenneth Lundström kenneth.t.lundst...@gmail.com:

If I remember correctly there was something about this on the list.

I think you use the URL the wrong way and until version 1.83.2 the helper
worked wrongly. In your case it worked but it has been corrected and it
doesn´t work anymore.

Hm. Isn't that technically a case of breaking backwards compatibility?





Re: [web2py] Re: Powertable remarks

2010-12-29 Thread rochacbruno
Hi,

Thank you for testing, it is more updated in bitbucket. Now it has search by 
column and a test version of server side processing. 

If you want to change the pager do: 

plugins.powerTable.dtfeatures['sPaginationType'] = 'full_numbers' 

Here is a demo:
http://powertable.blouweb.com/products?pager=full_numbers

Bruno. 


Em 29/12/2010, às 02:49, tomt tom_tren...@yahoo.com escreveu:

 Hi Bruno,
 
 I've just tried using your powertables plugin and I love it. The
 general appearance is great and the default search function is exactly
 what I was looking for.  I'm looking forward to trying out the
 features you've planned.
 
 One small concern I have is the example I implemented allows me to
 page to 'next' and 'previous' but there is not a link for 'first' or
 'last' page.  It would be great if this was possible.
 
 Keep up the good work.  - Tom
 
 
 On Dec 18, 3:38 pm, Bruno Rocha rochacbr...@gmail.com wrote:
  jqGrid also supports progressive loading (without paging , it
 does ajax to load while scrolling down).
 
 I do not see those features exist in datatables.
 
 Just got progressive loading working on powerTable plugin
 
 powerTable.dtfeatures['bScrollInfinite'] = True
 powerTable.dtfeatures['iScrollLoadGap'] = 10 #number of rows to load by time
 
 I am still working hard to make server side load to work well.
 
 (I am having a good time with datatables library, the community in
 datatables.net forum is very helpful)
 
 Will update the plugin soon.
 
 --
 
 Bruno Rochahttp://about.me/rochacbruno/bio


Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Branko Vukelić
2010/12/29 Kenneth Lundström kenneth.t.lundst...@gmail.com:
 If your are using a bug and somebody repairs that bug your application stops
 working.

I agree completely. However, it's a tricky situation if you insist on
ever-backwards-compatible. You only insist on that because you don't
want to break people's apps. Yet a bug fix may sometimes do just that.

-- 
Branko Vukelic

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


Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Kenneth Lundström

I guess not even web2py is perfect. Maybe some day.


Kenneth


2010/12/29 Kenneth Lundströmkenneth.t.lundst...@gmail.com:

If your are using a bug and somebody repairs that bug your application stops
working.

I agree completely. However, it's a tricky situation if you insist on
ever-backwards-compatible. You only insist on that because you don't
want to break people's apps. Yet a bug fix may sometimes do just that.





Re: [web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread Manuele Pesenti

Il 28/12/2010 23:40, Luther Goh Lu Feng ha scritto:

Is there a reason why you are not using Auth, if you aren't?

http://www.web2py.com/book/default/chapter/08#Authentication

Anyway, assuming that you truly want to add the unique constraint,
then I am guessing that you could construct virtual fields

http://www.web2py.com/book/default/chapter/06#Virtual-Fields

and apply the constraint 
http://www.web2py.com/book/default/docstring/IS_NOT_IN_DB

db.page.title.requires = IS_NOT_IN_DB(db, 'page.title') #http://
www.web2py.com/book/default/chapter/03
interesting answer, but trying what is suggested ti seams not possible 
to refer to a virtual field such as it's possible with real fields... I 
mean trying this little example that's the result I get


 db.define_table('mytable',
...   Field('field1','integer'),
...   Field('field2','integer'),
... )
 class MyVirtualFields(object):
...   def uniqueField(self):
... d = dict()
... for i in ['field1', 'field2']:
...   d[db.mytable[i].name] = self.mytable[i]
... return d
...
 db.mytable.virtualfields.append(MyVirtualFields())
 db.mytable.uniqueField.requires = IS_NOT_IN_DB(db, 
'mytable.uniqueField')

Traceback (most recent call last):
  File console, line 1, in module
  File /home/manuele/Progetti/web2py/gluon/sql.py, line 1688, in 
__getattr__

return dict.__getitem__(self,key)
KeyError: 'uniqueField'

what's wrong in it?

thank you very much

Manuele


Re: [web2py] Problems in web2py 1.83.2

2010-12-29 Thread Branko Vukelić
2010/12/29 Kenneth Lundström kenneth.t.lundst...@gmail.com:
 I guess not even web2py is perfect. Maybe some day.

Sure. I don't mind the bugs getting fixed. I just wanted to say that
in a perfect world, you cannot expect backwards-compatibility-forever.
:)

-- 
Branko Vukelic

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


[web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread snapy666
It doesn't break backwards compatibility, because it *should not* work
the way it did.

@massimo: I think a SyntaxError should not be used for a case like
this. See that the syntax is correct and the passed values not, a
ValueError or the like shall be used.

On 29 Dez., 11:59, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 I might be completly wrong but I think the way URL was used by Maurice
 was wrong, it should not have worked, but thanks to a bug in URL it
 worked the way Maurice wanted.

 So I guess it depends on how you look at it. Did it break backwards
 compatibility.

 If your are using a bug and somebody repairs that bug your application
 stops working.

 Kenneth

 2010/12/29 Kenneth Lundstr m kenneth.t.lundst...@gmail.com:

  If I remember correctly there was something about this on the list.

  I think you use the URL the wrong way and until version 1.83.2 the helper
  worked wrongly. In your case it worked but it has been corrected and it
  doesn t work anymore.
  Hm. Isn't that technically a case of breaking backwards compatibility?




[web2py] Re: Web2Py Foundation?

2010-12-29 Thread Stefaan Himpe

I would like to see web2py becomes matured in a similar model as
Drupal, at lease with a PR manager, a release manager, a documentation
manager, and a newbie-assistance manager, together with a platform
that attracts developers and encourages contribution. Massimo's role
should be in developing and setting visions.


More managers also means more coordination overhead for Massimo. What if 
he's really only interested in designing and writing code ? I know I 
would be :)




[web2py] Renaming fields of auth tables

2010-12-29 Thread Lisandro
Hi everyone.
I'm customizing my authentication and access control system (following
the instructions from the web2py website and some examples of this
group).

I've renamed my auth_user table with the following:
auth.settings.table_user_name = 'ciudadanos'

Then I renamed the fields first_name and last_name, defining my
custom table. But when I try to insert a record (from database
administration interface), I receive an error.

¿Is it possible to rename fields of auth_user table without having to
change web2py source code?
If it isn't possible, ¿is there a way to set an alias for a  field,
so it can be referenced by its name or by its alias?

Thanks in advance.


Re: [web2py] Renaming fields of auth tables

2010-12-29 Thread Marin Pranjic
Hi,
you can use *label* like described here:
http://www.mail-archive.com/web2py@googlegroups.com/msg28123.html

but you can still reference it only by its name ['first_name', 'last_name'].

On Wed, Dec 29, 2010 at 2:44 PM, Lisandro rostagnolisan...@gmail.comwrote:

 Hi everyone.
 I'm customizing my authentication and access control system (following
 the instructions from the web2py website and some examples of this
 group).

 I've renamed my auth_user table with the following:
 auth.settings.table_user_name = 'ciudadanos'

 Then I renamed the fields first_name and last_name, defining my
 custom table. But when I try to insert a record (from database
 administration interface), I receive an error.

 ¿Is it possible to rename fields of auth_user table without having to
 change web2py source code?
 If it isn't possible, ¿is there a way to set an alias for a  field,
 so it can be referenced by its name or by its alias?

 Thanks in advance.


[web2py] [fun] Evolution of a Python programmer

2010-12-29 Thread Bruno Rocha
http://dis.4chan.org/read/prog/1180084983/



-- 

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


[web2py] Re: [fun] Evolution of a Python programmer

2010-12-29 Thread Bruno Rocha
'Enterprise Programmer' is the best part of it. LOL

2010/12/29 Bruno Rocha rochacbr...@gmail.com




 http://dis.4chan.org/read/prog/1180084983/



 --

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




-- 

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


[web2py] Auto reload of file

2010-12-29 Thread Tomek
Hey

I have simple problem:

I work with eclips and web2py, every time when i done some change i
need to restart web2py server to see effect of my work, is there any
workaround for this. ???



[web2py] CASE statements in DAL?

2010-12-29 Thread Harkirat
Hi All !
  I am new to web2py and my company is building an enterprise
level web application that will run on the desktop and also mobile
apps using web2py! So far it has been a gr8 experience working with
web2py and kudos to all the developers that made such an awesome
framework !

I am trying to write some queries in the DAL that require a CASE
statement e.g.
SELECT CASE WHEN 1=1 THEN 0 ELSE 1 END

Is there a way to write this in the DAL?

Thanks in advance for your help!

Harkirat



[web2py] customize json output

2010-12-29 Thread bova
Hello!

I'm using web2py with jquery and jquery.flot plugin

Tell me please how can I get json output like following:
  [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
{ label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]


Re: [web2py] customize json output

2010-12-29 Thread Branko Vukelić
On Wed, Dec 29, 2010 at 3:38 PM, bova povetki...@gmail.com wrote:
 Hello!

 I'm using web2py with jquery and jquery.flot plugin

 Tell me please how can I get json output like following:
  [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
    { label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]


Try returning the exact same thing as JSON, and see if it works.


-- 
Branko Vukelic

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


[web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Arun K.Rajeevan
where is the attachment pdf? 

[web2py] Re: CASE statements in DAL?

2010-12-29 Thread Arun K.Rajeevan
I'm not aware of anything like this, but of course you can execute  SQL 
directly with web2py

[web2py] Re: Auto reload of file

2010-12-29 Thread KR
I don't use Eclipse anymore but I can just tell that on my ubuntu box
I never need to restart the server when I edit a file in the
application folder (that is Model, View or Controller) and I tought
that web2py works like that.

If you work in the framework itself, I think that stop and start is a
must.

On Dec 29, 10:27 am, Tomek dym...@gmail.com wrote:
 Hey

 I have simple problem:

 I work with eclips and web2py, every time when i done some change i
 need to restart web2py server to see effect of my work, is there any
 workaround for this. ???


Re: [web2py] Re: Powertable remarks

2010-12-29 Thread Kenneth Lundström

Hi Bruno,

waauu what a Plugin your working on, very nice.

What does the productdetails function look like?


Kenneth


Hi,

Thank you for testing, it is more updated in bitbucket. Now it has search by 
column and a test version of server side processing.

If you want to change the pager do:

plugins.powerTable.dtfeatures['sPaginationType'] = 'full_numbers'

Here is a demo:
http://powertable.blouweb.com/products?pager=full_numbers

Bruno.


Em 29/12/2010, às 02:49, tomttom_tren...@yahoo.com  escreveu:


Hi Bruno,

I've just tried using your powertables plugin and I love it. The
general appearance is great and the default search function is exactly
what I was looking for.  I'm looking forward to trying out the
features you've planned.

One small concern I have is the example I implemented allows me to
page to 'next' and 'previous' but there is not a link for 'first' or
'last' page.  It would be great if this was possible.

Keep up the good work.  - Tom


On Dec 18, 3:38 pm, Bruno Rocharochacbr...@gmail.com  wrote:

  jqGrid also supports progressive loading (without paging , it
does ajax to load while scrolling down).
I do not see those features exist in datatables.

Just got progressive loading working on powerTable plugin

powerTable.dtfeatures['bScrollInfinite'] = True
powerTable.dtfeatures['iScrollLoadGap'] = 10 #number of rows to load by time

I am still working hard to make server side load to work well.

(I am having a good time with datatables library, the community in
datatables.net forum is very helpful)

Will update the plugin soon.

--

Bruno Rochahttp://about.me/rochacbruno/bio




[web2py] Re: Not open source yet... but

2010-12-29 Thread mikech
Very Impressive!

On Dec 27, 10:55 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 http://vimeo.com/18232653


[web2py] How to change form.vars before validation?

2010-12-29 Thread Marin Pranjic
Hi,
I need to customize Auth:

1. use username instead of e-mail for login
2. remove first_name and last_name fields
3. make username case_insensitive

I decided to use first_name field to store the real username, and
username field to store lowercase username (for case-insensitive
login).

Used the following code:

def sync_user(form):
form.vars['first_name'] = form.vars['username']
form.vars['username'] = form.vars['username'].lower()

def lower_username(form):
form.vars['username'] = form.vars['username'].lower()

auth.settings.register_onvalidation.append(sync_user)
auth.settings.profile_onvalidation.append(sync_user)
auth.settings.login_onvalidation.append(lower_username)


Problem is, this should be executed BEFORE validation, not after.
Suggestions?


[web2py] Re: customize json output

2010-12-29 Thread DenesL
def jsonlist():
  import gluon.contrib.simplejson
  L = [ { 'label': Foo, 'data': [ [10, 1], [17, -14], [30, 5] ] },
{ 'label': Bar, 'data': [ [11, 13], [19, 11], [30, -7] ] } ]
  response.headers['Content-Type']='text/json'
  return gluon.contrib.simplejson.dumps(L)


On Dec 29, 9:38 am, bova povetki...@gmail.com wrote:
 Hello!

 I'm using web2py with jquery and jquery.flot plugin

 Tell me please how can I get json output like following:
   [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
     { label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]


[web2py] Re: Web2Py Foundation?

2010-12-29 Thread Anthony
Also, what about the book? Would the community have to start from scratch on 
new documentation? The online version says modified content cannot be 
reproduced.
 
Anthony

On Wednesday, December 29, 2010 2:21:20 AM UTC-5, Graham Dumpleton wrote:



 On Wednesday, December 29, 2010 5:49:17 PM UTC+11, Magnitus wrote: 

 Wow, some heavy duty concerns in this thread... 

 I'm not fully versed in the detailed legalities of those things, but 
 I'll elaborate things as I understand them and perhaps I can be 
 corrected if I'm wrong... 

 Basically, I get Web2py under the GLP licence. 

 Under that licence, I can: 

 1) Use and distribute the unmodified web framework indefinitely as 
 long as I provide a copy of the licence and the source code 

 2) Modify the source code of the Framework as I see fit as long as 
 long as I make an open source copy of my modification available with 
 an original copy of the licence and indicate how it was modified from 
 the original source 

 The above would apply to any copy I downloaded when the licence was in 
 force, even if say, Massimo was struck by a meteor and Web2py stopped 
 being distributed under such a licence. 

 So, the main worry isn't that if Massimo is eaten by raiding 
 cannibals, people won't have the legal means to distribute future 
 modified copies of Web2py, but rather that nobody may have the 
 expertize or interest to do so, correct? 


 It is an open question whether distribution of such modified copies are 
 legally allowed to still be called web2py if Massimo has sole legal rights 
 on the name. Thus, you may be able to do that, but you likely would have to 
 call it something other than web2py.

 Graham
  


 On Dec 28, 12:28 pm, mdipierro mdi...@cs.depaul.edu wrote: 
  Afoundationis a corporation and, believe it or not, in US a 
  corporation is a person: 
  
   http://www.professorbainbridge.com/professorbainbridgecom/2010/01/the... 

  
  The Djangofoundationwas created two years ago (and Django is 4-5 
  years older thanweb2py). Do you have any evidence that it has 
  improved its popularity: 
  
   http://www.google.com/trends?q=django? 
  
  Python has afoundationand it looks to me it is always broke. I just 
  spoke with a recruiter that was looking for Python programmers for a 
  big US bank and I complained that his client relied on a product 
  (Python) and did not make any donation to support it. The python 
  developers are not supported by thefoundation, as far as I know. 
  
  Afoundationhas costs higher than a corporation and I do not get 
  enough donation to cover those costs. A corporation 
  (experts4solutions) is cheaper (it still costs at least $500/year of 
  my own money). Moreover afoundationimplies that design decision are 
  taken by committee and I do not believe in that. 
  
  I consult with core developers and users on important matters but I 
  think there has to be one individual who ultimately takes decisions 
  about the direction of the project. 
  
  We have explored the possibility of joining the free software 
  conservatory but we got no feedback. 
  
  Rails is owned by a corporation (37signals) which is owned by one 
  individual. It seems to be the model works well for them. In my case I 
  decided not to pass copyright and trademark to experts4solutions 
  because I thought some would have criticized it. 
  
  I am not the only committer to the mainweb2pybranch. Jonathan L. is 
  also a committer and will use his power in case I am incapacitated. 
  Yet, that should not be a crowded space in order to avoid internal 
  conflicts. 
  
  I will write a will that explains what happens to theweb2pytrademark 
  and copyright in case I die. 
  
  Massimo 
  
  On Dec 28, 2:12 am, Graham Dumpleton graha...@gmail.com 
  wrote: 
  
  
  
   On Tuesday, December 28, 2010 5:37:30 PM UTC+11, mdipierro wrote: 
  
Not sure what a single person framework means. This framework counts 

almost 100 contributors and at least 50 people very skilled here. If 
 I 
get hit by a track any of them can take over by forking my branch as 

allowed by the license. 
  
   That last line actually supports the idea that a piece of software is 
 owned 
   and controlled by a single person. If a piece of software was owned by 
 a 
   group, be it a corporation or afoundation, the death of the core 
 developer 
   would make no difference as it would continue to be developed within 
 the 
   structure of that corporation orfoundationand copyright still held by 
 the 
   continuing entity. 
  
   In your case, if you get hit by a bus driven by a disgruntled Python 
   developer, then no one else can simply take over the software as it is 
 now, 
   using any existing legal structure etc. Instead it would as you say 
 need to 
   be forked and in being forked legally may even need to change names as 
 a 
   result if you have sole rights over the original name. 
  
   So, your own words support the contention expressed by some 

[web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread mdipierro
virtual fields are not computed fields. They do not exist in the db.
They are computed when records are retrieved. They cannot have
requirements or attributes because there no way to input their values
in a form. So this is simply imporssible:

db.mytable.uniqueField.requires = ...



On Dec 29, 5:57 am, Manuele Pesenti manuele.pese...@gmail.com wrote:
 Il 28/12/2010 23:40, Luther Goh Lu Feng ha scritto: Is there a reason why 
 you are not using Auth, if you aren't?

 http://www.web2py.com/book/default/chapter/08#Authentication

  Anyway, assuming that you truly want to add the unique constraint,
  then I am guessing that you could construct virtual fields

 http://www.web2py.com/book/default/chapter/06#Virtual-Fields

  and apply the 
  constrainthttp://www.web2py.com/book/default/docstring/IS_NOT_IN_DB

  db.page.title.requires = IS_NOT_IN_DB(db, 'page.title') #http://
 www.web2py.com/book/default/chapter/03

 interesting answer, but trying what is suggested ti seams not possible
 to refer to a virtual field such as it's possible with real fields... I
 mean trying this little example that's the result I get

   db.define_table('mytable',
 ...   Field('field1','integer'),
 ...   Field('field2','integer'),
 ... )
   class MyVirtualFields(object):
 ...   def uniqueField(self):
 ...     d = dict()
 ...     for i in ['field1', 'field2']:
 ...       d[db.mytable[i].name] = self.mytable[i]
 ...     return d
 ...
   db.mytable.virtualfields.append(MyVirtualFields())
   db.mytable.uniqueField.requires = IS_NOT_IN_DB(db,
 'mytable.uniqueField')
 Traceback (most recent call last):
    File console, line 1, in module
    File /home/manuele/Progetti/web2py/gluon/sql.py, line 1688, in
 __getattr__
      return dict.__getitem__(self,key)
 KeyError: 'uniqueField'

 what's wrong in it?

 thank you very much

      Manuele


[web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread mdipierro
I agree.

On Dec 29, 7:29 am, snapy666 joschu...@yahoo.de wrote:
 It doesn't break backwards compatibility, because it *should not* work
 the way it did.

 @massimo: I think a SyntaxError should not be used for a case like
 this. See that the syntax is correct and the passed values not, a
 ValueError or the like shall be used.

 On 29 Dez., 11:59, Kenneth Lundström kenneth.t.lundst...@gmail.com
 wrote:

  I might be completly wrong but I think the way URL was used by Maurice
  was wrong, it should not have worked, but thanks to a bug in URL it
  worked the way Maurice wanted.

  So I guess it depends on how you look at it. Did it break backwards
  compatibility.

  If your are using a bug and somebody repairs that bug your application
  stops working.

  Kenneth

  2010/12/29 Kenneth Lundstr m kenneth.t.lundst...@gmail.com:

   If I remember correctly there was something about this on the list.

   I think you use the URL the wrong way and until version 1.83.2 the helper
   worked wrongly. In your case it worked but it has been corrected and it
   doesn t work anymore.
   Hm. Isn't that technically a case of breaking backwards compatibility?




[web2py] Re: Evolution of a Python programmer

2010-12-29 Thread mdipierro
c'mon... only for integer numbers (and not even checking)? What about
float?

Anyway, he is also missing:

storage = {}
def memoize(f):
def g(x):
if x in storage:
y = strorage[x]
else:
y = storage[x] = f(x)
return y
return g

@memoize
def factorial(x): return x in (0,1) and 1 or x*factorial(x-1)



On Dec 29, 8:21 am, Bruno Rocha rochacbr...@gmail.com wrote:
 'Enterprise Programmer' is the best part of it. LOL

 2010/12/29 Bruno Rocha rochacbr...@gmail.com



 http://dis.4chan.org/read/prog/1180084983/

  --

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

 --

 Bruno Rochahttp://about.me/rochacbruno/bio


Re: [web2py] Re: Powertable remarks

2010-12-29 Thread Bruno Rocha
2010/12/29 Kenneth Lundström kenneth.t.lundst...@gmail.com

 Hi Bruno,

 waauu what a Plugin your working on, very nice.

 What does the productdetails function look like?


In the main table every row has two attributes

ID = it is the record id from rows object, if there is not an id field it
will be the first row value.
Key = tablename.fieldname to query against

In that example the category table is passing i.e: key=products.category.1
cols=[a list of columns to fetch in detail]

the productdetails functions just splits the key and creates a new SQLTABLE

example
def productdetails():
tablename,fieldname,value = key.split('.')
return
SQLTABLE(powertable_db(powertable_db.tablename.fieldname==value).select(**cols))
/example

Following this model it is possible to do whatever you need, bulld any html
object to return in detail table, by default, wthout writing any code i can
return a update/insert FORM, a TABLE, a UL list.

Now I am trying to include tabs within details to return multiple objects.

-- 

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


[web2py] Re: CASE statements in DAL?

2010-12-29 Thread mdipierro
You should be able to doL

from gluon.dal import Expression

db(query).select(Expression(CASE WHEN 1=1 THEN 0 ELSE 1 END));

Nut I never tried.

On Dec 29, 8:37 am, Harkirat harkira...@gmail.com wrote:
 Hi All !
           I am new to web2py and my company is building an enterprise
 level web application that will run on the desktop and also mobile
 apps using web2py! So far it has been a gr8 experience working with
 web2py and kudos to all the developers that made such an awesome
 framework !

 I am trying to write some queries in the DAL that require a CASE
 statement e.g.
 SELECT CASE WHEN 1=1 THEN 0 ELSE 1 END

 Is there a way to write this in the DAL?

 Thanks in advance for your help!

 Harkirat


[web2py] messages for community app - some examples?

2010-12-29 Thread pk
hi,

i will create an app for a community. and i need now the messages
function (inbox, sent...)
have somebody experience with this? can somebody help me?

thanks
peter


[web2py] Re: Web2Py Foundation?

2010-12-29 Thread mdipierro
Right. I will make sure in my will web2py trademark is released on my
death.

On Dec 29, 2:41 am, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 On Wednesday, December 29, 2010 6:48:51 PM UTC+11, stu...@brankovukelic.com
 wrote:

   It is an open question whether distribution of such modified copies are
   legally allowed to still be called web2py if Massimo has sole legal
  rights
   on the name. Thus, you may be able to do that, but you likely would have
  to
   call it something other than web2py.

  Well, uneless dead people can sue you in court, it's probably as legal
  as written permission

 Sorry,  his heir could most likely sue you.

 Graham

  --

  Branko Vukelic

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




[web2py] Re: Web2Py Foundation?

2010-12-29 Thread mdipierro
I will amend my will to release the book under an open source license.

You guys really think my heirs even know what I do in front of the
computer all day?

Massimo

On Dec 29, 10:26 am, Anthony abasta...@gmail.com wrote:
 Also, what about the book? Would the community have to start from scratch on
 new documentation? The online version says modified content cannot be
 reproduced.

 Anthony

 On Wednesday, December 29, 2010 2:21:20 AM UTC-5, Graham Dumpleton wrote:

  On Wednesday, December 29, 2010 5:49:17 PM UTC+11, Magnitus wrote:

  Wow, some heavy duty concerns in this thread...

  I'm not fully versed in the detailed legalities of those things, but
  I'll elaborate things as I understand them and perhaps I can be
  corrected if I'm wrong...

  Basically, I get Web2py under the GLP licence.

  Under that licence, I can:

  1) Use and distribute the unmodified web framework indefinitely as
  long as I provide a copy of the licence and the source code

  2) Modify the source code of the Framework as I see fit as long as
  long as I make an open source copy of my modification available with
  an original copy of the licence and indicate how it was modified from
  the original source

  The above would apply to any copy I downloaded when the licence was in
  force, even if say, Massimo was struck by a meteor and Web2py stopped
  being distributed under such a licence.

  So, the main worry isn't that if Massimo is eaten by raiding
  cannibals, people won't have the legal means to distribute future
  modified copies of Web2py, but rather that nobody may have the
  expertize or interest to do so, correct?

  It is an open question whether distribution of such modified copies are
  legally allowed to still be called web2py if Massimo has sole legal rights
  on the name. Thus, you may be able to do that, but you likely would have to
  call it something other than web2py.

  Graham

  On Dec 28, 12:28 pm, mdipierro mdi...@cs.depaul.edu wrote:
   Afoundationis a corporation and, believe it or not, in US a
   corporation is a person:

    http://www.professorbainbridge.com/professorbainbridgecom/2010/01/the...

   The Djangofoundationwas created two years ago (and Django is 4-5
   years older thanweb2py). Do you have any evidence that it has
   improved its popularity:

    http://www.google.com/trends?q=django?

   Python has afoundationand it looks to me it is always broke. I just
   spoke with a recruiter that was looking for Python programmers for a
   big US bank and I complained that his client relied on a product
   (Python) and did not make any donation to support it. The python
   developers are not supported by thefoundation, as far as I know.

   Afoundationhas costs higher than a corporation and I do not get
   enough donation to cover those costs. A corporation
   (experts4solutions) is cheaper (it still costs at least $500/year of
   my own money). Moreover afoundationimplies that design decision are
   taken by committee and I do not believe in that.

   I consult with core developers and users on important matters but I
   think there has to be one individual who ultimately takes decisions
   about the direction of the project.

   We have explored the possibility of joining the free software
   conservatory but we got no feedback.

   Rails is owned by a corporation (37signals) which is owned by one
   individual. It seems to be the model works well for them. In my case I
   decided not to pass copyright and trademark to experts4solutions
   because I thought some would have criticized it.

   I am not the only committer to the mainweb2pybranch. Jonathan L. is
   also a committer and will use his power in case I am incapacitated.
   Yet, that should not be a crowded space in order to avoid internal
   conflicts.

   I will write a will that explains what happens to theweb2pytrademark
   and copyright in case I die.

   Massimo

   On Dec 28, 2:12 am, Graham Dumpleton graha...@gmail.com
   wrote:

On Tuesday, December 28, 2010 5:37:30 PM UTC+11, mdipierro wrote:

 Not sure what a single person framework means. This framework counts

 almost 100 contributors and at least 50 people very skilled here. If
  I
 get hit by a track any of them can take over by forking my branch as

 allowed by the license.

That last line actually supports the idea that a piece of software is
  owned
and controlled by a single person. If a piece of software was owned by
  a
group, be it a corporation or afoundation, the death of the core
  developer
would make no difference as it would continue to be developed within
  the
structure of that corporation orfoundationand copyright still held by
  the
continuing entity.

In your case, if you get hit by a bus driven by a disgruntled Python
developer, then no one else can simply take over the software as it is
  now,
using any existing legal structure etc. Instead it would as you say
  need to
be forked and in 

[web2py] Re: customize json output

2010-12-29 Thread mdipierro
I found that for list and dict

repr(L)

works as good as

gluon.contrib.simplejson.dumps(L)

and it is much faster. What am I missing?

On Dec 29, 10:26 am, DenesL denes1...@yahoo.ca wrote:
 def jsonlist():
   import gluon.contrib.simplejson
   L = [ { 'label': Foo, 'data': [ [10, 1], [17, -14], [30, 5] ] },
     { 'label': Bar, 'data': [ [11, 13], [19, 11], [30, -7] ] } ]
   response.headers['Content-Type']='text/json'
   return gluon.contrib.simplejson.dumps(L)

 On Dec 29, 9:38 am, bova povetki...@gmail.com wrote:

  Hello!

  I'm using web2py with jquery and jquery.flot plugin

  Tell me please how can I get json output like following:
    [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
      { label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]




[web2py] Interesting thoughts on URL design

2010-12-29 Thread ma...@rockiger.com
Here are some thoughts on URL design you might be interested in:

http://warpspire.com/posts/url-design/

Marco


Re: [web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread Bruno Rocha
Maybe not the best way, but just for testing, I tried this:

model
db.define_table('person',
Field('unikey','id',compute=lambda r: r.fname+r.lname),
Field('fname'),
field('lname')
)
/model
got an error because the 'id' needs to be int

error
File /home/rochacbruno/projects/web2py/gluon/dal.py, line 805, in expand
return self.represent(expression,field_type)
File /home/rochacbruno/projects/web2py/gluon/dal.py, line 1096, in
represent
return str(int(obj))
ValueError: invalid literal for int() with base 10:
/error

Then I tried with integers and works ok.

person.unikey = 12
person.fname = 1
person.lname = 2

Is there a way to have string fields as primary keys?


Re: [web2py] Auto reload of file

2010-12-29 Thread Bruno Rocha
Are you using @cache() in functions? is your app compiled?



2010/12/29 Tomek dym...@gmail.com

 Hey

 I have simple problem:

 I work with eclips and web2py, every time when i done some change i
 need to restart web2py server to see effect of my work, is there any
 workaround for this. ???




-- 

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


[web2py] Python job oportunity

2010-12-29 Thread António Ramos
Beats me

https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#


Re: [web2py] Re: customize json output

2010-12-29 Thread Branko Vukelić
I think the dictionaries should work the same, though. Never tried,
but they are the same string form as JSON objects.

On Wed, Dec 29, 2010 at 6:05 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I found that for list and dict

 repr(L)

 works as good as

 gluon.contrib.simplejson.dumps(L)

 and it is much faster. What am I missing?

 On Dec 29, 10:26 am, DenesL denes1...@yahoo.ca wrote:
 def jsonlist():
   import gluon.contrib.simplejson
   L = [ { 'label': Foo, 'data': [ [10, 1], [17, -14], [30, 5] ] },
     { 'label': Bar, 'data': [ [11, 13], [19, 11], [30, -7] ] } ]
   response.headers['Content-Type']='text/json'
   return gluon.contrib.simplejson.dumps(L)

 On Dec 29, 9:38 am, bova povetki...@gmail.com wrote:

  Hello!

  I'm using web2py with jquery and jquery.flot plugin

  Tell me please how can I get json output like following:
    [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
      { label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]






-- 
Branko Vukelic

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


Re: [web2py] Python job oportunity

2010-12-29 Thread Bruno Rocha
NIce!

But it is internship, django related and so far away from me or my Pythonic
friends.

So easy to decrypt the message.

Em 29 de dezembro de 2010 15:25, António Ramos ramstei...@gmail.comescreveu:

 Beats me


 https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#




-- 

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


Re: [web2py] Re: Web2Py Foundation?

2010-12-29 Thread Branko Vukelić
On Wed, Dec 29, 2010 at 6:04 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 I will amend my will to release the book under an open source license.

 You guys really think my heirs even know what I do in front of the
 computer all day?

I dunno, but could you ask them if they'd sue people who would dare
continue the web2py legacy if you ever die (that is, if you're not
immortal or anything like that). ;)

-- 
Branko Vukelic

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


[web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread villas
Hi Bruno,

Work was done (I believe by Denes) to introduce non-standard primary
keys. However, that was really for legacy DBs that could not be
migrated to the web2py conventions. In any case, it was only available
for certain DBs and I'm not sure the work has been migrated and tested
properly in the new DAL.

In the case of a new app,  you should always try to have standard
integer primary keys (excepting uids in the case of  combining tables/
databases).

I would suggest you try compute to produce a combined 'string' field
and then use IS_NOT_IN_DB. You might prefer to use all lower or upper
case to make it case-insensitive.

Alternatively you can create a unique index at the DB level.  You
would have to use some raw SQL which would vary according to the DB
you use.  That would stop duplicates effectively enough, but I guess
your web2py app would not handle it as smoothly.

-D

On Dec 29, 5:12 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 Maybe not the best way, but just for testing, I tried this:

 model
 db.define_table('person',
                 Field('unikey','id',compute=lambda r: r.fname+r.lname),
                 Field('fname'),
                 field('lname')
                 )
 /model
 got an error because the 'id' needs to be int

 error
 File /home/rochacbruno/projects/web2py/gluon/dal.py, line 805, in expand
 return self.represent(expression,field_type)
 File /home/rochacbruno/projects/web2py/gluon/dal.py, line 1096, in
 represent
 return str(int(obj))
 ValueError: invalid literal for int() with base 10:
 /error

 Then I tried with integers and works ok.

 person.unikey = 12
 person.fname = 1
 person.lname = 2

 Is there a way to have string fields as primary keys?


Re: [web2py] RunimeError: No table selected

2010-12-29 Thread Bruno Rocha
Just to update this thread, I guess this is fixed in trunk:
http://code.google.com/p/web2py/source/detail?r=729dfb5d92789c2accad605b543be7775def6cdc

2010/12/28 Emceha marcin.chojnow...@gmail.com

 Hi I have such controller in default.py

 def index():
dzialy = db().select(db.dzialy.ALL,orderby=db.dzialy.kolejnosc)
dzialy_reversed = dzialy.sort(lambda dzial:
 dzial.kolejnosc,reverse=True)
return dict(dzialy=dzialy,dzialy_reversed=dzialy_reversed)

 I use this with google app engine SDK (for GAE deployment) so started
 it up with dev_appserver.py

 It works just fine with
 Version 1.89.5 (2010-11-21 22:12:54)

 but Version 1.91.4 (2010-12-22 17:31:23)
 fails with this error listed below

 Traceback (most recent call last):
  File /media/AA1/GAE/web2py/gluon/restricted.py, line 188, in
 restricted
exec ccode in environment
  File /media/AA1/GAE/web2py/applications/init/controllers/
 default.py:index, line 69, in module
  File /media/AA1/GAE/web2py/gluon/globals.py, line 95, in lambda
self._caller = lambda f: f()
  File /media/AA1/GAE/web2py/applications/init/controllers/
 default.py:index, line 7, in index
  File /media/AA1/GAE/web2py/gluon/dal.py, line 4388, in select
return self.db._adapter.select(self.query,fields,attributes)
  File /media/AA1/GAE/web2py/gluon/dal.py, line 2654, in select
(items, tablename, fields) =
 self.select_raw(query,fields,attributes)
  File /media/AA1/GAE/web2py/gluon/dal.py, line 2611, in select_raw
tablename = self.get_table(query)
  File /media/AA1/GAE/web2py/gluon/dal.py, line 894, in get_table
raise RuntimeError, No table selected
 RunimeError: No table selected

 Is that because my code is wrong or we lost some compatibility?




-- 

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


[web2py] Re: Web2Py Foundation?

2010-12-29 Thread mikech
Perhaps try the Software Conservance again?  I see that they recently
accepted PyPy and Git

On Dec 28, 9:28 am, mdipierro mdipie...@cs.depaul.edu wrote:
 A foundation is a corporation and, believe it or not, in US a
 corporation is a person:

  http://www.professorbainbridge.com/professorbainbridgecom/2010/01/the...

 The Django foundation was created two years ago (and Django is 4-5
 years older than web2py). Do you have any evidence that it has
 improved its popularity:

  http://www.google.com/trends?q=django?

 Python has a foundation and it looks to me it is always broke. I just
 spoke with a recruiter that was looking for Python programmers for a
 big US bank and I complained that his client relied on a product
 (Python) and did not make any donation to support it. The python
 developers are not supported by the foundation, as far as I know.

 A foundation has costs higher than a corporation and I do not get
 enough donation to cover those costs. A corporation
 (experts4solutions) is cheaper (it still costs at least $500/year of
 my own money). Moreover a foundation implies that design decision are
 taken by committee and I do not believe in that.

 I consult with core developers and users on important matters but I
 think there has to be one individual who ultimately takes decisions
 about the direction of the project.

 We have explored the possibility of joining the free software
 conservatory but we got no feedback.

 Rails is owned by a corporation (37signals) which is owned by one
 individual. It seems to be the model works well for them. In my case I
 decided not to pass copyright and trademark to experts4solutions
 because I thought some would have criticized it.

 I am not the only committer to the main web2py branch. Jonathan L. is
 also a committer and will use his power in case I am incapacitated.
 Yet, that should not be a crowded space in order to avoid internal
 conflicts.

 I will write a will that explains what happens to the web2py trademark
 and copyright in case I die.

 Massimo

 On Dec 28, 2:12 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:



  On Tuesday, December 28, 2010 5:37:30 PM UTC+11, mdipierro wrote:

   Not sure what a single person framework means. This framework counts
   almost 100 contributors and at least 50 people very skilled here. If I
   get hit by a track any of them can take over by forking my branch as
   allowed by the license.

  That last line actually supports the idea that a piece of software is owned
  and controlled by a single person. If a piece of software was owned by a
  group, be it a corporation or a foundation, the death of the core developer
  would make no difference as it would continue to be developed within the
  structure of that corporation or foundation and copyright still held by the
  continuing entity.

  In your case, if you get hit by a bus driven by a disgruntled Python
  developer, then no one else can simply take over the software as it is now,
  using any existing legal structure etc. Instead it would as you say need to
  be forked and in being forked legally may even need to change names as a
  result if you have sole rights over the original name.

  So, your own words support the contention expressed by some that it is
  'single person framework' as far as ownership and control is concerned, an
  issue which is distinct from whether or not you have other contributors.

  Graham

   The purpose of the foundation is to collect money for development and
   advertising. Other organization like Rails have chose to create a
   company instead of a foundation.

   We have created a company (experts4solutions.com) whose purpose is to
   promote skilled web2py professionals (and you can joins), foster
   web2py projects, sell consulting and long term support contracts.

   This was advertised here a few months ago. Some users have joined.

   Massimo

   On Dec 27, 9:46 pm, Pepe Araya pepe...@gmail.com wrote:
Hi,

some news about this topic?

I think 2 things are going in favor of creating a foundation or
   [whatever]:
1. the community has grown a lot.
2. in all the reviews I read about web2py, always, always, ALWAYS!!! say
   it
is a single-person framework and that takes away the future security of
their development.

kind regards

Pepe


Re: [web2py] Re: Web2Py Foundation?

2010-12-29 Thread Bruno Rocha
This thread can be historical like that one:
http://www.python.org/search/hypermail/python-1994q2/1040.html which was the
start of PSF


[web2py] Re: customize json output

2010-12-29 Thread mdipierro
it works great for me.

On Dec 29, 11:41 am, Branko Vukelić stu...@brankovukelic.com wrote:
 I think the dictionaries should work the same, though. Never tried,
 but they are the same string form as JSON objects.



 On Wed, Dec 29, 2010 at 6:05 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  I found that for list and dict

  repr(L)

  works as good as

  gluon.contrib.simplejson.dumps(L)

  and it is much faster. What am I missing?

  On Dec 29, 10:26 am, DenesL denes1...@yahoo.ca wrote:
  def jsonlist():
    import gluon.contrib.simplejson
    L = [ { 'label': Foo, 'data': [ [10, 1], [17, -14], [30, 5] ] },
      { 'label': Bar, 'data': [ [11, 13], [19, 11], [30, -7] ] } ]
    response.headers['Content-Type']='text/json'
    return gluon.contrib.simplejson.dumps(L)

  On Dec 29, 9:38 am, bova povetki...@gmail.com wrote:

   Hello!

   I'm using web2py with jquery and jquery.flot plugin

   Tell me please how can I get json output like following:
     [ { label: Foo, data: [ [10, 1], [17, -14], [30, 5] ] },
       { label: Bar, data: [ [11, 13], [19, 11], [30, -7] ] } ]

 --
 Branko Vukelic

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


Re: [web2py] Python job oportunity

2010-12-29 Thread António Ramos
i just xored every char in the password with the char in the array but got
another array full of garbage.

can you point any direction toward the sunshine?

Thanks

2010/12/29 Bruno Rocha rochacbr...@gmail.com

 NIce!

 But it is internship, django related and so far away from me or my Pythonic
 friends.

 So easy to decrypt the message.

 Em 29 de dezembro de 2010 15:25, António Ramos ramstei...@gmail.comescreveu:

 Beats me


 https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#




 --

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



Re: [web2py] Python job oportunity

2010-12-29 Thread Bruno Rocha
 def xor(data,key):
... return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data,
cycle(key)))
...
 k = 'i2Mobile'
 job_opportunity =
' ' ' \\9\n\x10\x07\x1f\r\x00Bm\x0e\x16I\x05W$]/\x06\x0e\...@e\x00\\m
\x07\x00\x1e\x04\x1a\x1cm8\x07I\x1b\x04\x07Fm\x0c\x10\x0c\r\x11\x00D(O\x1b\x06\x19\x0b\x0e\x12)\n\x14\x0c\x00\n\x19W?\x1cB\x0f\x03\x17I]8\x1dB\x1f\t\x17\x10\x12\x02\x03\x05\x00E\x1dW,\x02LI;\x00IG\nB9\x15\x11\x01]#CB-\x06\x04\x07Ucb$\x15\x16\x18^a...@e
:c\x01o1\x0c\x1e\x13\...@ao([! E\x12$ 1el$\x07v?\x00\x0...@e
!f\x00#NI\x04\x1fS\x0c\x10\x00\x1c\x11E\x12\'\x1e\x17\x0c\x1e\x1cg\x12\x14\n\x03\...@e
\x1dZ,\x1b\x11I\x1e\x0c\x0eZ9CB\x1e\tE\x1bW,\x03\x0e\x10L\x10\x1aWm\x0e\x0e\x05L\n\x0f\x129\x07\x03\x1dB\x0c[\x12$\x1cB\x08L\x02\x1bW,\x1bb\x19\x00\x04\nwm\x1b\ri\x00\x00\...@#ab\x02\x00I_\x1d\x07I\x18\r\x00\\*UB\x10\x03\x10\x1b\x12(\x01\x05\x05\x05\x16\x01\x12
\x1a\x11\x1dL\x07\x0c\x12=\n\x10\x0f\t\x06\x1d\x1em\x1c\x12\x06\x07\x00\x07\x12,\x01\x06I\x1b\x17\x00F9\n\x0cGL,\x0f\x124\x00\x17I\x08\nI\\\x1bB\x01\r\x13\x0c\x12,O\x16\x1e\x05\x11\x1dW?O\r\x1bL\x03\x08Q(\r\r\x06\x07E\x08Q.\x00\x17\x07\x18IIV\x01\x16I\x0e\n\x1dZ(\x1dB\x1d\x03E\x08\\\x18\x07\x1bBE
Tm\x16\r\x1cL\x12\x08\\9O\x16\x06L\x04\x19B!\x16NI\x0f\x04\x05^m?\x07\r\x1e\nIq,\x1d\x14\x08\x00\r\x06\x12t^PXYPZ\x00~AB\tE\r]#\x1bB\x07\t\x00\r\x12\x0e9\x11I\r\x0b\r\x12,\x03\x0eI\x03\x03IF%\x0e\x16EL\x07\x1cFm\r\x07I\x1c\x17\x0cB,\x1d\x07\rl\x03\...@m\x0eb\x1d\x03\x10\x0ezm\x06\x0c\x1d\t\x17\x1f[(\x18L'
' '
 xor(job_opportunity,k)

GET THE RESULT HERE!

-- 

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

Em 29 de dezembro de 2010 16:13, António Ramos ramstei...@gmail.comescreveu:

 i just xored every char in the password with the char in the array but got
 another array full of garbage.

 can you point any direction toward the sunshine?

 Thanks

 2010/12/29 Bruno Rocha rochacbr...@gmail.com

 NIce!

 But it is internship, django related and so far away from me or my
 Pythonic friends.

 So easy to decrypt the message.

 Em 29 de dezembro de 2010 15:25, António Ramos 
 ramstei...@gmail.comescreveu:

 Beats me


 https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#




 --

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





-- 

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


Re: [web2py] Python job oportunity

2010-12-29 Thread Bruno Rocha
Ops, I forgot to mention:

from itertools import izip,cycle

2010/12/29 Bruno Rocha rochacbr...@gmail.com

  def xor(data,key):
 ... return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data,
 cycle(key)))
 ...
  k = 'i2Mobile'
  job_opportunity =
 ' ' ' \\9\n\x10\x07\x1f\r\x00Bm\x0e\x16I\x05W$]/\x06\x0e\...@e\x00\\m
 \x07\x00\x1e\x04\x1a\x1cm8\x07I\x1b\x04\x07Fm\x0c\x10\x0c\r\x11\x00D(O\x1b\x06\x19\x0b\x0e\x12)\n\x14\x0c\x00\n\x19W?\x1cB\x0f\x03\x17I]8\x1dB\x1f\t\x17\x10\x12\x02\x03\x05\x00E\x1dW,\x02LI;\x00IG\nB9\x15\x11\x01]#CB-\x06\x04\x07Ucb$\x15\x16\x18^a...@e
 :c\x01o1\x0c\x1e\x13\...@ao([! E\x12$ 1el$\x07v?\x00\x0...@e
 !f\x00#NI\x04\x1fS\x0c\x10\x00\x1c\x11E\x12\'\x1e\x17\x0c\x1e\x1cg\x12\x14\n\x03\...@e
 \x1dZ,\x1b\x11I\x1e\x0c\x0eZ9CB\x1e\tE\x1bW,\x03\x0e\x10L\x10\x1aWm\x0e\x0e\x05L\n\x0f\x129\x07\x03\x1dB\x0c[\x12$\x1cB\x08L\x02\x1bW,\x1bb\x19\x00\x04\nwm\x1b\ri\x00\x00\...@#ab\x02\x00I_\x1d\x07I\x18\r\x00\\*UB\x10\x03\x10\x1b\x12(\x01\x05\x05\x05\x16\x01\x12
 \x1a\x11\x1dL\x07\x0c\x12=\n\x10\x0f\t\x06\x1d\x1em\x1c\x12\x06\x07\x00\x07\x12,\x01\x06I\x1b\x17\x00F9\n\x0cGL,\x0f\x124\x00\x17I\x08\nI\\\x1bB\x01\r\x13\x0c\x12,O\x16\x1e\x05\x11\x1dW?O\r\x1bL\x03\x08Q(\r\r\x06\x07E\x08Q.\x00\x17\x07\x18IIV\x01\x16I\x0e\n\x1dZ(\x1dB\x1d\x03E\x08\\\x18\x07\x1bBE
 Tm\x16\r\x1cL\x12\x08\\9O\x16\x06L\x04\x19B!\x16NI\x0f\x04\x05^m?\x07\r\x1e\nIq,\x1d\x14\x08\x00\r\x06\x12t^PXYPZ\x00~AB\tE\r]#\x1bB\x07\t\x00\r\x12\x0e9\x11I\r\x0b\r\x12,\x03\x0eI\x03\x03IF%\x0e\x16EL\x07\x1cFm\r\x07I\x1c\x17\x0cB,\x1d\x07\rl\x03\...@m\x0eb\x1d\x03\x10\x0ezm\x06\x0c\x1d\t\x17\x1f[(\x18L'
 ' '
  xor(job_opportunity,k)

 GET THE RESULT HERE!

 --


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

 Em 29 de dezembro de 2010 16:13, António Ramos ramstei...@gmail.comescreveu:

 i just xored every char in the password with the char in the array but got
 another array full of garbage.

 can you point any direction toward the sunshine?

 Thanks

 2010/12/29 Bruno Rocha rochacbr...@gmail.com

 NIce!

 But it is internship, django related and so far away from me or my
 Pythonic friends.

 So easy to decrypt the message.

 Em 29 de dezembro de 2010 15:25, António Ramos 
 ramstei...@gmail.comescreveu:

 Beats me


 https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#




 --

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





 --

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




-- 

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


Re: [web2py] Python job oportunity

2010-12-29 Thread António Ramos
the output is the same as i have with my code

 xor(job_opportunity,k)
'5\x0bG\x7fevae+_Cy+l;A4\x1dKan))e5_mhbwh\x7fu_uh+rhb/_A\x7fnd}e-\x1a\x02tdpgk{\x1bG{nif|\rQ-mj{,4\nP-}`{u{\x0cOlgi)x\x1eO#+Rl,.\x0cG-[|}d4\x11\x0e-Oohb\x10\x0e-F|z}7S\x02N())_\n3\x02^nw\x7fi)S\x02G9HL
{\x16m^\'%Hb?\rMdo))D\x0f2n!+Ohz:\x0cA\x7fbu}
{\x15Sxnwp{Glc))x3\x1eV~+w`k3\x0b\x0e-|`)~\x1eNar%|\x7f_Cag%fj{\x0bJl\x7f+`{\x16Q-j%n~\x1eV-{iho_Vb+ilm)\x11\x0c-Dkl,6\x10Ph+qae5\x18\x18-rj|~{\x1aLjglzd{\x12W~\x7f%ki{\x0fG\x7fm`jxw_Q}dnlb{\x1eLi+r{e/\x0bg...@j
{\x06Mx+af,5\x10V-cd\x7fi{\x1e\x02y|l}x\r\x02by%om8\...@bdn
)m8\x1cMxeq%,?\x10Ly+gfx3\x1aP-\x7fj)m5\x0cUhy+)E=_[b~%~m5\x0b\x02yd%h|+\x13[!+fh`7_rhowf,\x18\x1eP{jiac{F\x13?:0?iL\x0c-\\`)h4\x11V-e`lh{t~+dgh{\x1eNa+jo,/\x17Cy\'%ky/_...@h+u{i+\x1epho%oc)_C-\x7fj|k3_Kc\x7f`{z2\x1aU#'


Garbage

2010/12/29 Bruno Rocha rochacbr...@gmail.com

 Ops, I forgot to mention:

 from itertools import izip,cycle


 2010/12/29 Bruno Rocha rochacbr...@gmail.com

  def xor(data,key):
 ... return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data,
 cycle(key)))
 ...
  k = 'i2Mobile'
  job_opportunity =
 ' ' ' \\9\n\x10\x07\x1f\r\x00Bm\x0e\x16I\x05W$]/\x06\x0e\...@e\x00\\m
 \x07\x00\x1e\x04\x1a\x1cm8\x07I\x1b\x04\x07Fm\x0c\x10\x0c\r\x11\x00D(O\x1b\x06\x19\x0b\x0e\x12)\n\x14\x0c\x00\n\x19W?\x1cB\x0f\x03\x17I]8\x1dB\x1f\t\x17\x10\x12\x02\x03\x05\x00E\x1dW,\x02LI;\x00IG\nB9\x15\x11\x01]#CB-\x06\x04\x07Ucb$\x15\x16\x18^a...@e
 :c\x01o1\x0c\x1e\x13\...@ao([! E\x12$ 1el$\x07v?\x00\x0...@e
 !f\x00#NI\x04\x1fS\x0c\x10\x00\x1c\x11E\x12\'\x1e\x17\x0c\x1e\x1cg\x12\x14\n\x03\...@e
 \x1dZ,\x1b\x11I\x1e\x0c\x0eZ9CB\x1e\tE\x1bW,\x03\x0e\x10L\x10\x1aWm\x0e\x0e\x05L\n\x0f\x129\x07\x03\x1dB\x0c[\x12$\x1cB\x08L\x02\x1bW,\x1bb\x19\x00\x04\nwm\x1b\ri\x00\x00\...@#ab\x02\x00I_\x1d\x07I\x18\r\x00\\*UB\x10\x03\x10\x1b\x12(\x01\x05\x05\x05\x16\x01\x12
 \x1a\x11\x1dL\x07\x0c\x12=\n\x10\x0f\t\x06\x1d\x1em\x1c\x12\x06\x07\x00\x07\x12,\x01\x06I\x1b\x17\x00F9\n\x0cGL,\x0f\x124\x00\x17I\x08\nI\\\x1bB\x01\r\x13\x0c\x12,O\x16\x1e\x05\x11\x1dW?O\r\x1bL\x03\x08Q(\r\r\x06\x07E\x08Q.\x00\x17\x07\x18IIV\x01\x16I\x0e\n\x1dZ(\x1dB\x1d\x03E\x08\\\x18\x07\x1bBE
 Tm\x16\r\x1cL\x12\x08\\9O\x16\x06L\x04\x19B!\x16NI\x0f\x04\x05^m?\x07\r\x1e\nIq,\x1d\x14\x08\x00\r\x06\x12t^PXYPZ\x00~AB\tE\r]#\x1bB\x07\t\x00\r\x12\x0e9\x11I\r\x0b\r\x12,\x03\x0eI\x03\x03IF%\x0e\x16EL\x07\x1cFm\r\x07I\x1c\x17\x0cB,\x1d\x07\rl\x03\...@m\x0eb\x1d\x03\x10\x0ezm\x06\x0c\x1d\t\x17\x1f[(\x18L'
 ' '
  xor(job_opportunity,k)

 GET THE RESULT HERE!

 --


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

 Em 29 de dezembro de 2010 16:13, António Ramos 
 ramstei...@gmail.comescreveu:

 i just xored every char in the password with the char in the array but got
 another array full of garbage.

 can you point any direction toward the sunshine?

 Thanks

 2010/12/29 Bruno Rocha rochacbr...@gmail.com

 NIce!

 But it is internship, django related and so far away from me or my
 Pythonic friends.

 So easy to decrypt the message.

 Em 29 de dezembro de 2010 15:25, António Ramos 
 ramstei...@gmail.comescreveu:

 Beats me


 https://docs.google.com/document/d/1LzT4fCd135lzgWiXGut6k4WoC9t7eV-6RSnUexNxezM/edit?hl=en_GB#




 --

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





 --

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




 --

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



Re: [web2py] Python job oportunity

2010-12-29 Thread Bruno Rocha
Em 29 de dezembro de 2010 16:27, António Ramos ramstei...@gmail.comescreveu:

 the output is the same as i have with my code




Strange.

for me it worked very well.

 xor(job_opportunity,k)
'Internship at i2Mobile, in Oeiras. We want creative young developers for
our very small team. We use Python, Django, Mysql, C#, SQL Server, J2ME,
iOS, Android, HTML, Javascript, jquery. Yeah, thats right, we really use all
of that.i2 is a great place to learn. One more thing: your english must be
perfect, spoken and written. If you do not have a twitter or facebook
account, dont bother to answer. If you want to apply, call Pedro Carvalho
912155323. We dont need CVs and all of that, but be prepared for a tough
interview.'



-- 

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


[web2py] Re: CASE statements in DAL?

2010-12-29 Thread mikech
Cool

On Dec 29, 8:56 am, mdipierro mdipie...@cs.depaul.edu wrote:
 You should be able to doL

 from gluon.dal import Expression

 db(query).select(Expression(CASE WHEN 1=1 THEN 0 ELSE 1 END));

 Nut I never tried.

 On Dec 29, 8:37 am, Harkirat harkira...@gmail.com wrote:



  Hi All !
            I am new to web2py and my company is building an enterprise
  level web application that will run on the desktop and also mobile
  apps using web2py! So far it has been a gr8 experience working with
  web2py and kudos to all the developers that made such an awesome
  framework !

  I am trying to write some queries in the DAL that require a CASE
  statement e.g.
  SELECT CASE WHEN 1=1 THEN 0 ELSE 1 END

  Is there a way to write this in the DAL?

  Thanks in advance for your help!

  Harkirat


[web2py] FORM Generation Code.

2010-12-29 Thread David J.

Where is the code that Generates the FORMs?

What is the best way to modify this; Currently when it outputs the key name

It puts a colon; ex. First Name: instaead of just First Name

I simply want to remove that from the form.

Also on the links of the welcome app; That generate the [ login | 
register | lost pasword? ] links


I want to remove all those extra chars.

I checked the templates I dont see it in there;  I also see something in 
gluon.tools.py but I dont want to modify gluon code.


Thanks.





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

2010-12-29 Thread appydev
I totally agree with Jonathan Lundell,

I think the changes he proposes, would provide stability web2py, and I'm
sure will appeal to users (both new and existing).

My humble opinion is that the way they attack the bugs, is one of the
weaknesses ofweb2py, I think it is
messy and I'm sure many have decided not to use web2py for it.



2010/12/22 Jonathan Lundell jlund...@pobox.com

 On Dec 22, 2010, at 7:47 AM, Branko Vukelić wrote:
 
  2010/12/22 Luis Díaz diazluis2...@gmail.com:
 
  in particular whenever new versions come out ... I always say ... have
  to wait 1 week or 2 to becomestable ...
 
  Not become stable, but be proven stable. You release, wait for
  everyone to give it a go. If everyone is happy, then it's considered
  stable, and move to stable box on the downloads page. If someone
  complains, it stays in unstable indefinitely, and a new release is
  made fixing the bugs.

 The problem is that become stable is in conflict with add new features,
 and the new release that fixes the bugs also gets new (and buggy) features.

 Linux has a similar problem, that gets addressed a couple of ways. One is
 that we have Linux distributions independent of (and lagging) the core
 kernel releases: Red Hat, Ubuntu, etc. The other, somewhat more recent, is
 that certain kernel releases are maintained by the core kernel developers as
 stable points.

 The web2py equivalent would be something like this. Massimo releases
 1.91.1, and we (for some we) decide that that's a good feature/stability
 set for a stable release point. We then create a stable branch, and somebody
 (for some somebody--this is the catch) back-ports bug fixes to the stable
 branch, so we have 1.91.1.1, 1.91.1.2, etc, with *only* confirmed bug fixes,
 no new features, being back-ported. Meanwhile, trunk development proceeds
 with 1.91, 1.93, etc.

 Problem is, maintaining stable branches requires real work, and in this
 environment it means volunteer work.


Re: [web2py] FORM Generation Code.

2010-12-29 Thread Bruno Rocha
you can set labels to auth_user table

db.auth_user.first_name.label = 'F Name'
db.auth_user.last_name.label = 'WHATEVER'

If you mean extra link in login/register form, simply edit
/views/default/user.html



2010/12/29 David J. da...@styleflare.com

 Where is the code that Generates the FORMs?

 What is the best way to modify this; Currently when it outputs the key name

 It puts a colon; ex. First Name: instaead of just First Name

 I simply want to remove that from the form.

 Also on the links of the welcome app; That generate the [ login | register
 | lost pasword? ] links

 I want to remove all those extra chars.

 I checked the templates I dont see it in there;  I also see something in
 gluon.tools.py but I dont want to modify gluon code.

 Thanks.






-- 

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


[web2py] Re: Web2Py Foundation?

2010-12-29 Thread Luther Goh Lu Feng
Maybe they think you are watching youtube videos :p

On Dec 30, 1:04 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I will amend my will to release the book under an open source license.

 You guys really think my heirs even know what I do in front of the
 computer all day?

 Massimo

 On Dec 29, 10:26 am, Anthony abasta...@gmail.com wrote:







  Also, what about the book? Would the community have to start from scratch on
  new documentation? The online version says modified content cannot be
  reproduced.

  Anthony

  On Wednesday, December 29, 2010 2:21:20 AM UTC-5, Graham Dumpleton wrote:

   On Wednesday, December 29, 2010 5:49:17 PM UTC+11, Magnitus wrote:

   Wow, some heavy duty concerns in this thread...

   I'm not fully versed in the detailed legalities of those things, but
   I'll elaborate things as I understand them and perhaps I can be
   corrected if I'm wrong...

   Basically, I get Web2py under the GLP licence.

   Under that licence, I can:

   1) Use and distribute the unmodified web framework indefinitely as
   long as I provide a copy of the licence and the source code

   2) Modify the source code of the Framework as I see fit as long as
   long as I make an open source copy of my modification available with
   an original copy of the licence and indicate how it was modified from
   the original source

   The above would apply to any copy I downloaded when the licence was in
   force, even if say, Massimo was struck by a meteor and Web2py stopped
   being distributed under such a licence.

   So, the main worry isn't that if Massimo is eaten by raiding
   cannibals, people won't have the legal means to distribute future
   modified copies of Web2py, but rather that nobody may have the
   expertize or interest to do so, correct?

   It is an open question whether distribution of such modified copies are
   legally allowed to still be called web2py if Massimo has sole legal rights
   on the name. Thus, you may be able to do that, but you likely would have 
   to
   call it something other than web2py.

   Graham

   On Dec 28, 12:28 pm, mdipierro mdi...@cs.depaul.edu wrote:
Afoundationis a corporation and, believe it or not, in US a
corporation is a person:

 http://www.professorbainbridge.com/professorbainbridgecom/2010/01/the...

The Djangofoundationwas created two years ago (and Django is 4-5
years older thanweb2py). Do you have any evidence that it has
improved its popularity:

 http://www.google.com/trends?q=django?

Python has afoundationand it looks to me it is always broke. I just
spoke with a recruiter that was looking for Python programmers for a
big US bank and I complained that his client relied on a product
(Python) and did not make any donation to support it. The python
developers are not supported by thefoundation, as far as I know.

Afoundationhas costs higher than a corporation and I do not get
enough donation to cover those costs. A corporation
(experts4solutions) is cheaper (it still costs at least $500/year of
my own money). Moreover afoundationimplies that design decision are
taken by committee and I do not believe in that.

I consult with core developers and users on important matters but I
think there has to be one individual who ultimately takes decisions
about the direction of the project.

We have explored the possibility of joining the free software
conservatory but we got no feedback.

Rails is owned by a corporation (37signals) which is owned by one
individual. It seems to be the model works well for them. In my case I
decided not to pass copyright and trademark to experts4solutions
because I thought some would have criticized it.

I am not the only committer to the mainweb2pybranch. Jonathan L. is
also a committer and will use his power in case I am incapacitated.
Yet, that should not be a crowded space in order to avoid internal
conflicts.

I will write a will that explains what happens to theweb2pytrademark
and copyright in case I die.

Massimo

On Dec 28, 2:12 am, Graham Dumpleton graha...@gmail.com
wrote:

 On Tuesday, December 28, 2010 5:37:30 PM UTC+11, mdipierro wrote:

  Not sure what a single person framework means. This framework 
  counts

  almost 100 contributors and at least 50 people very skilled here. 
  If
   I
  get hit by a track any of them can take over by forking my branch 
  as

  allowed by the license.

 That last line actually supports the idea that a piece of software is
   owned
 and controlled by a single person. If a piece of software was owned 
 by
   a
 group, be it a corporation or afoundation, the death of the core
   developer
 would make no difference as it would continue to be developed within
   the
 structure of that corporation orfoundationand copyright still held by
   the
 continuing entity.

 In your case, if 

Re: [web2py] FORM Generation Code.

2010-12-29 Thread David J.

Bruno;

That just changes the value; but the problem is the form code adds an 
extra : to the end of the name.


so if you do as you suggested. db.auth_user.first_name.label='FName'

It outputs FName: not FName without the trailing colon :


Thanks.


On 12/29/10 2:02 PM, Bruno Rocha wrote:

you can set labels to auth_user table

db.auth_user.first_name.label = 'F Name'
db.auth_user.last_name.label = 'WHATEVER'

If you mean extra link in login/register form, simply edit 
/views/default/user.html




2010/12/29 David J. da...@styleflare.com mailto:da...@styleflare.com

Where is the code that Generates the FORMs?

What is the best way to modify this; Currently when it outputs the
key name

It puts a colon; ex. First Name: instaead of just First Name

I simply want to remove that from the form.

Also on the links of the welcome app; That generate the [ login |
register | lost pasword? ] links

I want to remove all those extra chars.

I checked the templates I dont see it in there;  I also see
something in gluon.tools.py http://gluon.tools.py but I dont
want to modify gluon code.

Thanks.






--

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




Re: [web2py] FORM Generation Code.

2010-12-29 Thread David J.

Also if you look carefully this out put code is not consistent.

If you look at the verify password field it is not using 
class=w2p_fl|fw|fc


Its just wrapped in a label.


Snippet from Register form.

tr id=auth_user_password__rowtd class=w2p_fllabel 
for=auth_user_password id=auth_user_password__labelPassword: 
/label/tdtd class=w2p_fwinput class=password 
id=auth_user_password name=password type=password value= 
//tdtd class=w2p_fc/td/trtr 
id=auth_user_password_two__rowtdlabelVerify 
Password:/label/tdtdinput name=password_two type=password 
//tdtdplease input your password again/td/trtr 
id=submit_record__rowtd class=w2p_fl/tdtd 
class=w2p_fwinput type=submit value=Submit //tdtd 
class=w2p_fc/td/tr/tablediv class=hiddeninput name=_next 
type=hidden value=/app/default/index /input name=_formkey 
type=hidden value=2854b30e-a066-47c4-a9e2-f6902b899e7c /input 
name=_formname type=hidden value=register //div/form



On 12/29/10 2:02 PM, Bruno Rocha wrote:

you can set labels to auth_user table

db.auth_user.first_name.label = 'F Name'
db.auth_user.last_name.label = 'WHATEVER'

If you mean extra link in login/register form, simply edit 
/views/default/user.html




2010/12/29 David J. da...@styleflare.com mailto:da...@styleflare.com

Where is the code that Generates the FORMs?

What is the best way to modify this; Currently when it outputs the
key name

It puts a colon; ex. First Name: instaead of just First Name

I simply want to remove that from the form.

Also on the links of the welcome app; That generate the [ login |
register | lost pasword? ] links

I want to remove all those extra chars.

I checked the templates I dont see it in there;  I also see
something in gluon.tools.py http://gluon.tools.py but I dont
want to modify gluon code.

Thanks.






--

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




Re: [web2py] FORM Generation Code.

2010-12-29 Thread Bruno Rocha
2010/12/29 David J. da...@styleflare.com

  Bruno;

 That just changes the value; but the problem is the form code adds an extra
 : to the end of the name.

 so if you do as you suggested. db.auth_user.first_name.label='FName'

 It outputs FName: not FName without the trailing colon :



The colon is being defined here:
http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py?r=f3c30b057686b916153c5fbc0b2d341810c95683#722

I am testing, trying a way to remove it, I guess if you pass labels to
SQLFORM() the colon will be removed.


-- 

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


[web2py] Re: Renaming fields of auth tables

2010-12-29 Thread Lisandro
Thanks for the quickly answer. Though, I really need to rename the
field, this is for keep backward compatibility and standards with an
existing system.


On 29 dic, 11:03, Marin Pranjic marin.pran...@gmail.com wrote:
 Hi,
 you can use *label* like described 
 here:http://www.mail-archive.com/web2py@googlegroups.com/msg28123.html

 but you can still reference it only by its name ['first_name', 'last_name'].

 On Wed, Dec 29, 2010 at 2:44 PM, Lisandro rostagnolisan...@gmail.comwrote:

  Hi everyone.
  I'm customizing my authentication and access control system (following
  the instructions from the web2py website and some examples of this
  group).

  I've renamed my auth_user table with the following:
  auth.settings.table_user_name = 'ciudadanos'

  Then I renamed the fields first_name and last_name, defining my
  custom table. But when I try to insert a record (from database
  administration interface), I receive an error.

  ¿Is it possible to rename fields of auth_user table without having to
  change web2py source code?
  If it isn't possible, ¿is there a way to set an alias for a  field,
  so it can be referenced by its name or by its alias?

  Thanks in advance.




Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Arun K.Rajeevan
great as far as 25 page pdf is in consideration. next time a simple text 
file is good enough.
how the page get rendered? using generic.html or is it have a custom view 
file?
And what's the controller returns?

btw which version of web2py you are using? 

---
for others:

there's these lines in trace back

  File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
data = data.encode('utf8', 'xmlcharrefreplace')
TypeError: encode() takes at most 2 arguments (3 given)

Detailed traceback description
Exception: type 'exceptions.TypeError'(encode() takes at most 2 
arguments (3 given))
Python 2.6.4: P:\Python26\python.exe




Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Stef Mientki
On 29-12-2010 21:37, Arun K.Rajeevan wrote:
 great as far as 25 page pdf is in consideration. next time a simple text file 
 is good enough.
sorry about the large file, but I thought to give as much information as 
possible
 how the page get rendered?
Mozilla printing to pdf
 using generic.html or is it have a custom view file?
 And what's the controller returns?

 btw which version of web2py you are using?
don't know,
but got the problem,
the strings are derived from a completely other website,
with the use of BeautifulSoup,
and then strings are of type class 'BeautifulSoup.NavigableString'
so typecasting them as unicode solves the problem.

thanks
Stef Mientki

 ---
 for others:

 there's these lines in trace back

   File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
 data = data.encode('utf8', 'xmlcharrefreplace')
 TypeError: encode() takes at most 2 arguments (3 given)

 Detailed traceback description
 Exception: type 'exceptions.TypeError'(encode() takes at most 2 
 arguments (3 given))
 Python 2.6.4: P:\Python26\python.exe





Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Arun K.Rajeevan
problem seems to be with encoding data.

Can you show us relevant code that defines and initialize Books!


[web2py] Re: Auto reload of file

2010-12-29 Thread ron_m
If you put code in a file under the modules directory then it will require a 
restart unless you set the reload parameter to True

In model or controller
mod_name = local_import('module_file', True) will force a reload every time 
so restart not needed.

Otherwise nothing gets retained between requests that would force a restart 
of the server.

Ron


Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 12:37 PM, Arun K.Rajeevan wrote:
 great as far as 25 page pdf is in consideration. next time a simple text file 
 is good enough.
 how the page get rendered? using generic.html or is it have a custom view 
 file?
 And what's the controller returns?
 
 btw which version of web2py you are using? 
 
 ---
 for others:
 
 there's these lines in trace back
 
   File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
 data = data.encode('utf8', 'xmlcharrefreplace')
 TypeError: encode() takes at most 2 arguments (3 given)
 
 Detailed traceback description
 Exception: type 'exceptions.TypeError'(encode() takes at most 2 
 arguments (3 given))
 Python 2.6.4: P:\Python26\python.exe
 

I looked at this briefly. It's a rather strange error message, given that in 
fact only two arguments are given.

I ran a little test sequence to verify:

 data = u'abcd'
 data.encode('utf8', 'xmlcharrefreplace')
'abcd'
 data.encode('utf8', 'xmlcharrefreplace', 1)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: encode() takes at most 2 arguments (3 given)
 isinstance(data, unicode)
True



[web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread mdipierro
Probably it is counting

data.encode('utf8', 'xmlcharrefreplace')

data as self and 'utf8' as second argument. yet it is strange because
this is valid syntax.


On Dec 29, 3:08 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 29, 2010, at 12:37 PM, Arun K.Rajeevan wrote:



  great as far as 25 page pdf is in consideration. next time a simple text 
  file is good enough.
  how the page get rendered? using generic.html or is it have a custom view 
  file?
  And what's the controller returns?

  btw which version of web2py you are using?

  ---
  for others:

  there's these lines in trace back

    File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
      data = data.encode('utf8', 'xmlcharrefreplace')
  TypeError: encode() takes at most 2 arguments (3 given)

  Detailed traceback description
      Exception: type 'exceptions.TypeError'(encode() takes at most 2 
  arguments (3 given))
      Python 2.6.4: P:\Python26\python.exe

 I looked at this briefly. It's a rather strange error message, given that in 
 fact only two arguments are given.

 I ran a little test sequence to verify:

  data = u'abcd'
  data.encode('utf8', 'xmlcharrefreplace')
 'abcd'
  data.encode('utf8', 'xmlcharrefreplace', 1)

 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: encode() takes at most 2 arguments (3 given) isinstance(data, 
 unicode)

 True


Re: [web2py] Re: Renaming fields of auth tables

2010-12-29 Thread Marin Pranjic
You can ignore current first_name or last_name (or both) fields, and add
other fields, as you like.

Add custom fields, and for current (first_name, last_name) set readable =
False and writable = False and just don't use them.

More about customizing:
http://www.web2py.com/book/default/chapter/08#Customizing-Auth

hope this one helps

Marin

On Wed, Dec 29, 2010 at 9:02 PM, Lisandro rostagnolisan...@gmail.comwrote:

 Thanks for the quickly answer. Though, I really need to rename the
 field, this is for keep backward compatibility and standards with an
 existing system.


 On 29 dic, 11:03, Marin Pranjic marin.pran...@gmail.com wrote:
  Hi,
  you can use *label* like described here:
 http://www.mail-archive.com/web2py@googlegroups.com/msg28123.html
 
  but you can still reference it only by its name ['first_name',
 'last_name'].
 
  On Wed, Dec 29, 2010 at 2:44 PM, Lisandro rostagnolisan...@gmail.com
 wrote:
 
   Hi everyone.
   I'm customizing my authentication and access control system (following
   the instructions from the web2py website and some examples of this
   group).
 
   I've renamed my auth_user table with the following:
   auth.settings.table_user_name = 'ciudadanos'
 
   Then I renamed the fields first_name and last_name, defining my
   custom table. But when I try to insert a record (from database
   administration interface), I receive an error.
 
   ¿Is it possible to rename fields of auth_user table without having to
   change web2py source code?
   If it isn't possible, ¿is there a way to set an alias for a  field,
   so it can be referenced by its name or by its alias?
 
   Thanks in advance.
 
 



Re: [web2py] export_to_csv_file and colnames

2010-12-29 Thread howesc
ping.  in trunk it's now at line 4774.

if there is a reason not to make the change please let me know so i can fix 
my code.  (but i assume this just has not made it to the priority list yet, 
which is just fine, it is the holiday season and all!)

thanks,

christian


Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 1:35 PM, mdipierro wrote:
 
 Probably it is counting
 
 data.encode('utf8', 'xmlcharrefreplace')
 
 data as self and 'utf8' as second argument. yet it is strange because
 this is valid syntax.

That occurred to me, too, but that's not what's happening. See my test sequence:

  data = u'abcd'
  data.encode('utf8', 'xmlcharrefreplace')
 'abcd'
  data.encode('utf8', 'xmlcharrefreplace', 1)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: encode() takes at most 2 arguments (3 given)
  isinstance(data, unicode)
 True


 
 
 On Dec 29, 3:08 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 29, 2010, at 12:37 PM, Arun K.Rajeevan wrote:
 
 
 
 great as far as 25 page pdf is in consideration. next time a simple text 
 file is good enough.
 how the page get rendered? using generic.html or is it have a custom view 
 file?
 And what's the controller returns?
 
 btw which version of web2py you are using?
 
 ---
 for others:
 
 there's these lines in trace back
 
   File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
 data = data.encode('utf8', 'xmlcharrefreplace')
 TypeError: encode() takes at most 2 arguments (3 given)
 
 Detailed traceback description
 Exception: type 'exceptions.TypeError'(encode() takes at most 2 
 arguments (3 given))
 Python 2.6.4: P:\Python26\python.exe
 
 I looked at this briefly. It's a rather strange error message, given that in 
 fact only two arguments are given.
 
 I ran a little test sequence to verify:
 
 data = u'abcd'
 data.encode('utf8', 'xmlcharrefreplace')
 'abcd'
 data.encode('utf8', 'xmlcharrefreplace', 1)
 
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: encode() takes at most 2 arguments (3 given) isinstance(data, 
 unicode)
 
 True




Re: [web2py] Re: I don't understand this error, anyone to help ?

2010-12-29 Thread Stef Mientki
thanks very much guys,
but probably you missed the solution I posted about an hour ago:

strings are of type class 'BeautifulSoup.NavigableString'

cheers
Stef


On 29-12-2010 22:51, Jonathan Lundell wrote:
 On Dec 29, 2010, at 1:35 PM, mdipierro wrote:
 Probably it is counting

 data.encode('utf8', 'xmlcharrefreplace')

 data as self and 'utf8' as second argument. yet it is strange because
 this is valid syntax.
 That occurred to me, too, but that's not what's happening. See my test 
 sequence:

   data = u'abcd'
   data.encode('utf8', 'xmlcharrefreplace')
  'abcd'
   data.encode('utf8', 'xmlcharrefreplace', 1)
  Traceback (most recent call last):
File stdin, line 1, in module
  TypeError: encode() takes at most 2 arguments (3 given)
   isinstance(data, unicode)
  True



 On Dec 29, 3:08 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 29, 2010, at 12:37 PM, Arun K.Rajeevan wrote:



 great as far as 25 page pdf is in consideration. next time a simple text 
 file is good enough.
 how the page get rendered? using generic.html or is it have a custom view 
 file?
 And what's the controller returns?
 btw which version of web2py you are using?
 ---
 for others:
 there's these lines in trace back
   File P:\Web2PY\web2py_src\web2py\gluon\html.py, line 118, in xmlescape
 data = data.encode('utf8', 'xmlcharrefreplace')
 TypeError: encode() takes at most 2 arguments (3 given)
 Detailed traceback description
 Exception: type 'exceptions.TypeError'(encode() takes at most 2 
 arguments (3 given))
 Python 2.6.4: P:\Python26\python.exe
 I looked at this briefly. It's a rather strange error message, given that 
 in fact only two arguments are given.

 I ran a little test sequence to verify:

 data = u'abcd'
 data.encode('utf8', 'xmlcharrefreplace')
 'abcd'
 data.encode('utf8', 'xmlcharrefreplace', 1)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: encode() takes at most 2 arguments (3 given) isinstance(data, 
 unicode)

 True




[web2py] Re: experts4solution: please update your profile

2010-12-29 Thread DenesL

Can you please hide the email from bots.


Re: [web2py] Re: Web2Py Foundation?

2010-12-29 Thread Branko Vukelić
On Wed, Dec 29, 2010 at 7:08 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 This thread can be historical like that
 one: http://www.python.org/search/hypermail/python-1994q2/1040.html which
 was the start of PSF

Why are Westerners so obsessed with death? That's quite amazing.


-- 
Branko Vukelic

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


[web2py] What's the best way to insert raw html ?

2010-12-29 Thread Stef Mientki
hello,

I'v raw html derived with BeautifulSoup from another webpage,
which I want insert in the contents of the web.
The images in the orginal webpage are located in the same directory as the html 
page.
The orginal webpage is moved to a database,
and the images are placed into the web2py application's static/images/...

Now I encounter 2 problems:
1. the raw html contains tags, like:

ptoch iets over stromen, een plaatje/ppbr //pbr 
/pnbsp;nbsp;

I remove them with the helper function TAG.
Although it seems to work, I'm not convinced that this is the right method.
Is this the correct way ?
Are there better ways ?

The second problem is the image locations:

   pimg width=307 height=244 alt= src=veiligheid_website_img1.jpg 
//p

I change the image location with, not a neat way, but it works.
Any better ways ?

  Result = DIV ()
  Result.append ( H2 ( Book + ', ' + Chapter ) )
  Result.append ( H3 ( Paragraph ) )
  Text = Text.replace ( 'src=', 'src=/E_Veiligheid/static/images/' )
  Result.append ( TAG ( Text ) )

thanks,
Stef Mientki


[web2py] component .load

2010-12-29 Thread mattynoce
hi all. i have a component i'm plugging into the middle of a page, but
i want that component to act seamlessly with the rest of the page. i
do NOT want the component to do what components usually do and act
independently. i need to include variable files, and components are
the only way i can find to do that.

so when i submit forms from the component, they automatically
append .load to redirects. i do not want this. so i found i can do:
redirect(URL(..., extension=''))

however, when i execute other commands like this:
def formControllerFromComponent:
doSomething()
doSomethingElse()
redirect(URL(..., extension=''))

doSomething() will create any links it makes with a .load extension. i
don't want to have to go around and append extension='' to every URL
command in my controller. is there a way we can stop propagation of
the .load suffix? based on a variable in the load initialization?
something like:
{{=LOAD(c='default', f='func', args=[arg1, arg2], ajax=False,
ajax_trap=False, loadPropagate=False)}}

thanks,

matt


[web2py] Re: Web2Py Foundation?

2010-12-29 Thread mdipierro
It is more that people in US are obsessed with lawsuits. ;-)



On Dec 29, 4:30 pm, Branko Vukelić stu...@brankovukelic.com wrote:
 On Wed, Dec 29, 2010 at 7:08 PM, Bruno Rocha rochacbr...@gmail.com wrote:

  This thread can be historical like that
  one: http://www.python.org/search/hypermail/python-1994q2/1040.html which
  was the start of PSF

 Why are Westerners so obsessed with death? That's quite amazing.

 --
 Branko Vukelic

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


Re: [web2py] Re: Web2Py Foundation?

2010-12-29 Thread Branko Vukelić
2010/12/30 mdipierro mdipie...@cs.depaul.edu:
 It is more that people in US are obsessed with lawsuits. ;-)

Lawsuits and death. Very nice. :)

-- 
Branko Vukelic

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


[web2py] Re: Not open source yet... but

2010-12-29 Thread mdipierro
version 0.2:

http://www.vimeo.com/18282084

On Dec 28, 12:55 am, mdipierro mdipie...@cs.depaul.edu wrote:
 http://vimeo.com/18232653


Re: [web2py] component .load

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 3:25 PM, mattynoce wrote:
 
 hi all. i have a component i'm plugging into the middle of a page, but
 i want that component to act seamlessly with the rest of the page. i
 do NOT want the component to do what components usually do and act
 independently. i need to include variable files, and components are
 the only way i can find to do that.
 
 so when i submit forms from the component, they automatically
 append .load to redirects. i do not want this. so i found i can do:
 redirect(URL(..., extension=''))
 
 however, when i execute other commands like this:
 def formControllerFromComponent:
doSomething()
doSomethingElse()
redirect(URL(..., extension=''))
 
 doSomething() will create any links it makes with a .load extension. i
 don't want to have to go around and append extension='' to every URL
 command in my controller. is there a way we can stop propagation of
 the .load suffix? based on a variable in the load initialization?
 something like:
 {{=LOAD(c='default', f='func', args=[arg1, arg2], ajax=False,
 ajax_trap=False, loadPropagate=False)}}

URL is probably picking up the .load extension from request.extension. It might 
be more convenient to set that to 'html'.

[web2py] Re: export_to_csv_file and colnames

2010-12-29 Thread mdipierro
in trunk. Sorry I had missed the thread

On Dec 29, 3:49 pm, howesc how...@umich.edu wrote:
 ping.  in trunk it's now at line 4774.

 if there is a reason not to make the change please let me know so i can fix
 my code.  (but i assume this just has not made it to the priority list yet,
 which is just fine, it is the holiday season and all!)

 thanks,

 christian


[web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread Maurice Ling
Thanks everyone.

It worked.

On Dec 29, 6:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 or

 URL('account', 'log_in')

 On Dec 29, 3:14 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
 wrote:

  If I remember correctly there was something about this on the list.

  I think you use the URL the wrong way and until version 1.83.2 the
  helper worked wrongly. In your case it worked but it has been
  corrected and it doesn t work anymore.

  Try something like URL(c='account', f='log_in')

  Kenneth

   Hi

   I have a problem since version 1.83.2. It gives me this error:

   Traceback (most recent call last):
      File D:\web2py\gluon\restricted.py, line 186, in restricted
        exec ccode in environment
      File D:/web2py/applications/init/controllers/default.py, line 91,
   inmodule
      File D:\web2py\gluon\globals.py, line 96, inlambda
        self._caller = lambda f: f()
      File D:/web2py/applications/init/controllers/default.py, line 55,
   in index
        name = check_login()
      File D:/web2py/applications/init/controllers/default.py, line 38,
   in check_login
        redirect(URL(r=request, f='../account/log_in'))
      File D:\web2py\gluon\html.py, line 226, in _URL
        return URL(*args, **kwargs)
      File D:\web2py\gluon\html.py, line 186, in URL
        raise SyntaxError, 'not enough information to build the url'
   SyntaxError: not enough information to build the url

   My codes worked up to version 1.82.1.

   I am using my own authorization/login codes which is in controllers/
   account.py. The offending code (check_login function) is as follows:

   def check_login(session=session):
        if session.login_time == None:
            session.login_time = 0
        if session.username == None or \
            session.login_time + login_expiry * 3600  int(time.time()):
            redirect(URL(r=request, f='../account/log_in'))
        else:
            return session.username

   In version 1.82.1, check_login (called byhttp://localhost:8000/init)
   redirects tohttp://localhost:8000/init/account/login. But from
   version 1.83.2, it seems to redirect 
   tohttp://localhost:8000/init/default/init/account/login
   which is non-existent.

   Any ideas what might be happening?

   Thanks
   Maurice Ling




Re: [web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread Branko Vukelić
Btw, in case you're new to these things, the main point of URL helpers
(called URL generators in some frameworks) is to generate the URL
based on the information about the internal structure of the
application. This is done to avoid hard-coding the paths. If you
merely use the URL helper function to pass a full relative path, it
sort of beats the purpose (that's what others meant by 'not supposed
to work that way').

On Thu, Dec 30, 2010 at 1:15 AM, Maurice Ling mauricel...@gmail.com wrote:
 Thanks everyone.

 It worked.

 On Dec 29, 6:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 or

 URL('account', 'log_in')

 On Dec 29, 3:14 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
 wrote:

  If I remember correctly there was something about this on the list.

  I think you use the URL the wrong way and until version 1.83.2 the
  helper worked wrongly. In your case it worked but it has been
  corrected and it doesn t work anymore.

  Try something like URL(c='account', f='log_in')

  Kenneth

   Hi

   I have a problem since version 1.83.2. It gives me this error:

   Traceback (most recent call last):
      File D:\web2py\gluon\restricted.py, line 186, in restricted
        exec ccode in environment
      File D:/web2py/applications/init/controllers/default.py, line 91,
   inmodule
      File D:\web2py\gluon\globals.py, line 96, inlambda
        self._caller = lambda f: f()
      File D:/web2py/applications/init/controllers/default.py, line 55,
   in index
        name = check_login()
      File D:/web2py/applications/init/controllers/default.py, line 38,
   in check_login
        redirect(URL(r=request, f='../account/log_in'))
      File D:\web2py\gluon\html.py, line 226, in _URL
        return URL(*args, **kwargs)
      File D:\web2py\gluon\html.py, line 186, in URL
        raise SyntaxError, 'not enough information to build the url'
   SyntaxError: not enough information to build the url

   My codes worked up to version 1.82.1.

   I am using my own authorization/login codes which is in controllers/
   account.py. The offending code (check_login function) is as follows:

   def check_login(session=session):
        if session.login_time == None:
            session.login_time = 0
        if session.username == None or \
            session.login_time + login_expiry * 3600  int(time.time()):
            redirect(URL(r=request, f='../account/log_in'))
        else:
            return session.username

   In version 1.82.1, check_login (called byhttp://localhost:8000/init)
   redirects tohttp://localhost:8000/init/account/login. But from
   version 1.83.2, it seems to redirect 
   tohttp://localhost:8000/init/default/init/account/login
   which is non-existent.

   Any ideas what might be happening?

   Thanks
   Maurice Ling






-- 
Branko Vukelic

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


Re: [web2py] What's the best way to insert raw html ?

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 3:10 PM, Stef Mientki wrote:
 
 Now I encounter 2 problems:
 1. the raw html contains tags, like:
 
ptoch iets over stromen, een plaatje/ppbr //pbr 
 /pnbsp;nbsp;
 
 I remove them with the helper function TAG.
 Although it seems to work, I'm not convinced that this is the right method.
 Is this the correct way ?
 Are there better ways ?
 
 The second problem is the image locations:
 
   pimg width=307 height=244 alt= src=veiligheid_website_img1.jpg 
 //p
 
 I change the image location with, not a neat way, but it works.
 Any better ways ?
 
  Result = DIV ()
  Result.append ( H2 ( Book + ', ' + Chapter ) )
  Result.append ( H3 ( Paragraph ) )
  Text = Text.replace ( 'src=', 'src=/E_Veiligheid/static/images/' )
  Result.append ( TAG ( Text ) )

I'd try something like this; it might need a little tweaking. Call URL so that 
you'll get the benefit of any rewriting that you might choose to do someday.

An alternative to Text.replace would be to do a global regex substitution, 
where the replacement pattern is a function that calls URL('static', 
'images/%s' % matchobj.group(0)). See the re.sub section of 
http://docs.python.org/library/re.html for details. 

But for your purposes, the code below, more or less, ought to do it.

 prefix = URL('static', 'images')
 Result = DIV(
H2(Book + ', ' + Chapter),
H3(Paragraph),
XML(Text.replace('src=', 'src=%s/' % prefix)
 )



Re: [web2py] Re: Problems in web2py 1.83.2

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 4:32 PM, Branko Vukelić wrote:
 
 Btw, in case you're new to these things, the main point of URL helpers
 (called URL generators in some frameworks) is to generate the URL
 based on the information about the internal structure of the
 application. This is done to avoid hard-coding the paths. If you
 merely use the URL helper function to pass a full relative path, it
 sort of beats the purpose (that's what others meant by 'not supposed
 to work that way').

It also takes into account URL rewriting.

 
 On Thu, Dec 30, 2010 at 1:15 AM, Maurice Ling mauricel...@gmail.com wrote:
 Thanks everyone.
 
 It worked.
 
 On Dec 29, 6:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 or
 
 URL('account', 'log_in')
 
 On Dec 29, 3:14 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
 wrote:
 
 If I remember correctly there was something about this on the list.
 
 I think you use the URL the wrong way and until version 1.83.2 the
 helper worked wrongly. In your case it worked but it has been
 corrected and it doesn t work anymore.
 
 Try something like URL(c='account', f='log_in')
 
 Kenneth
 
 Hi
 
 I have a problem since version 1.83.2. It gives me this error:
 
 Traceback (most recent call last):
File D:\web2py\gluon\restricted.py, line 186, in restricted
  exec ccode in environment
File D:/web2py/applications/init/controllers/default.py, line 91,
 inmodule
File D:\web2py\gluon\globals.py, line 96, inlambda
  self._caller = lambda f: f()
File D:/web2py/applications/init/controllers/default.py, line 55,
 in index
  name = check_login()
File D:/web2py/applications/init/controllers/default.py, line 38,
 in check_login
  redirect(URL(r=request, f='../account/log_in'))
File D:\web2py\gluon\html.py, line 226, in _URL
  return URL(*args, **kwargs)
File D:\web2py\gluon\html.py, line 186, in URL
  raise SyntaxError, 'not enough information to build the url'
 SyntaxError: not enough information to build the url
 
 My codes worked up to version 1.82.1.
 
 I am using my own authorization/login codes which is in controllers/
 account.py. The offending code (check_login function) is as follows:
 
 def check_login(session=session):
  if session.login_time == None:
  session.login_time = 0
  if session.username == None or \
  session.login_time + login_expiry * 3600  int(time.time()):
  redirect(URL(r=request, f='../account/log_in'))
  else:
  return session.username
 
 In version 1.82.1, check_login (called byhttp://localhost:8000/init)
 redirects tohttp://localhost:8000/init/account/login. But from
 version 1.83.2, it seems to redirect 
 tohttp://localhost:8000/init/default/init/account/login
 which is non-existent.
 
 Any ideas what might be happening?
 
 Thanks
 Maurice Ling





[web2py] Database administrator not showing records

2010-12-29 Thread Maurice Ling
Hi

I've upgraded to version 1.91.5 and noticed an issue with the database
administrator.

I was in the admin application of my application (http://localhost:
8000/admin/default/design/init) and clicked on database
administration, then click on any one of my populated databases. By
right, it should show me the database table but noe, it says invalid
SQL filter. The SQL filter is the default filter comment.id0.

Any ideas?

Thanks
Maurice


[web2py] Re: The stability of web2py releases

2010-12-29 Thread Leo
Hi Folks,

I just read the entire thread... uff.

I am a member of the Technical Leaderhip Council at Coin-OR (www.coin-
or.org). We went through these arguments a while back improductively
several times until we made it a priority to resolve them. We are sure
glad we did. We have over 50 projects in diverse areas of Analytics,
some with very enthusiastic innovative project managers and some with
very conservative codebases sponsored by IBM. Our users are just as
diverse (as is the case with web2py).

Here is what has worked for us (it is not that different from many
other projects):

1) Stable means feature-stable, not necessarily crash-stable. They
take numbering schemes like X.Y
2) Releases use minor points derived from stable numbers, e.g. X.Y.z.
All releases must pass their unittests. Unfortunately many projects
have incomplete unittests, but that is another issue. Releases have
bug-fixes only.
3) Trunk is trunk. Use at your own risk. That is where the latest and
greatest lives.
4) Each project has a ticket system for patches and bug reports.

The +:
* Users knows where the project stands. They know what they are
getting from their downlads and naturally segment into the appropriate
groups.
* PMs can more easily coordinate developers.
The -:
* It is often difficult to get PMs to do stables and releases.
Sometimes it takes a dedicated non-core developer who really wants a
feature to do it for them.

Personally I think a ticket system for web2py linked to from the
Support tab would be a great first enhancement (I added it to the
voices app).

Cheers,
Leo.

On Dec 30, 5:55 am, appydev appy...@gmail.com wrote:
 I totally agree with Jonathan Lundell,

 I think the changes he proposes, would provide stability web2py, and I'm
 sure will appeal to users (both new and existing).

 My humble opinion is that the way they attack the bugs, is one of the
 weaknesses ofweb2py, I think it is
 messy and I'm sure many have decided not to use web2py for it.

 2010/12/22 Jonathan Lundell jlund...@pobox.com

  On Dec 22, 2010, at 7:47 AM, Branko Vukelić wrote:

   2010/12/22 Luis Díaz diazluis2...@gmail.com:

   in particular whenever new versions come out ... I always say ... have
   to wait 1 week or 2 to becomestable ...

   Not become stable, but be proven stable. You release, wait for
   everyone to give it a go. If everyone is happy, then it's considered
   stable, and move to stable box on the downloads page. If someone
   complains, it stays in unstable indefinitely, and a new release is
   made fixing the bugs.

  The problem is that become stable is in conflict with add new features,
  and the new release that fixes the bugs also gets new (and buggy) features.

  Linux has a similar problem, that gets addressed a couple of ways. One is
  that we have Linux distributions independent of (and lagging) the core
  kernel releases: Red Hat, Ubuntu, etc. The other, somewhat more recent, is
  that certain kernel releases are maintained by the core kernel developers as
  stable points.

  The web2py equivalent would be something like this. Massimo releases
  1.91.1, and we (for some we) decide that that's a good feature/stability
  set for a stable release point. We then create a stable branch, and somebody
  (for some somebody--this is the catch) back-ports bug fixes to the stable
  branch, so we have 1.91.1.1, 1.91.1.2, etc, with *only* confirmed bug fixes,
  no new features, being back-ported. Meanwhile, trunk development proceeds
  with 1.91, 1.93, etc.

  Problem is, maintaining stable branches requires real work, and in this
  environment it means volunteer work.




[web2py] Re: Database administrator not showing records

2010-12-29 Thread mdipierro
What version did you upgrade from? Did it work before with the same
data?


On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote:
 Hi

 I've upgraded to version 1.91.5 and noticed an issue with the database
 administrator.

 I was in the admin application of my application (http://localhost:
 8000/admin/default/design/init) and clicked on database
 administration, then click on any one of my populated databases. By
 right, it should show me the database table but noe, it says invalid
 SQL filter. The SQL filter is the default filter comment.id0.

 Any ideas?

 Thanks
 Maurice


[web2py] Re: CASE statements in DAL?

2010-12-29 Thread Harkirat
Thanks for the suggestion Massimo! I haven't been able to get it to
work though.
That syntax returns an error TypeError: __init__() takes at least 3
arguments (2 given)
Tried looking at the Expression class defined in DAL.py for what
arguments it needs but haven't been able to figure this out.
Any more suggestions?

If this does not work we will most likely have to shift to SQL Alchemy
and I do like working with the DAL so I am keeping my fingers crossed
and hoping there is work around for this.

Harkirat



On Dec 29, 11:56 am, mdipierro mdipie...@cs.depaul.edu wrote:
 You should be able to doL

 from gluon.dal import Expression

 db(query).select(Expression(CASE WHEN 1=1 THEN 0 ELSE 1 END));

 Nut I never tried.

 On Dec 29, 8:37 am, Harkirat harkira...@gmail.com wrote:







  Hi All !
            I am new to web2py and my company is building an enterprise
  level web application that will run on the desktop and also mobile
  apps using web2py! So far it has been a gr8 experience working with
  web2py and kudos to all the developers that made such an awesome
  framework !

  I am trying to write some queries in the DAL that require a CASE
  statement e.g.
  SELECT CASE WHEN 1=1 THEN 0 ELSE 1 END

  Is there a way to write this in the DAL?

  Thanks in advance for your help!

  Harkirat


[web2py] Re: CASE statements in DAL?

2010-12-29 Thread mdipierro
It is definitively possible. It just that I cannot test it right now.
Try:

db(query).select(Expression(CASE WHEN 1=1 THEN 0 ELSE 1 END,None));

else you can use

db.executesql(... any raw sql ...)

the latter is the safe way. Always works.

On Dec 29, 6:55 pm, Harkirat harkira...@gmail.com wrote:
 Thanks for the suggestion Massimo! I haven't been able to get it to
 work though.
 That syntax returns an error TypeError: __init__() takes at least 3
 arguments (2 given)
 Tried looking at the Expression class defined in DAL.py for what
 arguments it needs but haven't been able to figure this out.
 Any more suggestions?

 If this does not work we will most likely have to shift to SQL Alchemy
 and I do like working with the DAL so I am keeping my fingers crossed
 and hoping there is work around for this.

 Harkirat

 On Dec 29, 11:56 am, mdipierro mdipie...@cs.depaul.edu wrote:

  You should be able to doL

  from gluon.dal import Expression

  db(query).select(Expression(CASE WHEN 1=1 THEN 0 ELSE 1 END));

  Nut I never tried.

  On Dec 29, 8:37 am, Harkirat harkira...@gmail.com wrote:

   Hi All !
             I am new to web2py and my company is building an enterprise
   level web application that will run on the desktop and also mobile
   apps using web2py! So far it has been a gr8 experience working with
   web2py and kudos to all the developers that made such an awesome
   framework !

   I am trying to write some queries in the DAL that require a CASE
   statement e.g.
   SELECT CASE WHEN 1=1 THEN 0 ELSE 1 END

   Is there a way to write this in the DAL?

   Thanks in advance for your help!

   Harkirat




Re: [web2py] What's the best way to insert raw html ?

2010-12-29 Thread Stef Mientki

 An alternative to Text.replace would be to do a global regex substitution, 
 where the replacement pattern is a function that calls URL('static', 
 'images/%s' % matchobj.group(0)). See the re.sub section of 
 http://docs.python.org/library/re.html for details. 
regex are too difficult for me
 But for your purposes, the code below, more or less, ought to do it.

  prefix = URL('static', 'images')
  Result = DIV(
   H2(Book + ', ' + Chapter),
   H3(Paragraph),
   XML(Text.replace('src=', 'src=%s/' % prefix)
  )
perfect,
many thanks Jonathan,
that's exactly what I'm looking for.

cheers,
Stef



[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
It was working on 1.82.1 on the same data.

On Dec 30, 9:10 am, mdipierro mdipie...@cs.depaul.edu wrote:
 What version did you upgrade from? Did it work before with the same
 data?

 On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote:

  Hi

  I've upgraded to version 1.91.5 and noticed an issue with the database
  administrator.

  I was in the admin application of my application (http://localhost:
  8000/admin/default/design/init) and clicked on database
  administration, then click on any one of my populated databases. By
  right, it should show me the database table but noe, it says invalid
  SQL filter. The SQL filter is the default filter comment.id0.

  Any ideas?

  Thanks
  Maurice




[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
Sorry. Still worked on 1.83.2.

On Dec 30, 9:29 am, Maurice Ling mauricel...@gmail.com wrote:
 It was working on 1.82.1 on the same data.

 On Dec 30, 9:10 am, mdipierro mdipie...@cs.depaul.edu wrote:

  What version did you upgrade from? Did it work before with the same
  data?

  On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote:

   Hi

   I've upgraded to version 1.91.5 and noticed an issue with the database
   administrator.

   I was in the admin application of my application (http://localhost:
   8000/admin/default/design/init) and clicked on database
   administration, then click on any one of my populated databases. By
   right, it should show me the database table but noe, it says invalid
   SQL filter. The SQL filter is the default filter comment.id0.

   Any ideas?

   Thanks
   Maurice




[web2py] Re: Database administrator not showing records

2010-12-29 Thread mdipierro
No idea. Can you send me (confidetially) your app and your db (if it
is sqlite)?

On Dec 29, 7:30 pm, Maurice Ling mauricel...@gmail.com wrote:
 Sorry. Still worked on 1.83.2.

 On Dec 30, 9:29 am, Maurice Ling mauricel...@gmail.com wrote:

  It was working on 1.82.1 on the same data.

  On Dec 30, 9:10 am, mdipierro mdipie...@cs.depaul.edu wrote:

   What version did you upgrade from? Did it work before with the same
   data?

   On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote:

Hi

I've upgraded to version 1.91.5 and noticed an issue with the database
administrator.

I was in the admin application of my application (http://localhost:
8000/admin/default/design/init) and clicked on database
administration, then click on any one of my populated databases. By
right, it should show me the database table but noe, it says invalid
SQL filter. The SQL filter is the default filter comment.id0.

Any ideas?

Thanks
Maurice




  1   2   >