[web2py] Restoring backup from csv file fails - bug?

2010-11-13 Thread Johann Spies
I have saved the database on the production server with
db.export_to_csv_file(open('backup.csv'),'rb').

On my development-environment I dropped the database (postgresql), created a
new empty one and the following happened when I tried to import the backup:

db.import_from_csv_file(open('/Users/js/Programmeer/zenex/produksie/backup.csv'),'rb')
Traceback (most recent call last):
  File console, line 1, in module
  File /Users/js/Programmeer/zenex/web2py/gluon/sql.py, line 1488, in
import_from_csv_file
self[tablename].import_from_csv_file(ifile, id_map, null, unique, *args,
**kwargs)
  File /Users/js/Programmeer/zenex/web2py/gluon/sql.py, line 2152, in
import_from_csv_file
id_map_self[line[cid]] = new_id
UnboundLocalError: local variable 'id_map_self' referenced before assignment

Version: Version 1.89.1 (2010-11-12 15:14:36)

Is this a bug or did I do something wrong?

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


[web2py] Re: Stress testing a web2py deployment

2010-11-13 Thread VP
Have you tried apache bench (ab)?

 ab -kc 100 -t 30 http://example.com

this would bombard your site for 30 seconds with 100 connections.


On Nov 12, 2:01 am, Luther Goh Lu Feng elf...@yahoo.com wrote:

 Quick question: is there a way to simulate a stress test to find the
 upper limits of performance without using real users?


[web2py] A quick Q on blocked urls by auth

2010-11-13 Thread rāma
How do you get the initial url which initiated the redirect to a login
screen. I need to build a dictionary for custom login errors based on
these urls. Can this information be accessed from the login view?


[web2py] Re: Restoring backup from csv file fails - bug?

2010-11-13 Thread Johann Spies
 Is this a bug or did I do something wrong?

 A bug in my head.  Sorry for the noise. Wrong syntax.

Regards
Johann


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


[web2py] Re: Stress testing a web2py deployment

2010-11-13 Thread Luther Goh Lu Feng
Thank you very much. This does indeed seem like a useful tool. I will
research more into it.

The web2py installation was running on a 128mb Xen vps. As mentioned
earlier, we used apache to reverse proxy. We had 17 users login at the
1st try simultaneously. Just trying to access the login page of our
web app spawn off lots of apache processes and we believe that allowed
only a few users to access the website.

We subsequently reconfigured to use nginx as a reverse proxy and that
worked out much much better.

On Nov 13, 4:23 pm, VP vtp2...@gmail.com wrote:
 Have you tried apache bench (ab)?

  ab -kc 100 -t 30http://example.com

 this would bombard your site for 30 seconds with 100 connections.

 On Nov 12, 2:01 am, Luther Goh Lu Feng elf...@yahoo.com wrote:









  Quick question: is there a way to simulate a stress test to find the
  upper limits of performance without using real users?


[web2py] Selecting a few latest records

2010-11-13 Thread Ruiwen Chua
Hi,

I have a table full of records and would like to retrieve only the 15
most recent records, sorted by their creation date.

I've tried using the limitby= argument to select() in the DAL, but the
online book only shows one example that uses limitby to select 2
records starting from 0, ie. limitby=(0,2).

However, if I'd like to select the 15 most recent records, the
database offset most likely isn't going to be 0. What should I pass to
limitby in this case?

//Ruiwen


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Luther Goh Lu Feng
Jquery 1.4.4 has been released: http://j.mp/jq144

Perhaps it should be included as well?

On Nov 13, 2:12 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 web2py 1.89.1 breaks clockpicker for Field('...','time').

 Somehow jquery.clockpicker fails to determine the coordinates of the
 location where the INPUT is located.

 If anybody knows how to fix this, help is appreciated.

 Massimo

 On Nov 12, 9:22 am, mdipierro mdipie...@cs.depaul.edu wrote:







  Please give it a try and report any bug.

  1.89.1
  - new admin layout (thanks Branko Vukelic)
  - new admin search
  - new admin language selector (thanks Yair)
  - new Welcome app (thanks Martin Mulone)
  - beter wizard
  - admin support for DEMO_MODE=True
  - admin exposes GAE deployment button (always)
  - MENU support None links (thanks Michael Wolfe)
  - web2py.py -J for running cron (thanks Jonathan Lundell)
  - fixed ~db.table.id on GAE (thanks MicLee)
  - service.jsonrpc supports service.JsonRpcException (thanks Matt)
  - many small bug fixes.


[web2py] How to make a modal+ajax form manually?

2010-11-13 Thread demetrio
Hi everyone,

i'm doing a desktop like iGoogle, with boxes containing information
from different sources (it can be the same application, or other
apps). So I need send my own forms (like available_boxes, modify
content preferences and so)

I saw that the modal plugin is old and now is located inside
plugin_wiki, but I need to do something like that with my own forms.

Is there any way to do it manually?

Thanks in advance.


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread villas
If you want to try it...

1). Download files:
http://keith-wood.name/timeEntry.html
Optionally this: http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

2). Add to views/layout.html
{{response.files.append(URL(request.application,'static','css/
jquery.timeentry.css'))}}
{{response.files.append(URL(request.application,'static','js/
jquery.timeentry.js'))}}
{{response.files.append(URL(request.application,'static','js/
jquery.mousewheel.min.js'))}}

3). Make sure those 3 files above are copied into the folders under
static dir.

4). Copy spinnerDefault.png into static/images

5). In views/web2py_ajax.html replace this:

  try { jQuery(input.time).clockpick({
  starthour:0, endhour:23, showminutes:true, military:true
  }); } catch(e) {};

...with...

  try { jQuery(input.time).timeEntry({spinnerImage:
{{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
timeSteps:  [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
new Date(0, 0, 0, 22, 00, 0)
  }); } catch(e) {};


I included a couple of optional settings so you can see how they work
in combination.

It only takes a couple of minutes to set it up like this. Hope I
didn't forget anything. :)

-D


[web2py] Re: Selecting a few latest records

2010-11-13 Thread villas
Hi Ruiwen,

See also 'orderby' in the book. Do something like this:

db().select(db.person.ALL, orderby=~db.yourtable.created_date,
limitby=(0, 15))

Don't overlook the tilde (~), this is important because it makes
reverse order i.e. latest dates first

-D

On Nov 13, 10:10 am, Ruiwen Chua rwc...@gmail.com wrote:
 Hi,

 I have a table full of records and would like to retrieve only the 15
 most recent records, sorted by their creation date.

 I've tried using the limitby= argument to select() in the DAL, but the
 online book only shows one example that uses limitby to select 2
 records starting from 0, ie. limitby=(0,2).

 However, if I'd like to select the 15 most recent records, the
 database offset most likely isn't going to be 0. What should I pass to
 limitby in this case?

 //Ruiwen


[web2py] Re: How to make a modal+ajax form manually?

2010-11-13 Thread villas
Hi Demetrio

Check out www.web2py.com/book chapter 13 and read about components and
the LOAD function which may help.

-D

On Nov 13, 11:48 am, demetrio dgzabal...@gmail.com wrote:
 Hi everyone,

 i'm doing a desktop like iGoogle, with boxes containing information
 from different sources (it can be the same application, or other
 apps). So I need send my own forms (like available_boxes, modify
 content preferences and so)

 I saw that the modal plugin is old and now is located inside
 plugin_wiki, but I need to do something like that with my own forms.

 Is there any way to do it manually?

 Thanks in advance.


[web2py] keeping the data inserted in the sql form after submit.

2010-11-13 Thread Napoleon Moreno
Good day.

Is it posible keep the data in the form AFTER the submit.

It is show me a new form. I need the inserted data continue in the form.

Is it posible?

Thanks


[web2py] Re: keeping the data inserted in the sql form after submit.

2010-11-13 Thread villas
Hi Napoleon

Yes, look up 'keepvalues' in this chapter of the book.
http://www.web2py.com/book/default/chapter/07

-D

On Nov 13, 1:52 pm, Napoleon Moreno napoleo...@gmail.com wrote:
 Good day.

 Is it posible keep the data in the form AFTER the submit.

 It is show me a new form. I need the inserted data continue in the form.

 Is it posible?

 Thanks


Re: [web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Nathan Freeze
This would be a good slice :)

On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:

 If you want to try it...

 1). Download files:
 http://keith-wood.name/timeEntry.html
 Optionally this:
 http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

 2). Add to views/layout.html
{{response.files.append(URL(request.application,'static','css/
 jquery.timeentry.css'))}}
{{response.files.append(URL(request.application,'static','js/
 jquery.timeentry.js'))}}
{{response.files.append(URL(request.application,'static','js/
 jquery.mousewheel.min.js'))}}

 3). Make sure those 3 files above are copied into the folders under
 static dir.

 4). Copy spinnerDefault.png into static/images

 5). In views/web2py_ajax.html replace this:

  try { jQuery(input.time).clockpick({
  starthour:0, endhour:23, showminutes:true, military:true
  }); } catch(e) {};

 ...with...

  try { jQuery(input.time).timeEntry({spinnerImage:
 {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
 timeSteps:  [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
 new Date(0, 0, 0, 22, 00, 0)
  }); } catch(e) {};


 I included a couple of optional settings so you can see how they work
 in combination.

 It only takes a couple of minutes to set it up like this. Hope I
 didn't forget anything. :)

 -D



[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread villas
Hi Jason

I guess you have to define 'large deployment' first of all.  Number of
records and size of DB? Number of concurrent users? Large data model
or number of forms etc?  Number of servers -- or replication?  Global
coverage?

In principle I don't think there's any reason why Web2py would be
worse than other frameworks.  Usually it is much better!  As an
example,  I think deploying to the Google App Engine should be able to
scale sufficiently for everything but extreme cases :)

If you specify more about what you wish to achieve this group may be
able to give more specific advice how best to organise your project.

-D

On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:
 I love web2py and it's the only framework i feel i am fully capable to do or 
 learn to do quickly.
 However, I remember see that this framework is intended for small to medium 
 sized deployments. Is this true? What is it that stops us from larger 
 deployment? Should i pickup django because i may need it?
 Regards,
 jb


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread villas
Hi Mr Freeze!

Well, if others like it, it may end up in trunk  :)
If not, I'll make a slice for it.

Best wishes,
-D

On Nov 13, 2:24 pm, Nathan Freeze nat...@freezable.com wrote:
 This would be a good slice :)

 On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
  If you want to try it...

  1). Download files:
 http://keith-wood.name/timeEntry.html
  Optionally this:
 http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

  2). Add to views/layout.html
     {{response.files.append(URL(request.application,'static','css/
  jquery.timeentry.css'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.timeentry.js'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.mousewheel.min.js'))}}

  3). Make sure those 3 files above are copied into the folders under
  static dir.

  4). Copy spinnerDefault.png into static/images

  5). In views/web2py_ajax.html replace this:

   try { jQuery(input.time).clockpick({
       starthour:0, endhour:23, showminutes:true, military:true
   }); } catch(e) {};

  ...with...

   try { jQuery(input.time).timeEntry({spinnerImage:
  {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
  timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
  new Date(0, 0, 0, 22, 00, 0)
   }); } catch(e) {};

  I included a couple of optional settings so you can see how they work
  in combination.

  It only takes a couple of minutes to set it up like this. Hope I
  didn't forget anything. :)

  -D




Re: [web2py] Re: keeping the data inserted in the sql form after submit.

2010-11-13 Thread Napoleon Moreno
Easy! thanks a lot!

On Sat, Nov 13, 2010 at 9:23 AM, villas villa...@gmail.com wrote:

 Hi Napoleon

 Yes, look up 'keepvalues' in this chapter of the book.
 http://www.web2py.com/book/default/chapter/07

 -D

 On Nov 13, 1:52 pm, Napoleon Moreno napoleo...@gmail.com wrote:
  Good day.
 
  Is it posible keep the data in the form AFTER the submit.
 
  It is show me a new form. I need the inserted data continue in the form.
 
  Is it posible?
 
  Thanks



Re: [web2py] Re: How to make a modal+ajax form manually?

2010-11-13 Thread Daniel Gonzalez
Thank you very much villas!

This can works to me, but in that documentation doesn't says anything
about javascript modal windows. 

Does somebody know how to make the jQuery modal windows without using
the plugin PluginMModal()? I will need to create it manually.

demetrio

El sáb, 13-11-2010 a las 05:15 -0800, villas escribió:
 Hi Demetrio
 
 Check out www.web2py.com/book chapter 13 and read about components and
 the LOAD function which may help.
 
 -D
 
 On Nov 13, 11:48 am, demetrio dgzabal...@gmail.com wrote:
  Hi everyone,
 
  i'm doing a desktop like iGoogle, with boxes containing information
  from different sources (it can be the same application, or other
  apps). So I need send my own forms (like available_boxes, modify
  content preferences and so)
 
  I saw that the modal plugin is old and now is located inside
  plugin_wiki, but I need to do something like that with my own forms.
 
  Is there any way to do it manually?
 
  Thanks in advance.




[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread Carlos
Hi all,

Can anybody please help with this?.

Thanks!,

   Carlos


On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 I'm getting the following error in my local installation with
 postgresql when using auth.define_tables(migrate=True):

 class 'psycopg2.ProgrammingError'(relation auth_user already
 exists)

 web2py™       Version 1.89.1 (2010-11-12 15:14:36)
 Python  Python 2.6.4: C:\Python26\python.exe

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 188, in restricted
     exec ccode in environment
   File C:/web2py/applications/test/models/model.py, line 38, in
 module
     auth.define_tables(migrate=True)
   File C:\web2py\gluon\tools.py, line 1163, in define_tables
     format='%(first_name)s %(last_name)s (%(id)s)')
   File C:\web2py\gluon\sql.py, line 1371, in define_table
     t._create(migrate=migrate, fake_migrate=fake_migrate)
   File C:\web2py\gluon\sql.py, line 1823, in _create
     self._db._execute(query)
   File C:\web2py\gluon\sql.py, line 1026, in lambda
     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 ProgrammingError: relation auth_user already exists

 Any ideas what could be wrong?.

 Thanks,

    Carlos


Re: [web2py] bug in the book or in the code? linkedin instruction

2010-11-13 Thread Michele Comitini
You can try with oauth10a_account.py  under
gluon/contrib/login_method, it uses standard OAuth 1.0a protocol.
See this example:

http://code.google.com/r/michelecomitini-facebookaccess/source/browse/#hg/applications/linkedInOauth

mic

2010/11/13 Kuba Kucharski kuba.kuchar...@gmail.com:
 Hi, long time no see, guys

 I did exact thing like in the book

 from gluon.contrib.login_methods.linkedin_account import LinkedInAccount
 auth.settings.login_form=LinkedInAccount(request,KEY,SECRET,RETURN_URL)
 (yeap I had inserted key etc, and yes, I haven't sent it in my ticket
 to all the public, I've obscured it;)

 I am getting 'module' object has no attribute 'LinkedIn'


 Traceback (most recent call last):
  File /home/www-data/web2py/gluon/restricted.py, line 188, in restricted
    exec ccode in environment
  File /home/www-data/web2py/applications/opennect/models/db.py,
 line 86, in module
    
 auth.settings.login_form=LinkedInAccount(request,ds8kktgqgQLHXxbAHew5owhRSHbGsdvek9tgfS28-XTGhi,WjhUsdTD4gq-efdsD59XcnVlIVAi_hHZd1CICfTqbdK3EiaTrUo,http://dev.xxx.com/;)
  File /home/www-data/web2py/gluon/contrib/login_methods/linkedin_account.py,
 line 33, in __init__
    self.api = linkedin.LinkedIn(key,secret,return_url)
 AttributeError: 'module' object has no attribute 'LinkedIn'


 I tried from application shell
 import linkedin
 api = linkedin.LinkedIn(..)

 and in console this part of the linkedin_account.py works

 am I missing smth?
 I've tested on 1.87.x and the newest stable
 python-linkedin is 1.5
 --
 Kuba



[web2py] Re: How to make a modal+ajax form manually?

2010-11-13 Thread villas
Hi Demetrio

You don't need to use plugin_wiki to use it.  There is a warning that
is 'may' be old,  but there's no harm in trying it  :)

1. Create a new test app from the Appadmin interface. (e.g. named
TestApp).

2. Download plugin from: 
http://www.web2py.com/plugins/static/web2py.plugin.mmodal.w2p

3. Install plugin.  Open TestApp in the Appadmin, and then go to the
bottom of the page where you can install plugins.

4. Using Appadmin again, open the view file 'default/index.html' and
paste into the file after the first line (which says: {{extend
'layout.html'}} ):

{{a=PluginMModal(title='Hello World',content='give this a
try!',close='close',width=70,height=70)}}
{{=a}}
{{=a.link(H1('SEE MODAL WINDOW'))}}

5. Open the TestApp in your browser and you should see the index.html
page by default.

6. Click on SEE MODAL WINDOW.

Maybe the plugin might be useful for you after all as a starting
point :)
Take a look at the page source to see what it is doing.

-D


On Nov 13, 3:03 pm, Daniel Gonzalez dgzabal...@gmail.com wrote:
 Thank you very much villas!

 This can works to me, but in that documentation doesn't says anything
 about javascript modal windows.

 Does somebody know how to make the jQuery modal windows without using
 the plugin PluginMModal()? I will need to create it manually.

 demetrio

 El sáb, 13-11-2010 a las 05:15 -0800, villas escribió:

  Hi Demetrio

  Check outwww.web2py.com/bookchapter 13 and read about components and
  the LOAD function which may help.

  -D

  On Nov 13, 11:48 am, demetrio dgzabal...@gmail.com wrote:
   Hi everyone,

   i'm doing a desktop like iGoogle, with boxes containing information
   from different sources (it can be the same application, or other
   apps). So I need send my own forms (like available_boxes, modify
   content preferences and so)

   I saw that the modal plugin is old and now is located inside
   plugin_wiki, but I need to do something like that with my own forms.

   Is there any way to do it manually?

   Thanks in advance.




[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread demetrio
I had the same problem, that code works fine. Thx dspiteself

On 12 nov, 22:23, dspiteself dspites...@gmail.com wrote:
 there was a problem loading my static files in the designer

 I would push it but our project uses git here is a patch.
 /***
 fix web2py bug when static path matches

 ex:
 filepath =/test/dojox
 path = /test/dojo

 passes '/'.join(file_path).startswith('/'.join(path))
 invalid index exception thrown by path.append(file_path[len(path)])
 len(path):2
 len(filepath):

 ***/

 diff --git a/src/applications/admin/views/default/design.html b/src/
 applications/admin/views/default/design.html
 index f50093e..afbc996 100644
 --- a/src/applications/admin/views/default/design.html
 +++ b/src/applications/admin/views/default/design.html
 @@ -203,8 +203,8 @@ for c in controllers: controller_functions
 +=[c[:-3]+'/%s.html'%x for x in functi
        items=file.split('/')
        file_path=items[:-1]
        filename=items[-1]
 -      while path!=file_path:
 -          if '/'.join(file_path).startswith('/'.join(path)):
 +      while path!=file_path:
 +          if len(file_path)= len(path) and all([ v==file_path[k] for
 k,v in enumerate(path)]):
                path.append(file_path[len(path)])
                thispath='static__'+'__'.join(path)
      }}

 On Nov 12, 9:22 am, mdipierro mdipie...@cs.depaul.edu wrote:

  Please give it a try and report any bug.

 1.89.1
  - new admin layout (thanks Branko Vukelic)
  - new admin search
  - new admin language selector (thanks Yair)
  - new Welcome app (thanks Martin Mulone)
  - beter wizard
  - admin support for DEMO_MODE=True
  - admin exposes GAE deployment button (always)
  - MENU support None links (thanks Michael Wolfe)
  - web2py.py -J for running cron (thanks Jonathan Lundell)
  - fixed ~db.table.id on GAE (thanks MicLee)
  - service.jsonrpc supports service.JsonRpcException (thanks Matt)
  - many small bug fixes.




Re: [web2py] Re: How to make a modal+ajax form manually?

2010-11-13 Thread Daniel Gonzalez
Thank you very much villas!

All of you guys are awesome. Everyone in this community :). This is why
I love web2py, an amazing framework, and a more amazing community!

I hope I can be helpful too some day in the near future :)

El sáb, 13-11-2010 a las 07:36 -0800, villas escribió:
 Hi Demetrio
 
 You don't need to use plugin_wiki to use it.  There is a warning that
 is 'may' be old,  but there's no harm in trying it  :)
 
 1. Create a new test app from the Appadmin interface. (e.g. named
 TestApp).
 
 2. Download plugin from: 
 http://www.web2py.com/plugins/static/web2py.plugin.mmodal.w2p
 
 3. Install plugin.  Open TestApp in the Appadmin, and then go to the
 bottom of the page where you can install plugins.
 
 4. Using Appadmin again, open the view file 'default/index.html' and
 paste into the file after the first line (which says: {{extend
 'layout.html'}} ):
 
 {{a=PluginMModal(title='Hello World',content='give this a
 try!',close='close',width=70,height=70)}}
 {{=a}}
 {{=a.link(H1('SEE MODAL WINDOW'))}}
 
 5. Open the TestApp in your browser and you should see the index.html
 page by default.
 
 6. Click on SEE MODAL WINDOW.
 
 Maybe the plugin might be useful for you after all as a starting
 point :)
 Take a look at the page source to see what it is doing.
 
 -D
 
 
 On Nov 13, 3:03 pm, Daniel Gonzalez dgzabal...@gmail.com wrote:
  Thank you very much villas!
 
  This can works to me, but in that documentation doesn't says anything
  about javascript modal windows.
 
  Does somebody know how to make the jQuery modal windows without using
  the plugin PluginMModal()? I will need to create it manually.
 
  demetrio
 
  El sáb, 13-11-2010 a las 05:15 -0800, villas escribió:
 
   Hi Demetrio
 
   Check outwww.web2py.com/bookchapter 13 and read about components and
   the LOAD function which may help.
 
   -D
 
   On Nov 13, 11:48 am, demetrio dgzabal...@gmail.com wrote:
Hi everyone,
 
i'm doing a desktop like iGoogle, with boxes containing information
from different sources (it can be the same application, or other
apps). So I need send my own forms (like available_boxes, modify
content preferences and so)
 
I saw that the modal plugin is old and now is located inside
plugin_wiki, but I need to do something like that with my own forms.
 
Is there any way to do it manually?
 
Thanks in advance.
 
 




[web2py] databases folder not created in shell

2010-11-13 Thread DenesL

When a new app is created in shell mode the databases folder is
missing, which causes it to fail with the following:

web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.89.1 (2010-11-12 15:14:36)
Database drivers available: SQLite3
Traceback (most recent call last):
  File C:\w2p\web2py_1.89.1_src\gluon\restricted.py, line 188, in
restricted
exec ccode in environment
  File applications\test\models/db.py, line 15, in module
db = DAL('sqlite://storage.sqlite')   # if not, use SQLite or
other DB
  File C:\w2p\web2py_1.89.1_src\gluon\sql.py, line 4051, in DAL
raise RuntimeError, %s (tried 5 times) % exception
RuntimeError: unable to open database file (tried 5 times)

As you can see this happens with the latest release (1.89.1) but it is
not a problem with this release since it also fails in 1.88.2 or even
1.83.1 as reported by Bruno in
http://groups.google.com/group/web2py/msg/df4e2ade0383f3f9

I am running from source in Windows XP but Bruno reported it using
Ubuntu.

Running it as web2py.py -P -S newapp
as suggested by mr.freeze in 
http://groups.google.com/group/web2py/msg/8d369683e24001ee
only masks the problem since the error does not occur but the
databases folder is still missing, at least for me.

Denes.


[web2py] Private message module

2010-11-13 Thread noPE
Does any module exist in web2py that I can use so that authenticated
users in my application might be able to send Private Messages to each
other.


[web2py] Re: Error when using new wizard

2010-11-13 Thread mdipierro
It is a file permission issue.

On Nov 13, 12:33 am, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 Centos 5.5, Apache 2 and mod_wsgi.

 I tried using the New simple application. I gave it a name och pressed
 create. I get unable to create application 'testing'.

 Kenneth

  What is your setup?  apache?mod_wsgi?

  On Nov 12, 5:48 pm, Kenneth Lundstr mkenneth.t.lundst...@gmail.com
  wrote:
      Can you check if this folder was created?
        /data/domains/web2py/applications/Boatintra

  No it was not created.

      if not it is a file permission issue. What os? was it a binary
  distribution of web2py?

  Linux, source. All files permissions apache:web2py. I tried to change
  file permissions of the applications directory to 777 but no luck.

  Kenneth

  On Nov 12, 5:30 pm, Kenneth Lundstr mkenneth.t.lundst...@gmail.com
  wrote:
  Just installed the newest version of web2py (1.89.1) and tested the
  wizard to create a new appl.
  I came to step 6 when I got a error.
  Version
  web2py Version 1.89.1 (2010-11-12 15:14:36)
  Python
  Traceback
  Traceback (most recent call last):
  File /data/domains/web2py/gluon/restricted.py, line 188, in restricted
  exec ccode in environment
  File /data/domains/web2py/applications/admin/controllers/wizard.py,
  line 571, in ?
  File /data/domains/web2py/gluon/globals.py, line 96, inlambda
  self._caller = lambda f: f()
  File /data/domains/web2py/applications/admin/controllers/wizard.py,
  line 200, in step6
  create(form.vars)
  File /data/domains/web2py/applications/admin/controllers/wizard.py,
  line 488, in create
  file=open(meta,'wb')
  IOError: [Errno 2] No such file or directory:
  '/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'
  What more info do you need to find the error?
  Kenneth




[web2py] Re: A quick Q on blocked urls by auth

2010-11-13 Thread mdipierro
should be in request.vars._next

On Nov 13, 2:40 am, rāma ranjeev...@gmail.com wrote:
 How do you get the initial url which initiated the redirect to a login
 screen. I need to build a dictionary for custom login errors based on
 these urls. Can this information be accessed from the login view?


[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread mdipierro
I agree with Villas. The larger the development the more the database
becomes the bottleneck and the framework irrelevant.

Massimo

On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
 Hi Jason

 I guess you have to define 'large deployment' first of all.  Number of
 records and size of DB? Number of concurrent users? Large data model
 or number of forms etc?  Number of servers -- or replication?  Global
 coverage?

 In principle I don't think there's any reason why Web2py would be
 worse than other frameworks.  Usually it is much better!  As an
 example,  I think deploying to the Google App Engine should be able to
 scale sufficiently for everything but extreme cases :)

 If you specify more about what you wish to achieve this group may be
 able to give more specific advice how best to organise your project.

 -D

 On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:

  I love web2py and it's the only framework i feel i am fully capable to do 
  or learn to do quickly.
  However, I remember see that this framework is intended for small to medium 
  sized deployments. Is this true? What is it that stops us from larger 
  deployment? Should i pickup django because i may need it?
  Regards,
  jb




[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread mdipierro
Corrupted database/*.table

did you delete them?

On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 I'm getting the following error in my local installation with
 postgresql when using auth.define_tables(migrate=True):

 class 'psycopg2.ProgrammingError'(relation auth_user already
 exists)

 web2py™       Version 1.89.1 (2010-11-12 15:14:36)
 Python  Python 2.6.4: C:\Python26\python.exe

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 188, in restricted
     exec ccode in environment
   File C:/web2py/applications/test/models/model.py, line 38, in
 module
     auth.define_tables(migrate=True)
   File C:\web2py\gluon\tools.py, line 1163, in define_tables
     format='%(first_name)s %(last_name)s (%(id)s)')
   File C:\web2py\gluon\sql.py, line 1371, in define_table
     t._create(migrate=migrate, fake_migrate=fake_migrate)
   File C:\web2py\gluon\sql.py, line 1823, in _create
     self._db._execute(query)
   File C:\web2py\gluon\sql.py, line 1026, in lambda
     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 ProgrammingError: relation auth_user already exists

 Any ideas what could be wrong?.

 Thanks,

    Carlos


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread mdipierro
Ok timeEntry it is. I will replace it today.

On Nov 13, 8:24 am, Nathan Freeze nat...@freezable.com wrote:
 This would be a good slice :)

 On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
  If you want to try it...

  1). Download files:
 http://keith-wood.name/timeEntry.html
  Optionally this:
 http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

  2). Add to views/layout.html
     {{response.files.append(URL(request.application,'static','css/
  jquery.timeentry.css'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.timeentry.js'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.mousewheel.min.js'))}}

  3). Make sure those 3 files above are copied into the folders under
  static dir.

  4). Copy spinnerDefault.png into static/images

  5). In views/web2py_ajax.html replace this:

   try { jQuery(input.time).clockpick({
       starthour:0, endhour:23, showminutes:true, military:true
   }); } catch(e) {};

  ...with...

   try { jQuery(input.time).timeEntry({spinnerImage:
  {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
  timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
  new Date(0, 0, 0, 22, 00, 0)
   }); } catch(e) {};

  I included a couple of optional settings so you can see how they work
  in combination.

  It only takes a couple of minutes to set it up like this. Hope I
  didn't forget anything. :)

  -D




Re: [web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Branko Vukelic
Oh, noes! This widget suffers from so many usability issues I can't
believe it still exists.

1. controls are microscopic
2. it's not obvious you can switch between fields by clicking on them
since fields are enclosed in a single box with no visible separators
3. you cannot jump to desired values (you must cycle through values)

The optimal control would:

1. use familiar mechanism for selecting values
2. enable jumping to desired values
3. separate the components

A set of drop-downs or text boxes will do just fine in satisfying the
above requirements. I'll write the widget for you if you want, as soon
as I'm done with e4s layout.

On Sat, Nov 13, 2010 at 5:55 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 Ok timeEntry it is. I will replace it today.

 On Nov 13, 8:24 am, Nathan Freeze nat...@freezable.com wrote:
 This would be a good slice :)

 On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
  If you want to try it...

  1). Download files:
 http://keith-wood.name/timeEntry.html
  Optionally this:
 http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

  2). Add to views/layout.html
     {{response.files.append(URL(request.application,'static','css/
  jquery.timeentry.css'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.timeentry.js'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.mousewheel.min.js'))}}

  3). Make sure those 3 files above are copied into the folders under
  static dir.

  4). Copy spinnerDefault.png into static/images

  5). In views/web2py_ajax.html replace this:

   try { jQuery(input.time).clockpick({
       starthour:0, endhour:23, showminutes:true, military:true
   }); } catch(e) {};

  ...with...

   try { jQuery(input.time).timeEntry({spinnerImage:
  {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
  timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
  new Date(0, 0, 0, 22, 00, 0)
   }); } catch(e) {};

  I included a couple of optional settings so you can see how they work
  in combination.

  It only takes a couple of minutes to set it up like this. Hope I
  didn't forget anything. :)

  -D





-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: PostgreSQL replication

2010-11-13 Thread ron_m
SymmetricDS looks like the best alternative so far for the application
I am working on. The application they developed for is a close match
to the kind of data sync I need. Thanks for the link to the article. I
will run a test implementation.

On Nov 11, 11:56 pm, shem p she...@gmail.com wrote:
 Maybe any of this would 
 help:http://www.haroonidrees.com/2009/04/open-sour.html

 On Nov 12, 2:07 pm, ron_m ron.mco...@gmail.com wrote:

  Thanks for the pointers from both of you, I appreciate that. It would
  be best to have multiple master but that will be very difficult.
  Bucardo has multiple master but only for 2 masters once you get into
  the docs for it. The MySQL scheme I mentioned used primary key
  skipping on autonumbers so if the pool of replicas could reach 10 the
  autonumber increment was set to 10 then each machine got an offset to
  start with. It looks like PostgreSQL can do this as well with the
  sequences but appears to be a DDL setting and not a DB server config
  setting. I am new to PostgreSQL so I may not have found that aspect
  yet. By being careful with the app design I think I can get it down to
  one master which is more manageable and avoid key conflicts.

  Ron

  On Nov 11, 1:00 pm, Michele Comitini michele.comit...@gmail.com
  wrote:

   There are some good news for postgresql 9.0:

  http://www.postgresql.org/docs/9.0/interactive/warm-standby.html

   some of those features above are possible  on 8.4 with some difficult
   configuration tricks, see wiki.postgresql.org.

   mic

   2010/11/11 mdipierro mdipie...@cs.depaul.edu:

Hi Ron,
I do not much about this topic. Will single master be enough?
You may want to look into these tools as well.

   http://www.slony.info/
   http://www.sistemasagiles.com.ar/trac/wiki/PyReplicaEn
   https://public.commandprompt.com/projects/replicator

On Nov 11, 1:51 pm, ron_m ron.mco...@gmail.com wrote:
Any of you have experience with Bucardo or pgpool-II as a replication
add-on?

Some background:
I switched from MySQL to PostgreSQL very cleanly using web2py as the
vehicle. Sort description to document the process: Made a copy of the
app, removed the content of the databases directory, added the
prerequisite components (database and driver) to the system, created
an empty DB, changed the connection string in the model, started MySQL
verison of app in shell mode and ran all the data out to one CSV file
and finally started the PostgreSQL version up in shell mode and did an
import of the same CSV file followed by a db.commit(). After all that
the application worked except for one group by orderby query
PostgreSQL didn't like which was easy to fix and the change worked in
MySQL as well. This was a database with 28 tables linked with lots of
relations.

My compliments to this great application server and infrastructure
surrounding it. Of the available migration tools I found out on the
net, most failed to work and would require extensive manual editing.

The application will be installed in 10 locations scattered all over
Alaska. All the locations are connected by a WAN with IPSEC to form a
VPN so it looks like it is all in the same room except for network
performance.

Each location must survive a network outage and continue to work, The
weather can be a problem up there.

Any data tables that change rapidly are to remain local to each
location.

About 2/3 of the database is configuration information which changes
very slowly. One table if this were running would have changed once in
5 years. Some tables change more often as employees come and go or
equipment is added to a location. Config changes can be delayed by
downed connections so eventual consistency is okay.

I need something automatic since the people using the system are not
technical and cannot be depended on to to a task.

By restricting the application I could get the updates to one database
instance but then there is a time delay until the local copy is in
sync.

I looked at MySQL Replication as described in the Linux Journal
article July 2010 where they do a ring which has each server to the
left in the ring is master to the slave to the right but I could see
with intermittent networks down due to bad weather this could be a
headache waiting to happen. Also the MySQL licensing has a degree of
uncertainty to it so I would rather stay away.

I am aware of PostgreSQL-R which is in beta, The uuid and timestamps
available in web2py model help but then needs to be driven by cron in
a batch oriented update.

Sometimes I look at the NoSQL databases like CouchDB or MongoDB but
then the foreign keys from the rapidly changing data is a problem. I
could bridge it using equipment hostname or something like that but
still I would rather stay inside one database.

Hard problem to solve 

Re: [web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread Thadeus Burgess
What is large deployment?

Is it a large codebase that you must manage for an internal dashbaord, or
just alot of users/database io that needs to scale out for worldwide access?

If its the first case, web2py can get really complicated in dealing with
lots of models and difficult to manage in an efficient manner. The larger
your codebase the messier web2py apps will become. In the end, this would
ultimately be up to the preferences of you and your team and what your
willing to put up with.

In the second case, framework hardly matters at that point. Disqus uses
django, facebook uses php, reddit uses pylons, myspace uses coldfusion,
microsoft uses asp, oracle uses java. Its always the database that becomes
an issue regardless of programming language or web framework.

--
Thadeus




On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu wrote:

 I agree with Villas. The larger the development the more the database
 becomes the bottleneck and the framework irrelevant.

 Massimo

 On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
  Hi Jason
 
  I guess you have to define 'large deployment' first of all.  Number of
  records and size of DB? Number of concurrent users? Large data model
  or number of forms etc?  Number of servers -- or replication?  Global
  coverage?
 
  In principle I don't think there's any reason why Web2py would be
  worse than other frameworks.  Usually it is much better!  As an
  example,  I think deploying to the Google App Engine should be able to
  scale sufficiently for everything but extreme cases :)
 
  If you specify more about what you wish to achieve this group may be
  able to give more specific advice how best to organise your project.
 
  -D
 
  On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:
 
   I love web2py and it's the only framework i feel i am fully capable to
 do or learn to do quickly.
   However, I remember see that this framework is intended for small to
 medium sized deployments. Is this true? What is it that stops us from larger
 deployment? Should i pickup django because i may need it?
   Regards,
   jb
 
 



[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread Carlos
Hi Massimo,

I did not delete any *.table files located at:

   .\web2py\applications\(app)\databases\

Should I try deleting them?.

How can this get corrupted?.

What else should I try?.

Thanks,

   Carlos


On Nov 13, 10:54 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Corrupted database/*.table

 did you delete them?

 On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:







  Hi,

  I'm getting the following error in my local installation with
  postgresql when using auth.define_tables(migrate=True):

  class 'psycopg2.ProgrammingError'(relation auth_user already
  exists)

  web2py™       Version 1.89.1 (2010-11-12 15:14:36)
  Python  Python 2.6.4: C:\Python26\python.exe

  Traceback (most recent call last):
    File C:\web2py\gluon\restricted.py, line 188, in restricted
      exec ccode in environment
    File C:/web2py/applications/test/models/model.py, line 38, in
  module
      auth.define_tables(migrate=True)
    File C:\web2py\gluon\tools.py, line 1163, in define_tables
      format='%(first_name)s %(last_name)s (%(id)s)')
    File C:\web2py\gluon\sql.py, line 1371, in define_table
      t._create(migrate=migrate, fake_migrate=fake_migrate)
    File C:\web2py\gluon\sql.py, line 1823, in _create
      self._db._execute(query)
    File C:\web2py\gluon\sql.py, line 1026, in lambda
      self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
  ProgrammingError: relation auth_user already exists

  Any ideas what could be wrong?.

  Thanks,

     Carlos


[web2py] MSSQL Select statements

2010-11-13 Thread Crim
alright so i got a connection between my MSSql server any web2py. that
has been all sorted out but now im having issues with how to select a
tuple from web2py

in web2py i have this code:

if db(db.User.Email == s).select():
 print success

which should check if the users email is in the db

but when i write a select statement for my server its like so:

SELECT TOP 1000 [Email]
  ,[Name]
  ,[PIN]
  ,[Phone]
  ,[Address]
  ,[Mileage]
  ,[MealPref]
  FROM [master].[dbo].[User]

notice the dbo? do i have to include this in my select .. (have tried
and it still gives errors)

the error snapshot:
type 'exceptions.KeyError'('user')

thanks,
Crim


[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread Carlos
Hi,

Maybe the problem is that, for the same app, I started with sqlite and
then switched to progresql?.

Anyways, I just dropped the database in progresql and deleted all
files in /databases/, and it seems to be working ok now (so far).

Can you please confirm the above (switching from sqlite to progresql)
caused my problems?.

I want to know, in order to confirm I will not have these problems in
a production environment.

Thanks again,

   Carlos


On Nov 13, 12:02 pm, Carlos carlosgali...@gmail.com wrote:
 Hi Massimo,

 I did not delete any *.table files located at:

    .\web2py\applications\(app)\databases\

 Should I try deleting them?.

 How can this get corrupted?.

 What else should I try?.

 Thanks,

    Carlos

 On Nov 13, 10:54 am, mdipierro mdipie...@cs.depaul.edu wrote:







  Corrupted database/*.table

  did you delete them?

  On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:

   Hi,

   I'm getting the following error in my local installation with
   postgresql when using auth.define_tables(migrate=True):

   class 'psycopg2.ProgrammingError'(relation auth_user already
   exists)

   web2py™       Version 1.89.1 (2010-11-12 15:14:36)
   Python  Python 2.6.4: C:\Python26\python.exe

   Traceback (most recent call last):
     File C:\web2py\gluon\restricted.py, line 188, in restricted
       exec ccode in environment
     File C:/web2py/applications/test/models/model.py, line 38, in
   module
       auth.define_tables(migrate=True)
     File C:\web2py\gluon\tools.py, line 1163, in define_tables
       format='%(first_name)s %(last_name)s (%(id)s)')
     File C:\web2py\gluon\sql.py, line 1371, in define_table
       t._create(migrate=migrate, fake_migrate=fake_migrate)
     File C:\web2py\gluon\sql.py, line 1823, in _create
       self._db._execute(query)
     File C:\web2py\gluon\sql.py, line 1026, in lambda
       self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
   ProgrammingError: relation auth_user already exists

   Any ideas what could be wrong?.

   Thanks,

      Carlos


[web2py] Re: MSSQL Select statements

2010-11-13 Thread mdipierro
You cannot this in web2py. perhaps you can create a database view.

On Nov 13, 12:11 pm, Crim crimsonang...@gmail.com wrote:
 alright so i got a connection between my MSSql server any web2py. that
 has been all sorted out but now im having issues with how to select a
 tuple from web2py

 in web2py i have this code:

 if db(db.User.Email == s).select():
      print success

 which should check if the users email is in the db

 but when i write a select statement for my server its like so:

 SELECT TOP 1000 [Email]
       ,[Name]
       ,[PIN]
       ,[Phone]
       ,[Address]
       ,[Mileage]
       ,[MealPref]
   FROM [master].[dbo].[User]

 notice the dbo? do i have to include this in my select .. (have tried
 and it still gives errors)

 the error snapshot:
 type 'exceptions.KeyError'('user')

 thanks,
 Crim


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread mdipierro
talking about timeentry or clockpicker?

On Nov 13, 11:06 am, Branko Vukelic bg.bra...@gmail.com wrote:
 Oh, noes! This widget suffers from so many usability issues I can't
 believe it still exists.

 1. controls are microscopic
 2. it's not obvious you can switch between fields by clicking on them
 since fields are enclosed in a single box with no visible separators
 3. you cannot jump to desired values (you must cycle through values)

 The optimal control would:

 1. use familiar mechanism for selecting values
 2. enable jumping to desired values
 3. separate the components

 A set of drop-downs or text boxes will do just fine in satisfying the
 above requirements. I'll write the widget for you if you want, as soon
 as I'm done with e4s layout.



 On Sat, Nov 13, 2010 at 5:55 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  Ok timeEntry it is. I will replace it today.

  On Nov 13, 8:24 am, Nathan Freeze nat...@freezable.com wrote:
  This would be a good slice :)

  On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
   If you want to try it...

   1). Download files:
  http://keith-wood.name/timeEntry.html
   Optionally this:
  http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

   2). Add to views/layout.html
      {{response.files.append(URL(request.application,'static','css/
   jquery.timeentry.css'))}}
      {{response.files.append(URL(request.application,'static','js/
   jquery.timeentry.js'))}}
      {{response.files.append(URL(request.application,'static','js/
   jquery.mousewheel.min.js'))}}

   3). Make sure those 3 files above are copied into the folders under
   static dir.

   4). Copy spinnerDefault.png into static/images

   5). In views/web2py_ajax.html replace this:

    try { jQuery(input.time).clockpick({
        starthour:0, endhour:23, showminutes:true, military:true
    }); } catch(e) {};

   ...with...

    try { jQuery(input.time).timeEntry({spinnerImage:
   {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
   timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), 
   maxTime:
   new Date(0, 0, 0, 22, 00, 0)
    }); } catch(e) {};

   I included a couple of optional settings so you can see how they work
   in combination.

   It only takes a couple of minutes to set it up like this. Hope I
   didn't forget anything. :)

   -D

 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog:http://www.brankovukelic.com/
 Check out my portfolio:http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca:http://identi.ca/foxbunny

 Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Branko Vukelic
On Sat, Nov 13, 2010 at 7:28 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 talking about timeentry or clockpicker?

Timeentry


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread mdipierro


On Nov 13, 12:23 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 Maybe the problem is that, for the same app, I started with sqlite and
 then switched to progresql?.

 Anyways, I just dropped the database in progresql and deleted all
 files in /databases/, and it seems to be working ok now (so far).

 Can you please confirm the above (switching from sqlite to progresql)
 caused my problems?.

No. This should not be a problem unless you deleted the sqlite
database and the .table AFTER the postgresql db was created.


 I want to know, in order to confirm I will not have these problems in
 a production environment.

 Thanks again,

    Carlos

 On Nov 13, 12:02 pm, Carlos carlosgali...@gmail.com wrote:

  Hi Massimo,

  I did not delete any *.table files located at:

     .\web2py\applications\(app)\databases\

  Should I try deleting them?.

  How can this get corrupted?.

  What else should I try?.

  Thanks,

     Carlos

  On Nov 13, 10:54 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Corrupted database/*.table

   did you delete them?

   On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:

Hi,

I'm getting the following error in my local installation with
postgresql when using auth.define_tables(migrate=True):

class 'psycopg2.ProgrammingError'(relation auth_user already
exists)

web2py™       Version 1.89.1 (2010-11-12 15:14:36)
Python  Python 2.6.4: C:\Python26\python.exe

Traceback (most recent call last):
  File C:\web2py\gluon\restricted.py, line 188, in restricted
    exec ccode in environment
  File C:/web2py/applications/test/models/model.py, line 38, in
module
    auth.define_tables(migrate=True)
  File C:\web2py\gluon\tools.py, line 1163, in define_tables
    format='%(first_name)s %(last_name)s (%(id)s)')
  File C:\web2py\gluon\sql.py, line 1371, in define_table
    t._create(migrate=migrate, fake_migrate=fake_migrate)
  File C:\web2py\gluon\sql.py, line 1823, in _create
    self._db._execute(query)
  File C:\web2py\gluon\sql.py, line 1026, in lambda
    self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
ProgrammingError: relation auth_user already exists

Any ideas what could be wrong?.

Thanks,

   Carlos




[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)

2010-11-13 Thread Carlos
Hi Massimo,

I did not delete anything when this problem appeared, I just switched
from sqlite to postresql in the DAL.

Should I worry about this problem appearing again (in my local machine
or in a production environment)?.

Should I test anything else?.

Thanks,

   Carlos


On Nov 13, 12:30 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 On Nov 13, 12:23 pm, Carlos carlosgali...@gmail.com wrote:

  Hi,

  Maybe the problem is that, for the same app, I started with sqlite and
  then switched to progresql?.

  Anyways, I just dropped the database in progresql and deleted all
  files in /databases/, and it seems to be working ok now (so far).

  Can you please confirm the above (switching from sqlite to progresql)
  caused my problems?.

 No. This should not be a problem unless you deleted the sqlite
 database and the .table AFTER the postgresql db was created.









  I want to know, in order to confirm I will not have these problems in
  a production environment.

  Thanks again,

     Carlos

  On Nov 13, 12:02 pm, Carlos carlosgali...@gmail.com wrote:

   Hi Massimo,

   I did not delete any *.table files located at:

      .\web2py\applications\(app)\databases\

   Should I try deleting them?.

   How can this get corrupted?.

   What else should I try?.

   Thanks,

      Carlos

   On Nov 13, 10:54 am, mdipierro mdipie...@cs.depaul.edu wrote:

Corrupted database/*.table

did you delete them?

On Nov 12, 3:45 pm, Carlos carlosgali...@gmail.com wrote:

 Hi,

 I'm getting the following error in my local installation with
 postgresql when using auth.define_tables(migrate=True):

 class 'psycopg2.ProgrammingError'(relation auth_user already
 exists)

 web2py™       Version 1.89.1 (2010-11-12 15:14:36)
 Python  Python 2.6.4: C:\Python26\python.exe

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 188, in restricted
     exec ccode in environment
   File C:/web2py/applications/test/models/model.py, line 38, in
 module
     auth.define_tables(migrate=True)
   File C:\web2py\gluon\tools.py, line 1163, in define_tables
     format='%(first_name)s %(last_name)s (%(id)s)')
   File C:\web2py\gluon\sql.py, line 1371, in define_table
     t._create(migrate=migrate, fake_migrate=fake_migrate)
   File C:\web2py\gluon\sql.py, line 1823, in _create
     self._db._execute(query)
   File C:\web2py\gluon\sql.py, line 1026, in lambda
     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 ProgrammingError: relation auth_user already exists

 Any ideas what could be wrong?.

 Thanks,

    Carlos


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
what cant i use? the web2py statement?

On Nov 13, 12:26 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 You cannot this in web2py. perhaps you can create a database view.

 On Nov 13, 12:11 pm, Crim crimsonang...@gmail.com wrote:







  alright so i got a connection between my MSSql server any web2py. that
  has been all sorted out but now im having issues with how to select a
  tuple from web2py

  in web2py i have this code:

  if db(db.User.Email == s).select():
       print success

  which should check if the users email is in the db

  but when i write a select statement for my server its like so:

  SELECT TOP 1000 [Email]
        ,[Name]
        ,[PIN]
        ,[Phone]
        ,[Address]
        ,[Mileage]
        ,[MealPref]
    FROM [master].[dbo].[User]

  notice the dbo? do i have to include this in my select .. (have tried
  and it still gives errors)

  the error snapshot:
  type 'exceptions.KeyError'('user')

  thanks,
  Crim


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread villas
On Nov 13, 5:06 pm, Branko Vukelic bg.bra...@gmail.com wrote:
 Oh, noes! This widget suffers from so many usability issues I can't
 believe it still exists.

Hi Branko

I am not saying it is necessarily the best,  but for me it is better
than clockpick.

It seems that hardly anyone is using just a Time widget.  The Date and
Datetime are both served by the other widget.  The version of
Clockpick in Web2py was always seriously flawed and it seems to me
that I was the only one that noticed!  So before criticising its
possible replacement,  please ask yourself,  did you ever use
it?  :)

With TimeEntry, once I found that you navigate the control just by
using the arrow keys,  I was delighted.  That makes it much more
usable, not less.  If you set the minute interval to 30 mins then,
even with the cursor just in the mins,  I can cycle thru all the hours
in the day within about 2 secs!  I don't need the mouse any more!

The criticism of the optional mouse click control being small is not
totally fair because you can use a bigger control if you want.  And,
if you really want to use the mouse,  use the scroll wheel,  it's
great.

If anyone finds something better,  please recommend it.  In the
meantime Clockpick is broken so what do we do while everyone goes off
programming the perfect widget which I question they will be using
themselves anyway!

Best regards,
-D


[web2py] Re: MSSQL Select statements

2010-11-13 Thread mdipierro
There is no webpy API to generate

FROM [master].[dbo].[User]

only

FROM [User]

On Nov 13, 12:45 pm, Crim crimsonang...@gmail.com wrote:
 what cant i use? the web2py statement?

 On Nov 13, 12:26 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  You cannot this in web2py. perhaps you can create a database view.

  On Nov 13, 12:11 pm, Crim crimsonang...@gmail.com wrote:

   alright so i got a connection between my MSSql server any web2py. that
   has been all sorted out but now im having issues with how to select a
   tuple from web2py

   in web2py i have this code:

   if db(db.User.Email == s).select():
        print success

   which should check if the users email is in the db

   but when i write a select statement for my server its like so:

   SELECT TOP 1000 [Email]
         ,[Name]
         ,[PIN]
         ,[Phone]
         ,[Address]
         ,[Mileage]
         ,[MealPref]
     FROM [master].[dbo].[User]

   notice the dbo? do i have to include this in my select .. (have tried
   and it still gives errors)

   the error snapshot:
   type 'exceptions.KeyError'('user')

   thanks,
   Crim




[web2py] Re: Crud.select

2010-11-13 Thread yamandu
crud.select() is not yet very usable.
I pesonaly wished it support:
-any query or rows (just like SQLTABLE)
-pagination
-it could be ajaxable
Support the first two would be great for everyday use, I guess.

I tried webgrid, it´s great but does not work in my hosting because of
python version 2.4.
I now use plugin jqgrid, but it´s too limited. I plan to adapt it
better when have more time.

On Nov 13, 4:37 am, andrej burja andrej.bu...@gmail.com wrote:
 maby it should be like WebGrid :)

 On Nov 13, 7:14 am, mdipierro mdipie...@cs.depaul.edu wrote:

  Probably yes. I am not happy with crud.select. I think it should do
  pagination for example too and have sortable columns and perhaps have
  a an option to include crud.select().

  Massimo

  On Nov 12, 10:47 pm, mr.freeze nat...@freezable.com wrote:

   I know. I'm asking if it should.  Would you take a patch?

   On Nov 12, 10:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:

No it does not.

On Nov 12, 8:41 pm, mr.freeze nat...@freezable.com wrote:

 Should Crud.select honor record level auth permissions when returning
 records? Right now it only filters by table.




[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Anthony
I agree. If you go to the Spinners tab and check Expand, things
improve somewhat (particularly the explicit version, with +, -,
and NOW), but still a hassle that you have to cycle through all the
numbers (or manually type).

Anthony

On Nov 13, 12:06 pm, Branko Vukelic bg.bra...@gmail.com wrote:
 Oh, noes! This widget suffers from so many usability issues I can't
 believe it still exists.

 1. controls are microscopic
 2. it's not obvious you can switch between fields by clicking on them
 since fields are enclosed in a single box with no visible separators
 3. you cannot jump to desired values (you must cycle through values)

 The optimal control would:

 1. use familiar mechanism for selecting values
 2. enable jumping to desired values
 3. separate the components

 A set of drop-downs or text boxes will do just fine in satisfying the
 above requirements. I'll write the widget for you if you want, as soon
 as I'm done with e4s layout.





 On Sat, Nov 13, 2010 at 5:55 PM, mdipierro mdipie...@cs.depaul.edu wrote:
  Ok timeEntry it is. I will replace it today.

  On Nov 13, 8:24 am, Nathan Freeze nat...@freezable.com wrote:
  This would be a good slice :)

  On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
   If you want to try it...

   1). Download files:
  http://keith-wood.name/timeEntry.html
   Optionally this:
  http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

   2). Add to views/layout.html
      {{response.files.append(URL(request.application,'static','css/
   jquery.timeentry.css'))}}
      {{response.files.append(URL(request.application,'static','js/
   jquery.timeentry.js'))}}
      {{response.files.append(URL(request.application,'static','js/
   jquery.mousewheel.min.js'))}}

   3). Make sure those 3 files above are copied into the folders under
   static dir.

   4). Copy spinnerDefault.png into static/images

   5). In views/web2py_ajax.html replace this:

    try { jQuery(input.time).clockpick({
        starthour:0, endhour:23, showminutes:true, military:true
    }); } catch(e) {};

   ...with...

    try { jQuery(input.time).timeEntry({spinnerImage:
   {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
   timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), 
   maxTime:
   new Date(0, 0, 0, 22, 00, 0)
    }); } catch(e) {};

   I included a couple of optional settings so you can see how they work
   in combination.

   It only takes a couple of minutes to set it up like this. Hope I
   didn't forget anything. :)

   -D

 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog:http://www.brankovukelic.com/
 Check out my portfolio:http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca:http://identi.ca/foxbunny

 Gimp Brushmakers Guildhttp://bit.ly/gbg-group- Hide quoted text -

 - Show quoted text -


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
im not using web2py to do the second select statement the one FROM
[master].[dbo].[User]

just the:
if db(db.User.Email == s).select():
 print success

i connected to my db and want to select the table user and the column
email


On Nov 13, 1:05 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 There is no webpy API to generate

 FROM [master].[dbo].[User]

 only

 FROM [User]

 On Nov 13, 12:45 pm, Crim crimsonang...@gmail.com wrote:







  what cant i use? the web2py statement?

  On Nov 13, 12:26 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   You cannot this in web2py. perhaps you can create a database view.

   On Nov 13, 12:11 pm, Crim crimsonang...@gmail.com wrote:

alright so i got a connection between my MSSql server any web2py. that
has been all sorted out but now im having issues with how to select a
tuple from web2py

in web2py i have this code:

if db(db.User.Email == s).select():
     print success

which should check if the users email is in the db

but when i write a select statement for my server its like so:

SELECT TOP 1000 [Email]
      ,[Name]
      ,[PIN]
      ,[Phone]
      ,[Address]
      ,[Mileage]
      ,[MealPref]
  FROM [master].[dbo].[User]

notice the dbo? do i have to include this in my select .. (have tried
and it still gives errors)

the error snapshot:
type 'exceptions.KeyError'('user')

thanks,
Crim


[web2py] Re: web2py 1.89.1 is OUT... update?

2010-11-13 Thread Brian M
Alex, I too am seeing that .load files are not being saved - add
Chrome on windows 7 to the list.

Firebug shows an error :
area is not defined
  var data = area.textarea.value

I suspect this is due to the regular editor not being defined (it is
just a plain textarea instead of the usual editor with syntax
highlighting, etc).

Massimo, I was able to fix this by editing admin/controllers/
default.py and adding an extra check to edit() so that .load files
would be considered html.  (Of course this still doesn't fix the
general problem of the javascript adit_area_full.js editor apparently
not playing nice with the ajax save for filetypes of text which is
the default)

def edit():
 File edit handler 
# Load json only if it is ajax edited...

filename = '/'.join(request.args)

# Try to discover the file type
if filename[-3:] == '.py':
filetype = 'python'
elif filename[-5:] == '.html':
filetype = 'html'
elif filename[-5:] == '.load': #-added so can edit 
save .load components
filetype = 'html'
elif filename[-4:] == '.css':
filetype = 'css'
elif filename[-3:] == '.js':
filetype = 'js'
else:
filetype = 'text'

~Brian

On Nov 12, 10:55 pm, Alex yue.a...@gmail.com wrote:
 Maybe a bug?

 When I create a .LOAD component, the save doesn't seem to work in IE
 or Firefox.

 On Nov 12, 10:44 pm, mdipierro mdipie...@cs.depaul.edu wrote:







  The fact is after you upgrade you get the new admin which uses a new
  API function. Unless you restart the server that API function is not
  available. This is a one time event since we never made such a big
  change in admin.

  On Nov 12, 7:26 pm, Anthony abasta...@gmail.com wrote:

   I had the same exact experience on Windows (in IE). Here's the
   traceback I got:

   Traceback (most recent call last):
     File C:\web2py\gluon\restricted.py, line 188, in restricted
       exec ccode in environment
     File C:\web2py\applications\admin/views\default/site.html, line
   182, in module
   AttributeError: 'translator' object has no attribute
   'get_possible_languages'

   Referring to:

     for language in T.get_possible_languages():

   Like Andrew, everything was fine after restarting web2py.

   Anthony

   On Nov 12, 7:20 pm, Andrew Thompson andre...@aktzero.com wrote:

On 11/12/2010 4:58 PM, mdipierro wrote: ps. may not work on windows

I doubt this is what you meant, but I seem to have hit a snag with the
upgrade.

web2py is running on ubuntu, but I'm managing it from chrome on win7.
After upgrading, the redirect back failed. Attempting to reload the
admin page gave me more failures.

If anyone wants to glance over the error files:

   http://aktzero.com/static/scratch/___127.0.0.1.2010-11-12.19-03-0..

Restarting the web2py process cleared it up, and it seems to be ok. I've
got the new admin interface, and my small handfull of sites are still
running.

--
Andrew Thompsonhttp://aktzero.com/-Hide quoted text -

  - Show quoted text -


[web2py] provide a development flag for applications II

2010-11-13 Thread pierreth
Massimo wrote:
Date: Thu, 29 Jan 2009 09:47:25 -0800 (PST)
Subject: Re: provide a development flag for applications

OK let's just use WEB2PY_MODE than and it will appear in

request.env.web2py_mode

Notice we aready have

request.env.web2py_path
request.env.web2py_version

Massimo

-

Yes, I would need it. It is still not there.




Re: [web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Branko Vukelic
On Sat, Nov 13, 2010 at 8:36 PM, villas villa...@gmail.com wrote:
 Hi Anthony

 Please bear in mind that anyone doing serious form filling should not
 have to use a mouse at all.  Use the arrow keys instead - it flies.

Should not, but they do. People should use Ctrl+V for paste (or
Shift+Ins), but they don't. You'd think that even the toolbar paste
icon would be quick enough, but they right-click and look for the
paste item which _never_ appear at the same place.

Us geeks have more than once made completely incorrect assumptions
about what people actually do. And they do unimaginably inefficient
things. Hell, if they did what I think is best, they'd be using
terminals for day-to-day file management, and write scripts to help
with those tasks. My impression in working with people who use office
type of apps is that they do indeed keep one hand on the mouse (not
literally, obviously). On more than one occasion, I've gotten explicit
requests to use drop-downs as time picker.



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Crud.select

2010-11-13 Thread mdipierro
{{=plugin_wiki('jqgrid',table)}}

already does ajax search, pagination, etc. crud.select should be able
to do some of these without ajax.

On Nov 13, 1:08 pm, yamandu yamandu.co...@gmail.com wrote:
 crud.select() is not yet very usable.
 I pesonaly wished it support:
 -any query or rows (just like SQLTABLE)
 -pagination
 -it could be ajaxable
 Support the first two would be great for everyday use, I guess.

 I tried webgrid, it´s great but does not work in my hosting because of
 python version 2.4.
 I now use plugin jqgrid, but it´s too limited. I plan to adapt it
 better when have more time.

 On Nov 13, 4:37 am, andrej burja andrej.bu...@gmail.com wrote:

  maby it should be like WebGrid :)

  On Nov 13, 7:14 am, mdipierro mdipie...@cs.depaul.edu wrote:

   Probably yes. I am not happy with crud.select. I think it should do
   pagination for example too and have sortable columns and perhaps have
   a an option to include crud.select().

   Massimo

   On Nov 12, 10:47 pm, mr.freeze nat...@freezable.com wrote:

I know. I'm asking if it should.  Would you take a patch?

On Nov 12, 10:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 No it does not.

 On Nov 12, 8:41 pm, mr.freeze nat...@freezable.com wrote:

  Should Crud.select honor record level auth permissions when 
  returning
  records? Right now it only filters by table.




[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
thanks for the in-depth reply ^ ^

im using existing tables and i master and another one stuff setup to
do the same thing but this is a school project so im not to picky at
the moment xD but thanks for the info for future use.


Can i do the db(db.user.email == s).select()  if i dont instantiate it
in web2py? do i still have to define it? Considering the tables exist
in the MSSql db?


On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:
 uhm  are you using existing tables or you are using web2py to
 create them ??

 dbo shouldn't affect at all the query, but a few hints nonetheless :

 master is a really nasty place to create tables  master db
 should be left untouched  in web2py you define a database when you
 istantiate db object, and all the query done on that db won't be able
 to see other databases

 that stated, if you have your connection string as
 mssql://username:passw...@localhost/master

 the query select * from [master].[dbo].[User] where [master].[dbo].
 [User]=s should be accomplished doing:

 db.define_table('user',
                 .
                 Field('email', 'string'),
                 .
                 )

 and db(db.user.email == s).select()

 anyway, I'm not sure (I don't have MSSQL installed to try out, but I
 can reply you on monday at work) that there are a few places where
 this implementation could not work:

 - web2py creates tables and fields with lowercase letters, so User
 get selectable only if database is set to be case insensitive
 - dbo stands for dbowner and it represent the schema which the
 object (in this case, a table) belongs. if your user has not the
 db_owner role on the db you won't be able to see it

 A few words also on this. Having objects beloging to different schemas
 under the same database it's definitely an option, but web2py
 (actually the library it uses, and many others like that) can't
 choose different schemas... they simply ignore it and the database
 defaults to whatever the default is for the user querying the database
 itself.
 You can have different schemas to separate between permissions on
 different objects in the same database, but to avoid headaches it's
 always better to create a separate user that owns a single database
 and put every data inside it.

 If the user in the connection string is db_owner of the database,
 select * from dbo.table is perfectly equivalent to select * from
 table

 If you have any other question please ask, I'll be glad to test it out
 on Monday


[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread mdipierro
We are considering making this even easier.
Two non-exclusive proposals on the table are:
1) make conditional models that are executed only for some controllers
2) promote the global objects (request,session,response,T,cache) to be
thread local (as in Flask) so that they can be imported by modules and
they do not have to be passed around. (Auth,Crud,Service could also be
written).

The problem is that we do not know if this will affect performance and
it may potentially break something.
We'll keep experimenting.

Massimo


On Nov 13, 1:48 pm, b00m_chef r...@devshell.org wrote:
 I disagree that web2py would become messy wrt the code-base. The
 solution I found was to simply put all my actual logic code in
 modules, then, I simply call up the specific object method in the
 controller function linked to the particular html file (view). I
 therefore don't keep any code in the Controller except object method
 calls to the module where the actual code resides. Within the module
 file, I can organize my data anyway I want.

 Django is no more organized, and no less organized.

 Most important thing to remember is that when you get to a size that
 web2py is no longer suitable, you probably have enough funding to pay
 a team of coders to write your app in pylons from scratch. Web2py can
 get you to that point though.

 On Nov 13, 9:48 am, Thadeus Burgess thade...@thadeusb.com wrote:

  What is large deployment?

  Is it a large codebase that you must manage for an internal dashbaord, or
  just alot of users/database io that needs to scale out for worldwide access?

  If its the first case, web2py can get really complicated in dealing with
  lots of models and difficult to manage in an efficient manner. The larger
  your codebase the messier web2py apps will become. In the end, this would
  ultimately be up to the preferences of you and your team and what your
  willing to put up with.

  In the second case, framework hardly matters at that point. Disqus uses
  django, facebook uses php, reddit uses pylons, myspace uses coldfusion,
  microsoft uses asp, oracle uses java. Its always the database that becomes
  an issue regardless of programming language or web framework.

  --
  Thadeus

  On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu wrote:
   I agree with Villas. The larger the development the more the database
   becomes the bottleneck and the framework irrelevant.

   Massimo

   On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
Hi Jason

I guess you have to define 'large deployment' first of all.  Number of
records and size of DB? Number of concurrent users? Large data model
or number of forms etc?  Number of servers -- or replication?  Global
coverage?

In principle I don't think there's any reason why Web2py would be
worse than other frameworks.  Usually it is much better!  As an
example,  I think deploying to the Google App Engine should be able to
scale sufficiently for everything but extreme cases :)

If you specify more about what you wish to achieve this group may be
able to give more specific advice how best to organise your project.

-D

On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:

 I love web2py and it's the only framework i feel i am fully capable to
   do or learn to do quickly.
 However, I remember see that this framework is intended for small to
   medium sized deployments. Is this true? What is it that stops us from 
   larger
   deployment? Should i pickup django because i may need it?
 Regards,
 jb




[web2py] Re: MSSQL Select statements

2010-11-13 Thread mdipierro
web2py DAL only sees tables that are defined via the DAL. For raw sql
you can do db.executesql()

On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:
 thanks for the in-depth reply ^ ^

 im using existing tables and i master and another one stuff setup to
 do the same thing but this is a school project so im not to picky at
 the moment xD but thanks for the info for future use.

 Can i do the db(db.user.email == s).select()  if i dont instantiate it
 in web2py? do i still have to define it? Considering the tables exist
 in the MSSql db?

 On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

  uhm  are you using existing tables or you are using web2py to
  create them ??

  dbo shouldn't affect at all the query, but a few hints nonetheless :

  master is a really nasty place to create tables  master db
  should be left untouched  in web2py you define a database when you
  istantiate db object, and all the query done on that db won't be able
  to see other databases

  that stated, if you have your connection string as
  mssql://username:passw...@localhost/master

  the query select * from [master].[dbo].[User] where [master].[dbo].
  [User]=s should be accomplished doing:

  db.define_table('user',
                  .
                  Field('email', 'string'),
                  .
                  )

  and db(db.user.email == s).select()

  anyway, I'm not sure (I don't have MSSQL installed to try out, but I
  can reply you on monday at work) that there are a few places where
  this implementation could not work:

  - web2py creates tables and fields with lowercase letters, so User
  get selectable only if database is set to be case insensitive
  - dbo stands for dbowner and it represent the schema which the
  object (in this case, a table) belongs. if your user has not the
  db_owner role on the db you won't be able to see it

  A few words also on this. Having objects beloging to different schemas
  under the same database it's definitely an option, but web2py
  (actually the library it uses, and many others like that) can't
  choose different schemas... they simply ignore it and the database
  defaults to whatever the default is for the user querying the database
  itself.
  You can have different schemas to separate between permissions on
  different objects in the same database, but to avoid headaches it's
  always better to create a separate user that owns a single database
  and put every data inside it.

  If the user in the connection string is db_owner of the database,
  select * from dbo.table is perfectly equivalent to select * from
  table

  If you have any other question please ask, I'll be glad to test it out
  on Monday




[web2py] Re: provide a development flag for applications II

2010-11-13 Thread mdipierro
I lost the context of this. Can you explain more?

On Nov 13, 2:13 pm, pierreth pierre.thibau...@gmail.com wrote:
 Massimo wrote:

 Date: Thu, 29 Jan 2009 09:47:25 -0800 (PST)
 Subject: Re: provide a development flag for applications

 OK let's just use WEB2PY_MODE than and it will appear in

 request.env.web2py_mode

 Notice we aready have

 request.env.web2py_path
 request.env.web2py_version

 Massimo

 -

 Yes, I would need it. It is still not there.


Re: [web2py] Re: Error when using new wizard

2010-11-13 Thread Kenneth Lundström
Where can I start to look for the problem. Is the problem written in 
some log?



Kenneth


It is a file permission issue.

On Nov 13, 12:33 am, Kenneth Lundströmkenneth.t.lundst...@gmail.com
wrote:

Centos 5.5, Apache 2 and mod_wsgi.

I tried using the New simple application. I gave it a name och pressed
create. I get unable to create application 'testing'.

Kenneth


What is your setup?  apache?mod_wsgi?
On Nov 12, 5:48 pm, Kenneth Lundstr mkenneth.t.lundst...@gmail.com
wrote:

   Can you check if this folder was created?
 /data/domains/web2py/applications/Boatintra
No it was not created.
   if not it is a file permission issue. What os? was it a binary
distribution of web2py?
Linux, source. All files permissions apache:web2py. I tried to change
file permissions of the applications directory to 777 but no luck.
Kenneth

On Nov 12, 5:30 pm, Kenneth Lundstr mkenneth.t.lundst...@gmail.com
wrote:

Just installed the newest version of web2py (1.89.1) and tested the
wizard to create a new appl.
I came to step 6 when I got a error.
Version
web2py Version 1.89.1 (2010-11-12 15:14:36)
Python
Traceback
Traceback (most recent call last):
File /data/domains/web2py/gluon/restricted.py, line 188, in restricted
exec ccode in environment
File /data/domains/web2py/applications/admin/controllers/wizard.py,
line 571, in ?
File /data/domains/web2py/gluon/globals.py, line 96, inlambda
self._caller = lambda f: f()
File /data/domains/web2py/applications/admin/controllers/wizard.py,
line 200, in step6
create(form.vars)
File /data/domains/web2py/applications/admin/controllers/wizard.py,
line 488, in create
file=open(meta,'wb')
IOError: [Errno 2] No such file or directory:
'/data/domains/web2py/applications/admin/../Boatintra/wizard.metadata'
What more info do you need to find the error?
Kenneth






[web2py] Re: provide a development flag for applications II

2010-11-13 Thread pierreth
On Nov 13, 3:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I lost the context of this. Can you explain more?


Here is the old thread:
https://groups.google.com/group/web2py/browse_thread/thread/65b6f8197af3eebd/f9c9488f71ba6893?hl=enlnk=gstq=provide+a+development+flag+for+applications#f9c9488f71ba6893


Re: [web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread Jason Brower
These are encouraging.
In large deployment I mean it in the most external sense of it.
Facebook is big, myspace is big, those kinds of object were what I was
aiming for.  And with Massimo's comment about the database size.  I
think your right, the framework does become less relavent.  In what ways
in a large codebase making web2py code messier and is there a solution
to it in another framework?
BR,
J
On Sat, 2010-11-13 at 11:48 -0600, Thadeus Burgess wrote:

 What is large deployment?
 
 Is it a large codebase that you must manage for an internal dashbaord,
 or just alot of users/database io that needs to scale out for
 worldwide access?
 
 If its the first case, web2py can get really complicated in dealing
 with lots of models and difficult to manage in an efficient manner.
 The larger your codebase the messier web2py apps will become. In the
 end, this would ultimately be up to the preferences of you and your
 team and what your willing to put up with.
 
 In the second case, framework hardly matters at that point. Disqus
 uses django, facebook uses php, reddit uses pylons, myspace uses
 coldfusion, microsoft uses asp, oracle uses java. Its always the
 database that becomes an issue regardless of programming language or
 web framework.
 
 --
 Thadeus
 
 
 
 
 
 On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu
 wrote:
 
 I agree with Villas. The larger the development the more the
 database
 becomes the bottleneck and the framework irrelevant.
 
 Massimo
 
 
 
 On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
  Hi Jason
 
  I guess you have to define 'large deployment' first of all.
  Number of
  records and size of DB? Number of concurrent users? Large
 data model
  or number of forms etc?  Number of servers -- or
 replication?  Global
  coverage?
 
  In principle I don't think there's any reason why Web2py
 would be
  worse than other frameworks.  Usually it is much better!  As
 an
  example,  I think deploying to the Google App Engine should
 be able to
  scale sufficiently for everything but extreme cases :)
 
  If you specify more about what you wish to achieve this
 group may be
  able to give more specific advice how best to organise your
 project.
 
  -D
 
  On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com
 wrote:
 
   I love web2py and it's the only framework i feel i am
 fully capable to do or learn to do quickly.
   However, I remember see that this framework is intended
 for small to medium sized deployments. Is this true? What is
 it that stops us from larger deployment? Should i pickup
 django because i may need it?
   Regards,
   jb
 
 
 
 
 




[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread villas
Yes, you are right, users get up to all kinds of things :)  However, I
think it is still true to say:
a. Form filling should still be efficient without using a mouse.
b. TimeEntry is better than Clockpick (not least because the latter is
broken).

If we wish to take it further, I suggest one of the following:
1. Fix Clockpick and integrate the latest version (the Web2py one was
broken anyway). I have tried to fix it this morning, but failed.  I
hate it now anyway!
2. Install TimeEntry because at least I have proven it is flexible and
works.
3. Suggest an existing superior alternative to TimeEntry.

I didn't include the option 'program our home-rolled version' because
I really do not think that's a good idea when there is a free, off the
shelf solution which is very flexible and already supported.  I know
we sometimes re-invent the wheel because 'we can', but surely there
will be better things for us to do on a Sunday?

Just my 2 cts.  I'll shut up now :)
-D

On Nov 13, 8:23 pm, Branko Vukelic bg.bra...@gmail.com wrote:
 On Sat, Nov 13, 2010 at 8:36 PM, villas villa...@gmail.com wrote:
  Hi Anthony

  Please bear in mind that anyone doing serious form filling should not
  have to use a mouse at all.  Use the arrow keys instead - it flies.

 Should not, but they do. People should use Ctrl+V for paste (or
 Shift+Ins), but they don't. You'd think that even the toolbar paste
 icon would be quick enough, but they right-click and look for the
 paste item which _never_ appear at the same place.

 Us geeks have more than once made completely incorrect assumptions
 about what people actually do. And they do unimaginably inefficient
 things. Hell, if they did what I think is best, they'd be using
 terminals for day-to-day file management, and write scripts to help
 with those tasks. My impression in working with people who use office
 type of apps is that they do indeed keep one hand on the mouse (not
 literally, obviously). On more than one occasion, I've gotten explicit
 requests to use drop-downs as time picker.

 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog:http://www.brankovukelic.com/
 Check out my portfolio:http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca:http://identi.ca/foxbunny

 Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Anthony
Yes, I suppose it depends on the application, use cases, user skill,
etc. Note, it appears that to use the keyboard with Time Entry, you
have to either read some instructions, or fiddle around until you
figure it out -- so, not the best for casual users just entering one
or two times, but yes, probably more efficient for a knowledgeable
user entering lots of times. I guess the question is which approach
makes more sense for the default widget in web2py.

(Note, it appears you can use the keyboard with ClockPick as well --
you have to use the mouse to get started, but then you can use the
arrow and enter keys to quickly select a specific time).

Anthony


On Nov 13, 2:36 pm, villas villa...@gmail.com wrote:
 Hi Anthony

 Please bear in mind that anyone doing serious form filling should not
 have to use a mouse at all.  Use the arrow keys instead - it flies.
 Most people entering times will be using an increment of say 15 or 30
 mins which makes it go at jet speed.

 -D

 On Nov 13, 7:08 pm, Anthony abasta...@gmail.com wrote:



  I agree. If you go to the Spinners tab and check Expand, things
  improve somewhat (particularly the explicit version, with +, -,
  and NOW), but still a hassle that you have to cycle through all the
  numbers (or manually type).

  Anthony

  On Nov 13, 12:06 pm, Branko Vukelic bg.bra...@gmail.com wrote:

   Oh, noes! This widget suffers from so many usability issues I can't
   believe it still exists.

   1. controls are microscopic
   2. it's not obvious you can switch between fields by clicking on them
   since fields are enclosed in a single box with no visible separators
   3. you cannot jump to desired values (you must cycle through values)

   The optimal control would:

   1. use familiar mechanism for selecting values
   2. enable jumping to desired values
   3. separate the components

   A set of drop-downs or text boxes will do just fine in satisfying the
   above requirements. I'll write the widget for you if you want, as soon
   as I'm done with e4s layout.

   On Sat, Nov 13, 2010 at 5:55 PM, mdipierro mdipie...@cs.depaul.edu 
   wrote:
Ok timeEntry it is. I will replace it today.

On Nov 13, 8:24 am, Nathan Freeze nat...@freezable.com wrote:
This would be a good slice :)

On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
 If you want to try it...

 1). Download files:
http://keith-wood.name/timeEntry.html
 Optionally this:
http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

 2). Add to views/layout.html
    {{response.files.append(URL(request.application,'static','css/
 jquery.timeentry.css'))}}
    {{response.files.append(URL(request.application,'static','js/
 jquery.timeentry.js'))}}
    {{response.files.append(URL(request.application,'static','js/
 jquery.mousewheel.min.js'))}}

 3). Make sure those 3 files above are copied into the folders under
 static dir.

 4). Copy spinnerDefault.png into static/images

 5). In views/web2py_ajax.html replace this:

  try { jQuery(input.time).clockpick({
      starthour:0, endhour:23, showminutes:true, military:true
  }); } catch(e) {};

 ...with...

  try { jQuery(input.time).timeEntry({spinnerImage:
 {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
 timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), 
 maxTime:
 new Date(0, 0, 0, 22, 00, 0)
  }); } catch(e) {};

 I included a couple of optional settings so you can see how they work
 in combination.

 It only takes a couple of minutes to set it up like this. Hope I
 didn't forget anything. :)

 -D

   --
   Branko Vukelić

   bg.bra...@gmail.com
   stu...@brankovukelic.com

   Check out my blog:http://www.brankovukelic.com/
   Check out my portfolio:http://www.flickr.com/photos/foxbunny/
   Registered Linux user #438078 (http://counter.li.org/)
   I hang out on identi.ca:http://identi.ca/foxbunny

   Gimp Brushmakers Guildhttp://bit.ly/gbg-group-Hidequoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -


[web2py] Re: MSSQL Select statements

2010-11-13 Thread DenesL
Hi Crim,

if you can use db.user.email that means you have defined the table in
web2py.
As I understand it, as per your previous posts, that table was not
created with web2py so it must be a legacy table.

You can access it depending on two things:
1) If the table has an auto incrementing field similar to web2py's id
field then you just define that field as type 'id' (don't forget to
set migrate=False as per 
http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables).
2) If there is no such field but the table has one or more fields that
are keys you can still access it using a primarykey definition (see
same section in the book as above).

There should be no need to use [dbo] or [master].[dbo] anywhere.

Posting your model would make it easier for others to help you.

Dens.

On Nov 13, 3:39 pm, Crim crimsonang...@gmail.com wrote:
 thanks for the in-depth reply ^ ^

 im using existing tables and i master and another one stuff setup to
 do the same thing but this is a school project so im not to picky at
 the moment xD but thanks for the info for future use.

 Can i do the db(db.user.email == s).select()  if i dont instantiate it
 in web2py? do i still have to define it? Considering the tables exist
 in the MSSql db?

 On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

  uhm  are you using existing tables or you are using web2py to
  create them ??

  dbo shouldn't affect at all the query, but a few hints nonetheless :

  master is a really nasty place to create tables  master db
  should be left untouched  in web2py you define a database when you
  istantiate db object, and all the query done on that db won't be able
  to see other databases

  that stated, if you have your connection string as
  mssql://username:passw...@localhost/master

  the query select * from [master].[dbo].[User] where [master].[dbo].
  [User]=s should be accomplished doing:

  db.define_table('user',
                  .
                  Field('email', 'string'),
                  .
                  )

  and db(db.user.email == s).select()

  anyway, I'm not sure (I don't have MSSQL installed to try out, but I
  can reply you on monday at work) that there are a few places where
  this implementation could not work:

  - web2py creates tables and fields with lowercase letters, so User
  get selectable only if database is set to be case insensitive
  - dbo stands for dbowner and it represent the schema which the
  object (in this case, a table) belongs. if your user has not the
  db_owner role on the db you won't be able to see it

  A few words also on this. Having objects beloging to different schemas
  under the same database it's definitely an option, but web2py
  (actually the library it uses, and many others like that) can't
  choose different schemas... they simply ignore it and the database
  defaults to whatever the default is for the user querying the database
  itself.
  You can have different schemas to separate between permissions on
  different objects in the same database, but to avoid headaches it's
  always better to create a separate user that owns a single database
  and put every data inside it.

  If the user in the connection string is db_owner of the database,
  select * from dbo.table is perfectly equivalent to select * from
  table

  If you have any other question please ask, I'll be glad to test it out
  on Monday




[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Nice i like the idea of raw sql statements ... but when i execute a
select statement would it return anything ex

variable = db.executesql(select)

would that work? (would test when i get home but im at work right now)

On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 web2py DAL only sees tables that are defined via the DAL. For raw sql
 you can do db.executesql()

 On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:







  thanks for the in-depth reply ^ ^

  im using existing tables and i master and another one stuff setup to
  do the same thing but this is a school project so im not to picky at
  the moment xD but thanks for the info for future use.

  Can i do the db(db.user.email == s).select()  if i dont instantiate it
  in web2py? do i still have to define it? Considering the tables exist
  in the MSSql db?

  On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

   uhm  are you using existing tables or you are using web2py to
   create them ??

   dbo shouldn't affect at all the query, but a few hints nonetheless :

   master is a really nasty place to create tables  master db
   should be left untouched  in web2py you define a database when you
   istantiate db object, and all the query done on that db won't be able
   to see other databases

   that stated, if you have your connection string as
   mssql://username:passw...@localhost/master

   the query select * from [master].[dbo].[User] where [master].[dbo].
   [User]=s should be accomplished doing:

   db.define_table('user',
                   .
                   Field('email', 'string'),
                   .
                   )

   and db(db.user.email == s).select()

   anyway, I'm not sure (I don't have MSSQL installed to try out, but I
   can reply you on monday at work) that there are a few places where
   this implementation could not work:

   - web2py creates tables and fields with lowercase letters, so User
   get selectable only if database is set to be case insensitive
   - dbo stands for dbowner and it represent the schema which the
   object (in this case, a table) belongs. if your user has not the
   db_owner role on the db you won't be able to see it

   A few words also on this. Having objects beloging to different schemas
   under the same database it's definitely an option, but web2py
   (actually the library it uses, and many others like that) can't
   choose different schemas... they simply ignore it and the database
   defaults to whatever the default is for the user querying the database
   itself.
   You can have different schemas to separate between permissions on
   different objects in the same database, but to avoid headaches it's
   always better to create a separate user that owns a single database
   and put every data inside it.

   If the user in the connection string is db_owner of the database,
   select * from dbo.table is perfectly equivalent to select * from
   table

   If you have any other question please ask, I'll be glad to test it out
   on Monday


[web2py] Re: MSSQL Select statements

2010-11-13 Thread mdipierro
yes

On Nov 13, 3:10 pm, Crim crimsonang...@gmail.com wrote:
 Nice i like the idea of raw sql statements ... but when i execute a
 select statement would it return anything ex

 variable = db.executesql(select)

 would that work? (would test when i get home but im at work right now)

 On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  web2py DAL only sees tables that are defined via the DAL. For raw sql
  you can do db.executesql()

  On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:

   thanks for the in-depth reply ^ ^

   im using existing tables and i master and another one stuff setup to
   do the same thing but this is a school project so im not to picky at
   the moment xD but thanks for the info for future use.

   Can i do the db(db.user.email == s).select()  if i dont instantiate it
   in web2py? do i still have to define it? Considering the tables exist
   in the MSSql db?

   On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

uhm  are you using existing tables or you are using web2py to
create them ??

dbo shouldn't affect at all the query, but a few hints nonetheless :

master is a really nasty place to create tables  master db
should be left untouched  in web2py you define a database when you
istantiate db object, and all the query done on that db won't be able
to see other databases

that stated, if you have your connection string as
mssql://username:passw...@localhost/master

the query select * from [master].[dbo].[User] where [master].[dbo].
[User]=s should be accomplished doing:

db.define_table('user',
                .
                Field('email', 'string'),
                .
                )

and db(db.user.email == s).select()

anyway, I'm not sure (I don't have MSSQL installed to try out, but I
can reply you on monday at work) that there are a few places where
this implementation could not work:

- web2py creates tables and fields with lowercase letters, so User
get selectable only if database is set to be case insensitive
- dbo stands for dbowner and it represent the schema which the
object (in this case, a table) belongs. if your user has not the
db_owner role on the db you won't be able to see it

A few words also on this. Having objects beloging to different schemas
under the same database it's definitely an option, but web2py
(actually the library it uses, and many others like that) can't
choose different schemas... they simply ignore it and the database
defaults to whatever the default is for the user querying the database
itself.
You can have different schemas to separate between permissions on
different objects in the same database, but to avoid headaches it's
always better to create a separate user that owns a single database
and put every data inside it.

If the user in the connection string is db_owner of the database,
select * from dbo.table is perfectly equivalent to select * from
table

If you have any other question please ask, I'll be glad to test it out
on Monday




[web2py] Apache virtualhosts and many domains

2010-11-13 Thread Kenneth Lundström
I´ve read many posts about domains linked to different apps but still I 
don´t know how to do it with Apaches virtual hosts.


I have looked at the web2py slices number 14.

Does anybody have two virtual hosts files or entries that you could send 
that I could look at?



Kenneth



[web2py] Re: Crud.select

2010-11-13 Thread yamandu
Very often we need to browse results of a query.
It´s not possibe with this plugin, is it?

Another probem is that when in a action you want for example change
the representation of
a field ony for that action.
Using the pugin jqgrid does not work because it seems to redo the
previous representation definition.

On Nov 13, 6:37 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 {{=plugin_wiki('jqgrid',table)}}

 already does ajax search, pagination, etc. crud.select should be able
 to do some of these without ajax.

 On Nov 13, 1:08 pm, yamandu yamandu.co...@gmail.com wrote: crud.select() 
 is not yet very usable.
  I pesonaly wished it support:
  -any query or rows (just like SQLTABLE)
  -pagination
  -it could be ajaxable
  Support the first two would be great for everyday use, I guess.

  I tried webgrid, it´s great but does not work in my hosting because of
  python version 2.4.
  I now use plugin jqgrid, but it´s too limited. I plan to adapt it
  better when have more time.

  On Nov 13, 4:37 am, andrej burja andrej.bu...@gmail.com wrote:

   maby it should be like WebGrid :)

   On Nov 13, 7:14 am, mdipierro mdipie...@cs.depaul.edu wrote:

Probably yes. I am not happy with crud.select. I think it should do
pagination for example too and have sortable columns and perhaps have
a an option to include crud.select().

Massimo

On Nov 12, 10:47 pm, mr.freeze nat...@freezable.com wrote:

 I know. I'm asking if it should.  Would you take a patch?

 On Nov 12, 10:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  No it does not.

  On Nov 12, 8:41 pm, mr.freeze nat...@freezable.com wrote:

   Should Crud.select honor record level auth permissions when 
   returning
   records? Right now it only filters by table.




[web2py] Idea on web2py wizard

2010-11-13 Thread blackthorne
In the table creation step, how about having some columns with all the
available options for each table field such as unique, required,
notnull, nonempty as checkboxes. The types could also come from a
dropbox with: string, integer, ...

I don't know if this kind of thing could be applied elsewhere but it
would be great for those that don't want to know by heart all the
possible options and apply them...

Thank you,
Best regards


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Brian M
I use web2py and MS SQL with raw SQL queries often.

results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
and something = ? , ('criteria 1', 'criteria 2'), True)

The two extra pieces at the end will let you safely bind in query
parameters and the final True arg makes it so that the results are a
list of dictionaries.  Thus you can do

for row in results:
print row['foo']
print row['bar']

not quite as slick as regular DAL but very usable, at least for
me. :-)

Hint - if you're doing queries for dates, the pyodbc doesn't seem to
automatically convert python date type into the needed format.  Use
something like

results = db.executesql(SELECT * FROM my_table WHERE date_created
BETWEEN ? and ? , (start_date.strftime('%Y-%m-%d'),
end_date.strftime('%Y-%m-%d')), True)

~Brian

On Nov 13, 3:10 pm, Crim crimsonang...@gmail.com wrote:
 Nice i like the idea of raw sql statements ... but when i execute a
 select statement would it return anything ex

 variable = db.executesql(select)

 would that work? (would test when i get home but im at work right now)

 On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:







  web2py DAL only sees tables that are defined via the DAL. For raw sql
  you can do db.executesql()

  On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:

   thanks for the in-depth reply ^ ^

   im using existing tables and i master and another one stuff setup to
   do the same thing but this is a school project so im not to picky at
   the moment xD but thanks for the info for future use.

   Can i do the db(db.user.email == s).select()  if i dont instantiate it
   in web2py? do i still have to define it? Considering the tables exist
   in the MSSql db?

   On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

uhm  are you using existing tables or you are using web2py to
create them ??

dbo shouldn't affect at all the query, but a few hints nonetheless :

master is a really nasty place to create tables  master db
should be left untouched  in web2py you define a database when you
istantiate db object, and all the query done on that db won't be able
to see other databases

that stated, if you have your connection string as
mssql://username:passw...@localhost/master

the query select * from [master].[dbo].[User] where [master].[dbo].
[User]=s should be accomplished doing:

db.define_table('user',
                .
                Field('email', 'string'),
                .
                )

and db(db.user.email == s).select()

anyway, I'm not sure (I don't have MSSQL installed to try out, but I
can reply you on monday at work) that there are a few places where
this implementation could not work:

- web2py creates tables and fields with lowercase letters, so User
get selectable only if database is set to be case insensitive
- dbo stands for dbowner and it represent the schema which the
object (in this case, a table) belongs. if your user has not the
db_owner role on the db you won't be able to see it

A few words also on this. Having objects beloging to different schemas
under the same database it's definitely an option, but web2py
(actually the library it uses, and many others like that) can't
choose different schemas... they simply ignore it and the database
defaults to whatever the default is for the user querying the database
itself.
You can have different schemas to separate between permissions on
different objects in the same database, but to avoid headaches it's
always better to create a separate user that owns a single database
and put every data inside it.

If the user in the connection string is db_owner of the database,
select * from dbo.table is perfectly equivalent to select * from
table

If you have any other question please ask, I'll be glad to test it out
on Monday


Re: [web2py] Idea on web2py wizard

2010-11-13 Thread Kenneth Lundström

+1

I was thinking the same when I was using the wizard first time. Maybe so 
that you still could do like you do now, write evertything or then you 
could select everything from a dropdown box and checkboxes.



Kenneth


In the table creation step, how about having some columns with all the
available options for each table field such as unique, required,
notnull, nonempty as checkboxes. The types could also come from a
dropbox with: string, integer, ...

I don't know if this kind of thing could be applied elsewhere but it
would be great for those that don't want to know by heart all the
possible options and apply them...

Thank you,
Best regards




[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
you can down load the sql code here http://www.megaupload.com/?d=ARORZKPF

no i cant use it .. so i take it i have to define the table in
web2py?

thanks a lot for  your help ^ ^


On Nov 13, 3:09 pm, DenesL denes1...@yahoo.ca wrote:
 Hi Crim,

 if you can use db.user.email that means you have defined the table in
 web2py.
 As I understand it, as per your previous posts, that table was not
 created with web2py so it must be a legacy table.

 You can access it depending on two things:
 1) If the table has an auto incrementing field similar to web2py's id
 field then you just define that field as type 'id' (don't forget to
 set migrate=False as 
 perhttp://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-...).
 2) If there is no such field but the table has one or more fields that
 are keys you can still access it using a primarykey definition (see
 same section in the book as above).

 There should be no need to use [dbo] or [master].[dbo] anywhere.

 Posting your model would make it easier for others to help you.

 Dens.

 On Nov 13, 3:39 pm, Crim crimsonang...@gmail.com wrote:







  thanks for the in-depth reply ^ ^

  im using existing tables and i master and another one stuff setup to
  do the same thing but this is a school project so im not to picky at
  the moment xD but thanks for the info for future use.

  Can i do the db(db.user.email == s).select()  if i dont instantiate it
  in web2py? do i still have to define it? Considering the tables exist
  in the MSSql db?

  On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

   uhm  are you using existing tables or you are using web2py to
   create them ??

   dbo shouldn't affect at all the query, but a few hints nonetheless :

   master is a really nasty place to create tables  master db
   should be left untouched  in web2py you define a database when you
   istantiate db object, and all the query done on that db won't be able
   to see other databases

   that stated, if you have your connection string as
   mssql://username:passw...@localhost/master

   the query select * from [master].[dbo].[User] where [master].[dbo].
   [User]=s should be accomplished doing:

   db.define_table('user',
                   .
                   Field('email', 'string'),
                   .
                   )

   and db(db.user.email == s).select()

   anyway, I'm not sure (I don't have MSSQL installed to try out, but I
   can reply you on monday at work) that there are a few places where
   this implementation could not work:

   - web2py creates tables and fields with lowercase letters, so User
   get selectable only if database is set to be case insensitive
   - dbo stands for dbowner and it represent the schema which the
   object (in this case, a table) belongs. if your user has not the
   db_owner role on the db you won't be able to see it

   A few words also on this. Having objects beloging to different schemas
   under the same database it's definitely an option, but web2py
   (actually the library it uses, and many others like that) can't
   choose different schemas... they simply ignore it and the database
   defaults to whatever the default is for the user querying the database
   itself.
   You can have different schemas to separate between permissions on
   different objects in the same database, but to avoid headaches it's
   always better to create a separate user that owns a single database
   and put every data inside it.

   If the user in the connection string is db_owner of the database,
   select * from dbo.table is perfectly equivalent to select * from
   table

   If you have any other question please ask, I'll be glad to test it out
   on Monday


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Ah thanks this i like too ^ ^

my only question on it is when you say:

results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
and something = ? , ('criteria 1', 'criteria 2'), True)

what do you mean by 'criteria 1' ... what kind of criteria? is that
where i put a python bit of code?

On Nov 13, 3:23 pm, Brian M bmere...@gmail.com wrote:
 I use web2py and MS SQL with raw SQL queries often.

 results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
 and something = ? , ('criteria 1', 'criteria 2'), True)

 The two extra pieces at the end will let you safely bind in query
 parameters and the final True arg makes it so that the results are a
 list of dictionaries.  Thus you can do

 for row in results:
     print row['foo']
     print row['bar']

 not quite as slick as regular DAL but very usable, at least for
 me. :-)

 Hint - if you're doing queries for dates, the pyodbc doesn't seem to
 automatically convert python date type into the needed format.  Use
 something like

 results = db.executesql(SELECT * FROM my_table WHERE date_created
 BETWEEN ? and ? , (start_date.strftime('%Y-%m-%d'),
 end_date.strftime('%Y-%m-%d')), True)

 ~Brian

 On Nov 13, 3:10 pm, Crim crimsonang...@gmail.com wrote:







  Nice i like the idea of raw sql statements ... but when i execute a
  select statement would it return anything ex

  variable = db.executesql(select)

  would that work? (would test when i get home but im at work right now)

  On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   web2py DAL only sees tables that are defined via the DAL. For raw sql
   you can do db.executesql()

   On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:

thanks for the in-depth reply ^ ^

im using existing tables and i master and another one stuff setup to
do the same thing but this is a school project so im not to picky at
the moment xD but thanks for the info for future use.

Can i do the db(db.user.email == s).select()  if i dont instantiate it
in web2py? do i still have to define it? Considering the tables exist
in the MSSql db?

On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

 uhm  are you using existing tables or you are using web2py to
 create them ??

 dbo shouldn't affect at all the query, but a few hints nonetheless :

 master is a really nasty place to create tables  master db
 should be left untouched  in web2py you define a database when you
 istantiate db object, and all the query done on that db won't be able
 to see other databases

 that stated, if you have your connection string as
 mssql://username:passw...@localhost/master

 the query select * from [master].[dbo].[User] where [master].[dbo].
 [User]=s should be accomplished doing:

 db.define_table('user',
                 .
                 Field('email', 'string'),
                 .
                 )

 and db(db.user.email == s).select()

 anyway, I'm not sure (I don't have MSSQL installed to try out, but I
 can reply you on monday at work) that there are a few places where
 this implementation could not work:

 - web2py creates tables and fields with lowercase letters, so User
 get selectable only if database is set to be case insensitive
 - dbo stands for dbowner and it represent the schema which the
 object (in this case, a table) belongs. if your user has not the
 db_owner role on the db you won't be able to see it

 A few words also on this. Having objects beloging to different schemas
 under the same database it's definitely an option, but web2py
 (actually the library it uses, and many others like that) can't
 choose different schemas... they simply ignore it and the database
 defaults to whatever the default is for the user querying the database
 itself.
 You can have different schemas to separate between permissions on
 different objects in the same database, but to avoid headaches it's
 always better to create a separate user that owns a single database
 and put every data inside it.

 If the user in the connection string is db_owner of the database,
 select * from dbo.table is perfectly equivalent to select * from
 table

 If you have any other question please ask, I'll be glad to test it out
 on Monday


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Brian M
Crim,

Yes, the criteria are any python variables you might like substituted
into your query. I probably shouldn't have used only 'strings' in my
example, sorry.

my_city = 'somewhere'
my_state = 'MN'
start_date = date(2010, 11, 13)
end_date = date(2010, 11, 15)
results = db.executesql(SELECT * FROM my_table WHERE city = ? AND
state = ? AND date BETWEEN ? AND ?,
   (my_city, my_state,
start_date.strftime('%Y-%m-%d), end_date.strftime('%Y-%m-%d')), True)

The resulting SQL query would be:
SELECT * FROM my_table WHERE city = 'somewhere' AND state = 'MN' AND
date BETWEEN '2010-11-13' AND '2010-11-15'

~Brian



On Nov 13, 3:40 pm, Crim crimsonang...@gmail.com wrote:
 Ah thanks this i like too ^ ^

 my only question on it is when you say:

 results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
 and something = ? , ('criteria 1', 'criteria 2'), True)

 what do you mean by 'criteria 1' ... what kind of criteria? is that
 where i put a python bit of code?

 On Nov 13, 3:23 pm, Brian M bmere...@gmail.com wrote:







  I use web2py and MS SQL with raw SQL queries often.

  results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
  and something = ? , ('criteria 1', 'criteria 2'), True)

  The two extra pieces at the end will let you safely bind in query
  parameters and the final True arg makes it so that the results are a
  list of dictionaries.  Thus you can do

  for row in results:
      print row['foo']
      print row['bar']

  not quite as slick as regular DAL but very usable, at least for
  me. :-)

  Hint - if you're doing queries for dates, the pyodbc doesn't seem to
  automatically convert python date type into the needed format.  Use
  something like

  results = db.executesql(SELECT * FROM my_table WHERE date_created
  BETWEEN ? and ? , (start_date.strftime('%Y-%m-%d'),
  end_date.strftime('%Y-%m-%d')), True)

  ~Brian

  On Nov 13, 3:10 pm, Crim crimsonang...@gmail.com wrote:

   Nice i like the idea of raw sql statements ... but when i execute a
   select statement would it return anything ex

   variable = db.executesql(select)

   would that work? (would test when i get home but im at work right now)

   On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:

web2py DAL only sees tables that are defined via the DAL. For raw sql
you can do db.executesql()

On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:

 thanks for the in-depth reply ^ ^

 im using existing tables and i master and another one stuff setup to
 do the same thing but this is a school project so im not to picky at
 the moment xD but thanks for the info for future use.

 Can i do the db(db.user.email == s).select()  if i dont instantiate it
 in web2py? do i still have to define it? Considering the tables exist
 in the MSSql db?

 On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

  uhm  are you using existing tables or you are using web2py to
  create them ??

  dbo shouldn't affect at all the query, but a few hints nonetheless :

  master is a really nasty place to create tables  master db
  should be left untouched  in web2py you define a database when 
  you
  istantiate db object, and all the query done on that db won't be 
  able
  to see other databases

  that stated, if you have your connection string as
  mssql://username:passw...@localhost/master

  the query select * from [master].[dbo].[User] where [master].[dbo].
  [User]=s should be accomplished doing:

  db.define_table('user',
                  .
                  Field('email', 'string'),
                  .
                  )

  and db(db.user.email == s).select()

  anyway, I'm not sure (I don't have MSSQL installed to try out, but I
  can reply you on monday at work) that there are a few places where
  this implementation could not work:

  - web2py creates tables and fields with lowercase letters, so User
  get selectable only if database is set to be case insensitive
  - dbo stands for dbowner and it represent the schema which the
  object (in this case, a table) belongs. if your user has not the
  db_owner role on the db you won't be able to see it

  A few words also on this. Having objects beloging to different 
  schemas
  under the same database it's definitely an option, but web2py
  (actually the library it uses, and many others like that) can't
  choose different schemas... they simply ignore it and the database
  defaults to whatever the default is for the user querying the 
  database
  itself.
  You can have different schemas to separate between permissions on
  different objects in the same database, but to avoid headaches it's
  always better to create a separate user that owns a single 
  database
  and put every data inside it.

  If the user 

[web2py] Re: MSSQL Select statements

2010-11-13 Thread DenesL
You have

CREATE TABLE [User](
Email varchar(50),
Name varchar(50),
PIN int,
Phone varchar(50),
Address varchar(50),
Mileage int,
MealPref varchar(50),
PRIMARY KEY (Email));

that translates into this web2py model

db.define_table('User',
  Field('Email','string',50),
  Field('Name','string',50),
  Field('PIN','integer'),
  Field('Phone','string',50),
  Field('Address','string',50),
  Field('Mileage','integer'),
  Field('MealPref','string',50),
  primarykey=['Email'],
  migrate=False
)

after which you can use the table in your controllers e.g.

rows=db(db.User.Email=='a...@b.com).select()

For more info on keyed tables see
http://groups.google.com/group/web2py/browse_thread/thread/db150376b06d47fc

Denes

On Nov 13, 4:32 pm, Crim crimsonang...@gmail.com wrote:
 you can down load the sql code herehttp://www.megaupload.com/?d=ARORZKPF

 no i cant use it .. so i take it i have to define the table in
 web2py?

 thanks a lot for  your help ^ ^

 On Nov 13, 3:09 pm, DenesL denes1...@yahoo.ca wrote:

  Hi Crim,

  if you can use db.user.email that means you have defined the table in
  web2py.
  As I understand it, as per your previous posts, that table was not
  created with web2py so it must be a legacy table.

  You can access it depending on two things:
  1) If the table has an auto incrementing field similar to web2py's id
  field then you just define that field as type 'id' (don't forget to
  set migrate=False as 
  perhttp://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-...).
  2) If there is no such field but the table has one or more fields that
  are keys you can still access it using a primarykey definition (see
  same section in the book as above).

  There should be no need to use [dbo] or [master].[dbo] anywhere.

  Posting your model would make it easier for others to help you.

  Dens.

  On Nov 13, 3:39 pm, Crim crimsonang...@gmail.com wrote:

   thanks for the in-depth reply ^ ^

   im using existing tables and i master and another one stuff setup to
   do the same thing but this is a school project so im not to picky at
   the moment xD but thanks for the info for future use.

   Can i do the db(db.user.email == s).select()  if i dont instantiate it
   in web2py? do i still have to define it? Considering the tables exist
   in the MSSql db?

   On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

uhm  are you using existing tables or you are using web2py to
create them ??

dbo shouldn't affect at all the query, but a few hints nonetheless :

master is a really nasty place to create tables  master db
should be left untouched  in web2py you define a database when you
istantiate db object, and all the query done on that db won't be able
to see other databases

that stated, if you have your connection string as
mssql://username:passw...@localhost/master

the query select * from [master].[dbo].[User] where [master].[dbo].
[User]=s should be accomplished doing:

db.define_table('user',
                .
                Field('email', 'string'),
                .
                )

and db(db.user.email == s).select()

anyway, I'm not sure (I don't have MSSQL installed to try out, but I
can reply you on monday at work) that there are a few places where
this implementation could not work:

- web2py creates tables and fields with lowercase letters, so User
get selectable only if database is set to be case insensitive
- dbo stands for dbowner and it represent the schema which the
object (in this case, a table) belongs. if your user has not the
db_owner role on the db you won't be able to see it

A few words also on this. Having objects beloging to different schemas
under the same database it's definitely an option, but web2py
(actually the library it uses, and many others like that) can't
choose different schemas... they simply ignore it and the database
defaults to whatever the default is for the user querying the database
itself.
You can have different schemas to separate between permissions on
different objects in the same database, but to avoid headaches it's
always better to create a separate user that owns a single database
and put every data inside it.

If the user in the connection string is db_owner of the database,
select * from dbo.table is perfectly equivalent to select * from
table

If you have any other question please ask, I'll be glad to test it out
on Monday




[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread winti
Hello,
the jquery timepicker is a good alternative to the clockpicker.
For my point of view, the clockpicker is good enough if it's working
as expected.
I would suggest to provide additional functionality, as timeentry and
other jquery widgets for ui enhancements in plugins.
The clockpicker misbehavior, as villas describes, i seen in version
1.89.1 and as well in versions within the range 1.86-1.88. But, if i
remember me correctly this was solved in 1.88.12.
Maybe someone could figure out the reason for that.

Stefan

On Nov 13, 3:24 pm, Nathan Freeze nat...@freezable.com wrote:
 This would be a good slice :)



 On Sat, Nov 13, 2010 at 6:29 AM, villas villa...@gmail.com wrote:
  If you want to try it...

  1). Download files:
 http://keith-wood.name/timeEntry.html
  Optionally this:
 http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip

  2). Add to views/layout.html
     {{response.files.append(URL(request.application,'static','css/
  jquery.timeentry.css'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.timeentry.js'))}}
     {{response.files.append(URL(request.application,'static','js/
  jquery.mousewheel.min.js'))}}

  3). Make sure those 3 files above are copied into the folders under
  static dir.

  4). Copy spinnerDefault.png into static/images

  5). In views/web2py_ajax.html replace this:

   try { jQuery(input.time).clockpick({
       starthour:0, endhour:23, showminutes:true, military:true
   }); } catch(e) {};

  ...with...

   try { jQuery(input.time).timeEntry({spinnerImage:
  {{=URL('static','images/spinnerDefault.png')}}, show24Hours: true,
  timeSteps:      [1, 30, 0], minTime: new Date(0, 0, 0, 7, 00, 0), maxTime:
  new Date(0, 0, 0, 22, 00, 0)
   }); } catch(e) {};

  I included a couple of optional settings so you can see how they work
  in combination.

  It only takes a couple of minutes to set it up like this. Hope I
  didn't forget anything. :)

  -D


[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Brian,
Thanks ^ ^ this i understand. Thanks for taking time and give me a
great example!


On Nov 13, 3:48 pm, Brian M bmere...@gmail.com wrote:
 Crim,

 Yes, the criteria are any python variables you might like substituted
 into your query. I probably shouldn't have used only 'strings' in my
 example, sorry.

 my_city = 'somewhere'
 my_state = 'MN'
 start_date = date(2010, 11, 13)
 end_date = date(2010, 11, 15)
 results = db.executesql(SELECT * FROM my_table WHERE city = ? AND
 state = ? AND date BETWEEN ? AND ?,
                                    (my_city, my_state,
 start_date.strftime('%Y-%m-%d), end_date.strftime('%Y-%m-%d')), True)

 The resulting SQL query would be:
 SELECT * FROM my_table WHERE city = 'somewhere' AND state = 'MN' AND
 date BETWEEN '2010-11-13' AND '2010-11-15'

 ~Brian

 On Nov 13, 3:40 pm, Crim crimsonang...@gmail.com wrote:







  Ah thanks this i like too ^ ^

  my only question on it is when you say:

  results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
  and something = ? , ('criteria 1', 'criteria 2'), True)

  what do you mean by 'criteria 1' ... what kind of criteria? is that
  where i put a python bit of code?

  On Nov 13, 3:23 pm, Brian M bmere...@gmail.com wrote:

   I use web2py and MS SQL with raw SQL queries often.

   results = db.executesql(SELECT foo,bar FROM my_table WHERE blah = ?
   and something = ? , ('criteria 1', 'criteria 2'), True)

   The two extra pieces at the end will let you safely bind in query
   parameters and the final True arg makes it so that the results are a
   list of dictionaries.  Thus you can do

   for row in results:
       print row['foo']
       print row['bar']

   not quite as slick as regular DAL but very usable, at least for
   me. :-)

   Hint - if you're doing queries for dates, the pyodbc doesn't seem to
   automatically convert python date type into the needed format.  Use
   something like

   results = db.executesql(SELECT * FROM my_table WHERE date_created
   BETWEEN ? and ? , (start_date.strftime('%Y-%m-%d'),
   end_date.strftime('%Y-%m-%d')), True)

   ~Brian

   On Nov 13, 3:10 pm, Crim crimsonang...@gmail.com wrote:

Nice i like the idea of raw sql statements ... but when i execute a
select statement would it return anything ex

variable = db.executesql(select)

would that work? (would test when i get home but im at work right now)

On Nov 13, 2:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 web2py DAL only sees tables that are defined via the DAL. For raw sql
 you can do db.executesql()

 On Nov 13, 2:39 pm, Crim crimsonang...@gmail.com wrote:

  thanks for the in-depth reply ^ ^

  im using existing tables and i master and another one stuff setup to
  do the same thing but this is a school project so im not to picky at
  the moment xD but thanks for the info for future use.

  Can i do the db(db.user.email == s).select()  if i dont instantiate 
  it
  in web2py? do i still have to define it? Considering the tables 
  exist
  in the MSSql db?

  On Nov 13, 2:05 pm, Niphlod niph...@gmail.com wrote:

   uhm  are you using existing tables or you are using web2py to
   create them ??

   dbo shouldn't affect at all the query, but a few hints 
   nonetheless :

   master is a really nasty place to create tables  master db
   should be left untouched  in web2py you define a database 
   when you
   istantiate db object, and all the query done on that db won't be 
   able
   to see other databases

   that stated, if you have your connection string as
   mssql://username:passw...@localhost/master

   the query select * from [master].[dbo].[User] where 
   [master].[dbo].
   [User]=s should be accomplished doing:

   db.define_table('user',
                   .
                   Field('email', 'string'),
                   .
                   )

   and db(db.user.email == s).select()

   anyway, I'm not sure (I don't have MSSQL installed to try out, 
   but I
   can reply you on monday at work) that there are a few places where
   this implementation could not work:

   - web2py creates tables and fields with lowercase letters, so 
   User
   get selectable only if database is set to be case insensitive
   - dbo stands for dbowner and it represent the schema which the
   object (in this case, a table) belongs. if your user has not the
   db_owner role on the db you won't be able to see it

   A few words also on this. Having objects beloging to different 
   schemas
   under the same database it's definitely an option, but web2py
   (actually the library it uses, and many others like that) can't
   choose different schemas... they simply ignore it and the 
   database
   defaults to whatever the default is for the user querying the 
   database
  

[web2py] Re: MSSQL Select statements

2010-11-13 Thread DenesL

 rows=db(db.user.email=...@b.com).select()

that did not paste properly, should be

rows=db(db.User.Email==a...@b.com).select()



[web2py] Re: How to switch back to English for the Admin interface?

2010-11-13 Thread Stefan Scholl
On Nov 12, 3:03 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 The admin (admin) has a selector at the bottom, it uses cookies to
 keep the preferred selected language.

Since Version 1.89.1, released 2010-11-12 15:14:36

(In case somebody reads this thread in a few years and thinks I'm
blind.)


Re: [web2py] Re: provide a development flag for applications II

2010-11-13 Thread Jonathan Lundell
On Nov 13, 2010, at 12:47 PM, pierreth wrote:
 
 On Nov 13, 3:42 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I lost the context of this. Can you explain more?
 
 
 Here is the old thread:
 https://groups.google.com/group/web2py/browse_thread/thread/65b6f8197af3eebd/f9c9488f71ba6893?hl=enlnk=gstq=provide+a+development+flag+for+applications#f9c9488f71ba6893

If this is an application-specific flag (that is, unless the web2py core takes 
it into consideration), why wouldn't you just set it in your first-parsed model?

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Crim
Thanks DenesL ^ ^

On Nov 13, 3:57 pm, DenesL denes1...@yahoo.ca wrote:
  rows=db(db.user.email=...@b.com).select()

 that did not paste properly, should be

 rows=db(db.User.Email==a...@b.com).select()


[web2py] Circular references

2010-11-13 Thread blackthorne
hi,
I have this problem. I want to do a blog with posts that allows
comments. I also want those comments to be able to have other
comments, like a thread.

I just can't do this in web2py at least using the wizard...

help?


[web2py] Re: Idea on web2py wizard

2010-11-13 Thread blackthorne
Or else, just integrate the SQL designer in http://gaesql.appspot.com/
for the job. I think it's even better for this kind of thing...

On Nov 13, 9:31 pm, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 +1

 I was thinking the same when I was using the wizard first time. Maybe so
 that you still could do like you do now, write evertything or then you
 could select everything from a dropdown box and checkboxes.

 Kenneth



  In the table creation step, how about having some columns with all the
  available options for each table field such as unique, required,
  notnull, nonempty as checkboxes. The types could also come from a
  dropbox with: string, integer, ...

  I don't know if this kind of thing could be applied elsewhere but it
  would be great for those that don't want to know by heart all the
  possible options and apply them...

  Thank you,
  Best regards


[web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread villas
@Stefan
There's a lot of stuff out there!  Please could we have a link?  I
found one really cool timepicker but it was using UI.  Please bear in
mind that Massimo has said that he does NOT wish to include jQuery UI
with Web2py at present.

@Everyone
If anyone suggests a replacement timepicker,  please post a link.
Preferably to a demo.

-D


[web2py] Re: provide a development flag for applications II

2010-11-13 Thread pierreth
On Nov 13, 5:07 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Nov 13, 2010, at 12:47 PM, pierreth wrote:

 If this is an application-specific flag (that is, unless the web2py core 
 takes it into consideration), why wouldn't you just set it in your 
 first-parsed model?

This is what I did.

But I believe it would better to have it at the web2py core. This way,
it is the same convention for all applications and plug-ins. It
enables plug-ins to know in what mode they are running so they can
react accordingly.

Otherwise, everyone will use its own convention.


[web2py] Re: Circular references

2010-11-13 Thread villas
Hi Blackthorne

Sounds like you need a parent_id field in your comments table which
would be self-referencing. See this section in the book:
http://www.web2py.com/book/default/chapter/06#Self-Reference-and-Aliases

-D

On Nov 13, 10:11 pm, blackthorne francisco@gmail.com wrote:
 hi,
 I have this problem. I want to do a blog with posts that allows
 comments. I also want those comments to be able to have other
 comments, like a thread.

 I just can't do this in web2py at least using the wizard...

 help?


Re: [web2py] Re: web2py 1.89.1 is OUT

2010-11-13 Thread Branko Vukelic
On Sat, Nov 13, 2010 at 11:42 PM, villas villa...@gmail.com wrote:
 @Everyone
 If anyone suggests a replacement timepicker,  please post a link.
 Preferably to a demo.

I've looked around for a good timepicker a lot back when someone said
we needed a datetime picker. And my conclusion was that there is
currently no good solution for this. 80% of the solutions are
overengineered, and the rest either broken or painfully slow to use.
To quote a conclusion from a stackoverflow user:

Time pickers just take this kind of UI fetish to a new extreme. Why
not allow your users to either type the time or just use a couple of
drop down boxes for hours and mins. Even drop down lists allow a user
to just type the time.[1]

So, a fancy-shmancy time picker is just a waste of time. Indeed,
writing a text box with client-side validation or a few drop-downs
makes much more sense until someone comes with a solution that just
makes sense to all of us and requires no further comments.

[1] http://stackoverflow.com/questions/476822/jquery-time-picker

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Idea on web2py wizard

2010-11-13 Thread Anthony
On Nov 13, 5:18 pm, blackthorne francisco@gmail.com wrote:
 Or else, just integrate the SQL designer inhttp://gaesql.appspot.com/
 for the job. I think it's even better for this kind of thing...

Hmm, I notice it still uses SQLField in web2py table definitions
instead of Field.


Re: [web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread Branko Vukelic
On Sat, Nov 13, 2010 at 9:49 PM, Jason Brower encomp...@gmail.com wrote:
 These are encouraging.
 In large deployment I mean it in the most external sense of it.  Facebook is
 big, myspace is big, those kinds of object were what I was aiming for.  And

For that kind of large deployment, you'll probably hit the limitation
of the Python programming language sooner or later, too. Erlang seems
to have become quite popular lately and even Facebook uses it for some
backend stuff. The main reason is out-of-box concurrency, and great
reliability under load which comes from supervisor-worker setup that
is built-in. A good example of what this means is Yaws http server
which is virtually impossible to kill even if you bombard it with a
huge (as in MUCH more than http server X) number of concurrent
requests.

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Circular references

2010-11-13 Thread blackthorne
Thank you,
sorry, I should know this...

On Nov 13, 10:50 pm, villas villa...@gmail.com wrote:
 Hi Blackthorne

 Sounds like you need a parent_id field in your comments table which
 would be self-referencing. See this section in the 
 book:http://www.web2py.com/book/default/chapter/06#Self-Reference-and-Aliases

 -D

 On Nov 13, 10:11 pm, blackthorne francisco@gmail.com wrote:



  hi,
  I have this problem. I want to do a blog with posts that allows
  comments. I also want those comments to be able to have other
  comments, like a thread.

  I just can't do this in web2py at least using the wizard...

  help?


[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread b00m_chef
Let me just say that the chance that your app will have the traffic of
facebook or twitter or even livejournal (yes it is still alive) is so
small, that you really don't need to worry about it too much at such
an early stage.



On Nov 13, 3:11 pm, Branko Vukelic bg.bra...@gmail.com wrote:
 On Sat, Nov 13, 2010 at 9:49 PM, Jason Brower encomp...@gmail.com wrote:
  These are encouraging.
  In large deployment I mean it in the most external sense of it.  Facebook is
  big, myspace is big, those kinds of object were what I was aiming for.  And

 For that kind of large deployment, you'll probably hit the limitation
 of the Python programming language sooner or later, too. Erlang seems
 to have become quite popular lately and even Facebook uses it for some
 backend stuff. The main reason is out-of-box concurrency, and great
 reliability under load which comes from supervisor-worker setup that
 is built-in. A good example of what this means is Yaws http server
 which is virtually impossible to kill even if you bombard it with a
 huge (as in MUCH more than http server X) number of concurrent
 requests.

 --
 Branko Vukelić

 bg.bra...@gmail.com
 stu...@brankovukelic.com

 Check out my blog:http://www.brankovukelic.com/
 Check out my portfolio:http://www.flickr.com/photos/foxbunny/
 Registered Linux user #438078 (http://counter.li.org/)
 I hang out on identi.ca:http://identi.ca/foxbunny

 Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: provide a development flag for applications II

2010-11-13 Thread Christopher Steel
We got an app for that... ;)

http://code.google.com/p/uc-debug/

It's a plugin...

On Nov 13, 5:47 pm, pierreth pierre.thibau...@gmail.com wrote:
 On Nov 13, 5:07 pm, Jonathan Lundell jlund...@pobox.com wrote:

  On Nov 13, 2010, at 12:47 PM, pierreth wrote:

  If this is an application-specific flag (that is, unless the web2py core 
  takes it into consideration), why wouldn't you just set it in your 
  first-parsed model?

 This is what I did.

 But I believe it would better to have it at the web2py core. This way,
 it is the same convention for all applications and plug-ins. It
 enables plug-ins to know in what mode they are running so they can
 react accordingly.

 Otherwise, everyone will use its own convention.


[web2py] Re: Idea on web2py wizard

2010-11-13 Thread mdipierro
I do not remember the reason for that suggestion.

My only concerns are:
1) I would be best to have just one verison online (the most updated
one) even if hosted at multiple places.
2) not break the link in web2py admin (or make a case for changing the
link).

Are you Boris the only one maintaining sqldesigner or are there
mutliple forks?

Massimo

On Nov 13, 6:06 pm, Boris Manojlovic boris.manojlo...@gmail.com
wrote:
 Hello all,

 For some reason Massimo decided it is much better to redirect from my
 version athttp://designer.bojanka.net/to older code base but ok that is his 
 call...

 Anyway for others who would like really working designer application (local)
 please use attached application and follow steps when first run.

 As usual i did not change anything in javascript application except
 config.js (pristine www sql designer as can it be)
 my stuff really is in models/db.py, controllers/default.py and routes.py*
 Please when adding this application call it sqldesigner if you don't wanna
 change anything in code provided. If you decide name
 is stupid or something else look in both routes.py to fix name of
 application and same in controllers/default.py

 Boris

 On Sun, Nov 14, 2010 at 12:07 AM, Anthony abasta...@gmail.com wrote:
  On Nov 13, 5:18 pm, blackthorne francisco@gmail.com wrote:
   Or else, just integrate the SQL designer inhttp://gaesql.appspot.com/
   for the job. I think it's even better for this kind of thing...

  Hmm, I notice it still uses SQLField in web2py table definitions
  instead of Field.

 --
 Only two things are infinite, the universe and human stupidity, and I'm not
 sure about the former.-Albert Einstein

  web2py.app.sqldesigner.w2p
 237KViewDownload


[web2py] The primary key constraint on legacy tables

2010-11-13 Thread Rishu
Hi all,
I have a project in which I am supposed to use mysql. The database
already made up. I am facing an issue with the primary key check.
Whensover i insert a duplicate value for the primary key i end up with
a ticket rather than a graceful handling.
Here's the db model:

db.define_table('document',
 
Field('sno','integer',requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'document.sno')]),
Field('doc_no','string',requires=[IS_NOT_EMPTY()]),
Field('issue','date',requires=[IS_NOT_EMPTY()]),
Field('expiry','date',requires=[IS_NOT_EMPTY()]),
Field('summary','text'),
primarykey=['sno'],
migrate=False,
)


and the error that i receive when duplicating is :

Traceback (most recent call last):
  File /home/paresh/web2py/gluon/restricted.py, line 188, in
restricted
exec ccode in environment
  File /home/paresh/web2py/applications/DB/controllers/appadmin.py,
line 410, in module
  File /home/paresh/web2py/gluon/globals.py, line 96, in lambda
self._caller = lambda f: f()
  File /home/paresh/web2py/applications/DB/controllers/appadmin.py,
line 125, in insert
if form.accepts(request.vars, session):
  File /home/paresh/web2py/gluon/sqlhtml.py, line 1135, in accepts
pk = self.table.insert(**fields)
  File /home/paresh/web2py/gluon/sql.py, line 2566, in insert
return Table.insert(self,**fields)
  File /home/paresh/web2py/gluon/sql.py, line 2037, in insert
self._db._execute(query)
  File /home/paresh/web2py/gluon/sql.py, line 989, in lambda
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
  File /usr/lib/pymodules/python2.6/MySQLdb/cursors.py, line 166, in
execute
self.errorhandler(self, exc, value)
  File /usr/lib/pymodules/python2.6/MySQLdb/connections.py, line 35,
in defaulterrorhandler
raise errorclass, errorvalue
IntegrityError: (1062, Duplicate entry '1-1' for key 'PRIMARY')

I would like to know that do i need to handle the integrity constraint
myself or am i missing on some point

Thanks for the help


Re: [web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread Thadeus Burgess
The biggest contributing factor is that web2py is executed and not import.
The coder must always be sure to align objects and database in the correct
order, including any auxiliary functions, class mappings, queries. He/she
has to worry about the order of everything. Sometimes you can't have such
order for complex systems. I think an import based system solves this in
that the import statements declare the order instead of the physical
location of the code doing that.

--
Thadeus




On Sat, Nov 13, 2010 at 2:49 PM, Jason Brower encomp...@gmail.com wrote:

  These are encouraging.
 In large deployment I mean it in the most external sense of it.  Facebook
 is big, myspace is big, those kinds of object were what I was aiming for.
 And with Massimo's comment about the database size.  I think your right, the
 framework does become less relavent.  In what ways in a large codebase
 making web2py code messier and is there a solution to it in another
 framework?
 BR,
 J

 On Sat, 2010-11-13 at 11:48 -0600, Thadeus Burgess wrote:

 What is large deployment?

 Is it a large codebase that you must manage for an internal dashbaord, or
 just alot of users/database io that needs to scale out for worldwide access?

 If its the first case, web2py can get really complicated in dealing with
 lots of models and difficult to manage in an efficient manner. The larger
 your codebase the messier web2py apps will become. In the end, this would
 ultimately be up to the preferences of you and your team and what your
 willing to put up with.

 In the second case, framework hardly matters at that point. Disqus uses
 django, facebook uses php, reddit uses pylons, myspace uses coldfusion,
 microsoft uses asp, oracle uses java. Its always the database that becomes
 an issue regardless of programming language or web framework.

 --
 Thadeus




  On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu
 wrote:

 I agree with Villas. The larger the development the more the database
 becomes the bottleneck and the framework irrelevant.

 Massimo



 On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
  Hi Jason
 
  I guess you have to define 'large deployment' first of all.  Number of
  records and size of DB? Number of concurrent users? Large data model
  or number of forms etc?  Number of servers -- or replication?  Global
  coverage?
 
  In principle I don't think there's any reason why Web2py would be
  worse than other frameworks.  Usually it is much better!  As an
  example,  I think deploying to the Google App Engine should be able to
  scale sufficiently for everything but extreme cases :)
 
  If you specify more about what you wish to achieve this group may be
  able to give more specific advice how best to organise your project.
 
  -D
 
  On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:
 
   I love web2py and it's the only framework i feel i am fully capable to
 do or learn to do quickly.
   However, I remember see that this framework is intended for small to
 medium sized deployments. Is this true? What is it that stops us from larger
 deployment? Should i pickup django because i may need it?
   Regards,
   jb
 
 






[web2py] DateTime Widget over-written by Auto-Complete suggestions

2010-11-13 Thread villas
Using firefox 3.6.12.

My datetime widget is begin partially obsured by the input field's
autocomplete drop-down box which contains previous inputs.  Maybe the
Z-Index needs fiddling with,  or something...?

If anyone else needs a quick fix / work-around,  I have simply added
the lines hereunder nto the web2py_ajax_init() function in
web2py_ajax.html:

  try { jQuery(input.time).attr('AUTOCOMPLETE', 'OFF')
  ; } catch(e) {};
  try { jQuery(input.datetime).attr('AUTOCOMPLETE', 'OFF')
  ; } catch(e) {};
  try { jQuery(input.date).attr('AUTOCOMPLETE', 'OFF')
  ; } catch(e) {};

Maybe Massimo might prefer to have this as the definitive solution?

Regards,
-D


[web2py] Re: provide a development flag for applications II

2010-11-13 Thread pierreth
I think it would be cool to be able to run a web2py app in debug mode
by using a flag on the command line.


[web2py] Re: provide a development flag for applications II

2010-11-13 Thread pierreth
I think it would be cool to be able to run a web2py app in debug mode
by using a flag on the command line.


[web2py] Re: The primary key constraint on legacy tables

2010-11-13 Thread DenesL

Hi Rishu,

keyed table support is only available for DB2, MS-SQL, Ingres and
Informix so far, as noted in
http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables

but you can contribute to web2py by adding support for mysql by
following point (E) at the bottom of
http://groups.google.com/group/web2py/msg/c9848792a8999c5f

you can always ask for help here if you get stuck.

Alternatively, and if your 'sno' field is an auto-increment field you
can use it as id by changing its definition
Field('sno','id', ...)
(see the same book section as above).

Denes.


On Nov 13, 7:39 pm, Rishu pareshverma...@gmail.com wrote:
 Hi all,
 I have a project in which I am supposed to use mysql. The database
 already made up. I am facing an issue with the primary key check.
 Whensover i insert a duplicate value for the primary key i end up with
 a ticket rather than a graceful handling.
 Here's the db model:

 db.define_table('document',

 Field('sno','integer',requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'document.sno')]),
     Field('doc_no','string',requires=[IS_NOT_EMPTY()]),
     Field('issue','date',requires=[IS_NOT_EMPTY()]),
     Field('expiry','date',requires=[IS_NOT_EMPTY()]),
     Field('summary','text'),
     primarykey=['sno'],
     migrate=False,
     )

 and the error that i receive when duplicating is :

 Traceback (most recent call last):
   File /home/paresh/web2py/gluon/restricted.py, line 188, in
 restricted
     exec ccode in environment
   File /home/paresh/web2py/applications/DB/controllers/appadmin.py,
 line 410, in module
   File /home/paresh/web2py/gluon/globals.py, line 96, in lambda
     self._caller = lambda f: f()
   File /home/paresh/web2py/applications/DB/controllers/appadmin.py,
 line 125, in insert
     if form.accepts(request.vars, session):
   File /home/paresh/web2py/gluon/sqlhtml.py, line 1135, in accepts
     pk = self.table.insert(**fields)
   File /home/paresh/web2py/gluon/sql.py, line 2566, in insert
     return Table.insert(self,**fields)
   File /home/paresh/web2py/gluon/sql.py, line 2037, in insert
     self._db._execute(query)
   File /home/paresh/web2py/gluon/sql.py, line 989, in lambda
     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
   File /usr/lib/pymodules/python2.6/MySQLdb/cursors.py, line 166, in
 execute
     self.errorhandler(self, exc, value)
   File /usr/lib/pymodules/python2.6/MySQLdb/connections.py, line 35,
 in defaulterrorhandler
     raise errorclass, errorvalue
 IntegrityError: (1062, Duplicate entry '1-1' for key 'PRIMARY')

 I would like to know that do i need to handle the integrity constraint
 myself or am i missing on some point

 Thanks for the help


Re: [web2py] The primary key constraint on legacy tables

2010-11-13 Thread Ivan Matveev
2010/11/14 Rishu pareshverma...@gmail.com:
 Hi all,
 I have a project in which I am supposed to use mysql. The database
 already made up. I am facing an issue with the primary key check.
 Whensover i insert a duplicate value for the primary key i end up with
 a ticket rather than a graceful handling.
 Here's the db model:

 db.define_table('document',

 Field('sno','integer',requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'document.sno')]),
    Field('doc_no','string',requires=[IS_NOT_EMPTY()]),
    Field('issue','date',requires=[IS_NOT_EMPTY()]),
    Field('expiry','date',requires=[IS_NOT_EMPTY()]),
    Field('summary','text'),
    primarykey=['sno'],
    migrate=False,
    )


 and the error that i receive when duplicating is :

What is the type of the 'document.sno'?
If its a unique int just set its type to 'id' and don't use primarykey
and everything will work. If you there is some other unique int column
set it to type 'id'. If there is no unique int column create it, it
shell not break functioning of other software that use the database.
DAL keyed tables support is fragile and outdated.


[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread mdipierro
I agree that there are things we can improve in web2py.

Yet, if a complex application have many pieces that are untangled, the
import mechanism does not necessarily help you. The solution is trying
to design components that are relatively independent. If you can do
this, web2py does not bet in the way. For example, you have 100 tables
functionally grouped in ~10 and all they need to share is
authentication, you may want to separate the functions in 10 different
web2py applications (all sharing one database, each defining only the
tables it needs, and sharing one session cookie). This modular design
solves lots of problems.

I have heard of people who have developed complex applications in
Django (which uses the import you suggest) and run into problems
because they were using more ram than needed since all modules were
always imported. In web2py controllers are executed only when called
and if you make many small controllers you save lots of memory.
Controllers than then import the modules they need and only those.

Massimo

On Nov 13, 7:28 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 The biggest contributing factor is that web2py is executed and not import.
 The coder must always be sure to align objects and database in the correct
 order, including any auxiliary functions, class mappings, queries. He/she
 has to worry about the order of everything. Sometimes you can't have such
 order for complex systems. I think an import based system solves this in
 that the import statements declare the order instead of the physical
 location of the code doing that.

 --
 Thadeus

 On Sat, Nov 13, 2010 at 2:49 PM, Jason Brower encomp...@gmail.com wrote:
   These are encouraging.
  In large deployment I mean it in the most external sense of it.  Facebook
  is big, myspace is big, those kinds of object were what I was aiming for.
  And with Massimo's comment about the database size.  I think your right, the
  framework does become less relavent.  In what ways in a large codebase
  making web2py code messier and is there a solution to it in another
  framework?
  BR,
  J

  On Sat, 2010-11-13 at 11:48 -0600, Thadeus Burgess wrote:

  What is large deployment?

  Is it a large codebase that you must manage for an internal dashbaord, or
  just alot of users/database io that needs to scale out for worldwide access?

  If its the first case, web2py can get really complicated in dealing with
  lots of models and difficult to manage in an efficient manner. The larger
  your codebase the messier web2py apps will become. In the end, this would
  ultimately be up to the preferences of you and your team and what your
  willing to put up with.

  In the second case, framework hardly matters at that point. Disqus uses
  django, facebook uses php, reddit uses pylons, myspace uses coldfusion,
  microsoft uses asp, oracle uses java. Its always the database that becomes
  an issue regardless of programming language or web framework.

  --
  Thadeus

   On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu
  wrote:

  I agree with Villas. The larger the development the more the database
  becomes the bottleneck and the framework irrelevant.

  Massimo

  On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
   Hi Jason

   I guess you have to define 'large deployment' first of all.  Number of
   records and size of DB? Number of concurrent users? Large data model
   or number of forms etc?  Number of servers -- or replication?  Global
   coverage?

   In principle I don't think there's any reason why Web2py would be
   worse than other frameworks.  Usually it is much better!  As an
   example,  I think deploying to the Google App Engine should be able to
   scale sufficiently for everything but extreme cases :)

   If you specify more about what you wish to achieve this group may be
   able to give more specific advice how best to organise your project.

   -D

   On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:

I love web2py and it's the only framework i feel i am fully capable to
  do or learn to do quickly.
However, I remember see that this framework is intended for small to
  medium sized deployments. Is this true? What is it that stops us from larger
  deployment? Should i pickup django because i may need it?
Regards,
jb




[web2py] Re: Discussion: Why is web2py bad for large deployments?

2010-11-13 Thread blackthorne
I think that as long as you develop good code, choose a good
interpreter, use assynchronous requests as adequate and good caching,
you shouldn't have many constraints other than the database. There, I
think there is no work-around. You have to make specific/manual DB
handling for each DBMS to assure good scalibility. Out of the box,
there aren't many things like this that do much better.

On Nov 14, 3:41 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree that there are things we can improve in web2py.

 Yet, if a complex application have many pieces that are untangled, the
 import mechanism does not necessarily help you. The solution is trying
 to design components that are relatively independent. If you can do
 this, web2py does not bet in the way. For example, you have 100 tables
 functionally grouped in ~10 and all they need to share is
 authentication, you may want to separate the functions in 10 different
 web2py applications (all sharing one database, each defining only the
 tables it needs, and sharing one session cookie). This modular design
 solves lots of problems.

 I have heard of people who have developed complex applications in
 Django (which uses the import you suggest) and run into problems
 because they were using more ram than needed since all modules were
 always imported. In web2py controllers are executed only when called
 and if you make many small controllers you save lots of memory.
 Controllers than then import the modules they need and only those.

 Massimo

 On Nov 13, 7:28 pm, Thadeus Burgess thade...@thadeusb.com wrote:



  The biggest contributing factor is that web2py is executed and not import.
  The coder must always be sure to align objects and database in the correct
  order, including any auxiliary functions, class mappings, queries. He/she
  has to worry about the order of everything. Sometimes you can't have such
  order for complex systems. I think an import based system solves this in
  that the import statements declare the order instead of the physical
  location of the code doing that.

  --
  Thadeus

  On Sat, Nov 13, 2010 at 2:49 PM, Jason Brower encomp...@gmail.com wrote:
    These are encouraging.
   In large deployment I mean it in the most external sense of it.  Facebook
   is big, myspace is big, those kinds of object were what I was aiming for.
   And with Massimo's comment about the database size.  I think your right, 
   the
   framework does become less relavent.  In what ways in a large codebase
   making web2py code messier and is there a solution to it in another
   framework?
   BR,
   J

   On Sat, 2010-11-13 at 11:48 -0600, Thadeus Burgess wrote:

   What is large deployment?

   Is it a large codebase that you must manage for an internal dashbaord, or
   just alot of users/database io that needs to scale out for worldwide 
   access?

   If its the first case, web2py can get really complicated in dealing with
   lots of models and difficult to manage in an efficient manner. The larger
   your codebase the messier web2py apps will become. In the end, this would
   ultimately be up to the preferences of you and your team and what your
   willing to put up with.

   In the second case, framework hardly matters at that point. Disqus uses
   django, facebook uses php, reddit uses pylons, myspace uses coldfusion,
   microsoft uses asp, oracle uses java. Its always the database that becomes
   an issue regardless of programming language or web framework.

   --
   Thadeus

    On Sat, Nov 13, 2010 at 10:53 AM, mdipierro mdipie...@cs.depaul.edu
   wrote:

   I agree with Villas. The larger the development the more the database
   becomes the bottleneck and the framework irrelevant.

   Massimo

   On Nov 13, 8:35 am, villas villa...@gmail.com wrote:
Hi Jason

I guess you have to define 'large deployment' first of all.  Number of
records and size of DB? Number of concurrent users? Large data model
or number of forms etc?  Number of servers -- or replication?  Global
coverage?

In principle I don't think there's any reason why Web2py would be
worse than other frameworks.  Usually it is much better!  As an
example,  I think deploying to the Google App Engine should be able to
scale sufficiently for everything but extreme cases :)

If you specify more about what you wish to achieve this group may be
able to give more specific advice how best to organise your project.

-D

On Nov 13, 7:12 am, Jason Brower encomp...@gmail.com wrote:

 I love web2py and it's the only framework i feel i am fully capable to
   do or learn to do quickly.
 However, I remember see that this framework is intended for small to
   medium sized deployments. Is this true? What is it that stops us from 
   larger
   deployment? Should i pickup django because i may need it?
 Regards,
 jb


[web2py] Re: web2py 1.89.1 is OUT... update?

2010-11-13 Thread mart
Hi, yes, I did restart the server... The install (no upgrade) was
obviously as smooth as ever. I did look a little deeper in the folder
that was upgraded, and realized that I was upgrading something I
grabbed from trunk instead  of a the previous official release. In
which case, I would not expect anyone or any organization to support
this type of upgrade path. Not sure why it id that, but I would say
that it is 1) my bad for upgrading an what should be for testing and
development 2) my bad, ... well just because. I did look around and
can't see any reason why the web2py upgrade would have broken the
installed server (i probably had something that would have broken it
at the next stop/start of the server anyways).


BTW - does look great!

On Nov 13, 1:10 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Did you restart the server?

 On Nov 12, 11:13 pm, mart msenecal...@gmail.com wrote:

  hum... the upgrade broke my running instance of web2py (not a big
  deal, I'll just install (not upgrade) to a different folder). Since,
  this seems to only happen to me, I can assume that it is something I
  have in current web2py folder (or on my system)... wish I knew what
  the oddity was so I could report better The strange thing, is
  that i get a continuous cycle of tickets. While trying to view the
  ticket, I get a new ticket (different number), and this just keeps on
  going... anyways, thought you may want to know tat this is happening.

  Tanks
  Mart :)

  On Nov 12, 11:55 pm, Alex yue.a...@gmail.com wrote:

   Maybe a bug?

   When I create a .LOAD component, the save doesn't seem to work in IE
   or Firefox.

   On Nov 12, 10:44 pm, mdipierro mdipie...@cs.depaul.edu wrote:

The fact is after you upgrade you get the new admin which uses a new
API function. Unless you restart the server that API function is not
available. This is a one time event since we never made such a big
change in admin.

On Nov 12, 7:26 pm, Anthony abasta...@gmail.com wrote:

 I had the same exact experience on Windows (in IE). Here's the
 traceback I got:

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 188, in restricted
     exec ccode in environment
   File C:\web2py\applications\admin/views\default/site.html, line
 182, in module
 AttributeError: 'translator' object has no attribute
 'get_possible_languages'

 Referring to:

   for language in T.get_possible_languages():

 Like Andrew, everything was fine after restarting web2py.

 Anthony

 On Nov 12, 7:20 pm, Andrew Thompson andre...@aktzero.com wrote:

  On 11/12/2010 4:58 PM, mdipierro wrote: ps. may not work on windows

  I doubt this is what you meant, but I seem to have hit a snag with 
  the
  upgrade.

  web2py is running on ubuntu, but I'm managing it from chrome on 
  win7.
  After upgrading, the redirect back failed. Attempting to reload the
  admin page gave me more failures.

  If anyone wants to glance over the error files:

 http://aktzero.com/static/scratch/___127.0.0.1.2010-11-12.19-03-0..

  Restarting the web2py process cleared it up, and it seems to be ok. 
  I've
  got the new admin interface, and my small handfull of sites are 
  still
  running.

  --
  Andrew Thompsonhttp://aktzero.com/-Hidequotedtext -

- Show quoted text -




  1   2   >