Re: [web2py] support-ticket plugin

2011-09-08 Thread Kenneth Lundström

Hi Martin,

in my billing/customer/product application I have a simple ticket 
system. It would be easy to use only the ticket part if needed. I´m 
going to put up an english version of the application during the 
weekend. Then you can look at it.



Kenneth


Hi,

does somebody knows a plugin for a support ticket system?
Desired function: something like
1.  the user fills a form or sends an email,
2.  web2py creates and sends a ticket to the admin of the webpage
3.  the admin answers
4.  the user can answer again or the ticket will be closed after some days

Regards, Martin




[web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Noel Villamor

Thanks for this Bruno. I was able to use your code/hint to craft my
own specialized validator. lol

Noel


On Sep 9, 3:06 pm, Bruno Rocha  wrote:
> class IS_LIST(object):
>     def __call__(self, value):
>             mylist = value.split(",")
>             for item in mylist:
>                  val, error = IS_INT_IN_RANGE(0,10)(item)
>                  if error:
>                     return (val, error)
>             return (mylist, None)
>
>
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 11:44 PM, Noel Villamor  wrote:
>
> > That worked!  Thanks Bruno.
>
> > I wonder now if I can do further validation to ensure that all items
> > are integers and in a specific range. In particular, I wanted to use
> > the already available validator IS_INT_IN_RANGE. Something like:
>
> > IS_LIST(IS_INT_IN_RANGE(0, 10))
>
> > It is hacking time.
>
> > :)
>
> > On Sep 9, 2:21 pm, Bruno Rocha  wrote:
> > > May be there is a better way, but I should start with this:
>
> > > class IS_LIST(object):
> > >     def __call__(self, value):
> > >             mylist = value.split(",")
> > >             return (mylist, None)
>
> > > Field("fld", "list:integer", widget=SQLFORM.widgets.string.widget,
> > > requires=IS_LIST() )
>
> > > --
> > > Bruno Rocha
> > > [ About me:http://zerp.ly/rochacbruno]
>
> --
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]


[web2py] Re: gluon.widget.start(cron=True)

2011-09-08 Thread annet
Massimo,

Thanks for your reply, now I know why I saved the file and referenced
it memory usage: I commented out import gluon.import_all which in
newer web2py versions is commented out by default?

Which leads to another question: At webfaction the Web2py installation
that I have is running behind Apache + mod_wsgi. Since I schedule cron
tasks outside web2py, I guess I could set
gluon.widget.start(cron=True) to gluon.widget.start(cron=False), don't
I?


Kind regards,

Annet.


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Dijkstra

It works, thanks :)
Next step is to upgrade the HTML code because this just looks like text.

regards, Richard


Op 8-9-2011 23:30, Anthony schreef:
No, you need to add return dict() to the end of you index() function 
in your controller -- not to the view file.


Anthony

On Thursday, September 8, 2011 4:45:51 PM UTC-4, Richard wrote:

The view is not executed. Adding return dict() doesn't have
effect. Even this dict() does not lead to an error.

{{extend 'layout.html'}}
{{if 'message' in globals():}}

 Outfile from Matplotlib



return dict()



Op 8-9-2011 22:24, Anthony schreef:

Have you shown us your entire index() function? If so, your view
file isn't getting called at all because your index function is
not returning a dictionary. Instead, web2py is simply returning
whatever your function returns, which is probably None if the
last line is a call to plt.savefig(). Add return dict() to the
end of your index function, and see if it works. Views are only
called if the controller function returns a dictionary.

Anthony

On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote:

The mp1.png file is in the static directory of my application

The following views/default/index  only gives an empty page
with"None"  in the top left corner.

{{left_sidebar_enabled=right_sidebar_enabled=False}}

{{extend 'layout.html'}}
{{if 'message' in globals():}}

{{=message}}

#Events
#{{=db().select(db.Events.ALL)}}

 Outfile from Matplotlib



{{else:}}
{{=BEATIFY(response.vars)}}
{{pass}}

{{block left_sidebar}}New Left Sidebar Content{{end}}
{{block right_sidebar}}New Right Sidebar Content{{end}}


Op 7-9-2011 23:35, Richard Dijkstra schreef:

Looking closer an output window appears and the console
gives errors on the sequence of calling matplotlib.backends:

I'll check first.



Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:


But does

plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png')
result in a file being saved in
c:\web2py\applications\your_app\static\?


On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard
wrote:

Anthony,

plt.savefig('c:\web2py\outputfile.png',format='png')

does me give an accessable png-file

Op 7-9-2011 22:20, Anthony schreef:

Have you confirmed that the file is actually getting
saved in the expected location? Are you able to run
the matplotlib code and save the file outside of web2py?


On Wednesday, September 7, 2011 4:05:08 PM UTC-4,
Richard wrote:

Only adding the .png extention is not sufficient.

outputfile =
os.path.join(request.folder,'static','mp1.png')
plt.savefig(outputfile,format='png')


 Outfile from Matplotlib




Besides this issue; is using a temporarily file a
mature solution or is streaming preferrable?

Richard


Op 7-9-2011 21:46, Anthony schreef:

On Wednesday, September 7, 2011 3:35:23 PM UTC-4,
Richard wrote:





Should be URL('static','mp1.png').

Anthony


Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van 
uitgifte: 09/02/11 08:34:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00







Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 
09/05/11 08:35:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 
09/05/11 08:35:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
08:35:00





[web2py] support-ticket plugin

2011-09-08 Thread Martin Weissenboeck
Hi,

does somebody knows a plugin for a support ticket system?
Desired function: something like
1.  the user fills a form or sends an email,
2.  web2py creates and sends a ticket to the admin of the webpage
3.  the admin answers
4.  the user can answer again or the ticket will be closed after some days

Regards, Martin


[web2py] Access admin from local when deployed with Apache on Windows.

2011-09-08 Thread seongjoo
Hello,

I am having some difficulty to access admin interface from localhost
when my web2py application is deployed with Apache server on Windows.
Although I can check whether the app is working on my local
workstation, but I would like to check app status and see whether
values in database are correct when "real" people use it on the
development server before packaging the app as binary.


[web2py] Re: Web2py is in the Bossie awards

2011-09-08 Thread Rahul
Congratulations to All. :) What an Excellent Framework This is!

Cheers Rahul.

On Sep 8, 8:47 pm, Massimo Di Pierro 
wrote:
> And congratulations again to all users and contributors!
>
> On Sep 8, 2:01 am, Mike Veltman  wrote:
>
>
>
>
>
>
>
> > I dont know if someone else already mentioned it. But web2py is in the 
> > Bossie
> > awards. ;-)
>
> > Congrats
>
> >http://www.infoworld.com/d/open-source-software/bossie-awards-2011-th...
> > open-source-software-the-year-171567-1
>
> > With regards,
> > Mike Veltman


[web2py] Re: deploying web2py on IIS

2011-09-08 Thread Omi Chiba
Any information is very helpful for me if there is any IIS users who
successfully running web2py with this receipt 2 (ISAPI+WSGI).

On Sep 8, 11:43 am, Omi Chiba  wrote:
> Remco,
>
> I'm another guy struggling with IIS.
> Following the Receipt 2 for ISAPI and I'm lost at 2.3.2. If possible,
> can you explain what I should do from here.
>
> So far, virtual directory "ochibaapp" (Renamed it from appname) is
> created under "Default Web Site". I have setup junction for C:\w2p
> \application just like in the step and it's empty now.
>
> http://www.web2pyslices.com/slices/take_slice/128
>
> On Sep 8, 7:10 am, Remco  wrote:
>
>
>
>
>
>
>
> > You can doIISwith WSGI:http://code.google.com/p/isapi-wsgi/soyou
> > don't host two webservers, but only one.
>
> > Hope this helps.
>
> > Regards,
> > Remco Boerma
>
> > On 6 sep, 12:03, Web2Py Freak  wrote:
>
> > > how can i deploy web2py onIIS??


[web2py] Re: DAL insert dictionary fails

2011-09-08 Thread seongjoo
Hello,

It looks like:

dict = {'email':''u...@email.com', 'name':'dude', 'accesskey': [some
hash string]}

I tried insertion with other table and other dict and it worked. So I
figured that, as you properly guessed, it must be the problem relating
the dict that I am trying to insert.

But what puzzles me is that if the dict is the source of the problem,
why wouldn't db.table.bulk_insert([dict]) fail?

On 9월8일, 오후11시20분, Bruno Rocha  wrote:
> How your dict looks like?
>
> http://zerp.ly/rochacbruno
> Em 08/09/2011 11:10, "seongjoo"  escreveu:
>
>
>
>
>
>
>
> > Hello,
>
> > I am using web2py 1.98.2.
>
> > The problem is that below instruction fails with error message:
> > "TypeError: insert() keywords must be strings"
>
> > db.table.insert(**dictionary)
>
> > While db(query).update(**dictionary) works find.
>
> > For now, I have to use as a workaround as below.
>
> > bulk_insert( [dictionary] )
>
> > What would be wrong?


Re: [web2py] Using web2py and deck.js to make HTML5 presentation

2011-09-08 Thread Bruno Rocha
Thank you! I am going to use your source code to prepare my talk for PyCon
Brasil next month.



On Thu, Sep 8, 2011 at 11:35 PM, chinakr  wrote:

> web2py is one of the most popular Web Frameworks. web2py has MVC
> architecture, offering us excellent development efficiency and
> extensibility. web2py is very suitable for Web application
> development.
>
> deck.js is a JavaScript library for making HTML5 presentation. It
> supports keyboard navigation, themes switching and extensions. With
> deck.js, making HTML5 presentation becomes easy, beautiful and
> convinient.
>
> SEO Brief Guide is a HTML5 presentation developing with web2py and
> deck.js, wich is free and open source.
>
> Demo:
> http://openclass.vstudy.cn/seo/training
>
> Source code:
> http://vstudy.htexam.net/soft/download/web2py.app.openclass.w2p




-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Cliff
Extend your ORM thinking a little - have one controller for each
object table in your application.

I do not ordinarily create controllers for many-to-many linking
tables.

On Sep 8, 2:22 pm, Luca  wrote:
> I am new to web2py (I've been using Django), and I am confused about a
> couple of things.
>
> First, the presence of multiple controllers.
> I am trying to build a main app, called (say)www.example.com.
> So I would like to have something likewww.example.com/index.html
> But if I use the default.py controller, the URL that is automatically mapped
> is default/index.html, not index.html directly.  How do people typically
> organize their URL schema?
>
> Second, in the default setup, I see db.py and menu.py.   In db.py it is
> noted that I should really add my table declarations to another model file.  
> But, all the logic to decide if web2py is running on appengine or not, etc,
> is all in db.py; if I write my table declarations in another file, do I have
> to cut and paste that logic?  Or how is this supposed to work?  All the
> example in the tutorial just edit db.py.
>
> Many thanks! --Luca


Re: [web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Bruno Rocha
class IS_LIST(object):
def __call__(self, value):
mylist = value.split(",")
for item in mylist:
 val, error = IS_INT_IN_RANGE(0,10)(item)
 if error:
return (val, error)
return (mylist, None)


On Thu, Sep 8, 2011 at 11:44 PM, Noel Villamor  wrote:

>
> That worked!  Thanks Bruno.
>
> I wonder now if I can do further validation to ensure that all items
> are integers and in a specific range. In particular, I wanted to use
> the already available validator IS_INT_IN_RANGE. Something like:
>
> IS_LIST(IS_INT_IN_RANGE(0, 10))
>
> It is hacking time.
>
> :)
>
>
>
> On Sep 9, 2:21 pm, Bruno Rocha  wrote:
> > May be there is a better way, but I should start with this:
> >
> > class IS_LIST(object):
> > def __call__(self, value):
> > mylist = value.split(",")
> > return (mylist, None)
> >
> > Field("fld", "list:integer", widget=SQLFORM.widgets.string.widget,
> > requires=IS_LIST() )
> >
> > --
> > Bruno Rocha
> > [ About me:http://zerp.ly/rochacbruno]
>



-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


[web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Noel Villamor

That worked!  Thanks Bruno.

I wonder now if I can do further validation to ensure that all items
are integers and in a specific range. In particular, I wanted to use
the already available validator IS_INT_IN_RANGE. Something like:

IS_LIST(IS_INT_IN_RANGE(0, 10))

It is hacking time.

:)



On Sep 9, 2:21 pm, Bruno Rocha  wrote:
> May be there is a better way, but I should start with this:
>
> class IS_LIST(object):
>     def __call__(self, value):
>             mylist = value.split(",")
>             return (mylist, None)
>
> Field("fld", "list:integer", widget=SQLFORM.widgets.string.widget,
> requires=IS_LIST() )
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]


[web2py] Using web2py and deck.js to make HTML5 presentation

2011-09-08 Thread chinakr
web2py is one of the most popular Web Frameworks. web2py has MVC
architecture, offering us excellent development efficiency and
extensibility. web2py is very suitable for Web application
development.

deck.js is a JavaScript library for making HTML5 presentation. It
supports keyboard navigation, themes switching and extensions. With
deck.js, making HTML5 presentation becomes easy, beautiful and
convinient.

SEO Brief Guide is a HTML5 presentation developing with web2py and
deck.js, wich is free and open source.

Demo:
http://openclass.vstudy.cn/seo/training

Source code:
http://vstudy.htexam.net/soft/download/web2py.app.openclass.w2p


Re: [web2py] Data entry for list:integer or list:string field

2011-09-08 Thread Bruno Rocha
May be there is a better way, but I should start with this:

class IS_LIST(object):
def __call__(self, value):
mylist = value.split(",")
return (mylist, None)

Field("fld", "list:integer", widget=SQLFORM.widgets.string.widget,
requires=IS_LIST() )



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]


Re: [web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Bruno Rocha
Also, if you do not want some object to be always available, you can use
conditional models. creating subfolders in /models matching
controller/action names.


[web2py] Re: List widget issue when invalid form

2011-09-08 Thread rdmurphy
I checked trunk and still getting the issue. Ticket 414 opened.
http://code.google.com/p/web2py/issues/detail?id=414

Thanks


On Sep 7, 10:53 pm, Massimo Di Pierro 
wrote:
> I think it is a bug. Please check this is not already fixed in trunk,
> if not please open a ticket. thanks for the work of tracking down the
> problem.
>
> On Sep 7, 4:58 pm, rdmurphy  wrote:
>
>
>
>
>
>
>
> > Hi Massimo and web2py team,
> > Just following up on this issue. If you guys agree it's a bug I can
> > open a ticket for it.
>
> > Thanks
> > Ryan
>
> > On Aug 29, 4:03 pm, rdmurphy  wrote:
>
> > > Hi everyone,
> > > Since it's my first post, I'd like to first say great framework to the
> > > whole team. I'm really enjoying using it.
>
> > > I think I've found a small bug in the handling of list fields in an
> > > invalid form.
> > > I have a list:string field and another required field.
>
> > > When there is only 1 input field and value for the list field and the
> > > submitted form is invalid (the other field is invalid), the returned
> > > error form splits my 1 value up into individual characters since it
> > > assumes the request.var is an array.
>
> > > I've traced it down to sqlhtml in this section around row 1090:
>
> > > if hasattr(field, 'widget') and field.widget and fieldname in
> > > request_vars:
> > >     if fieldname in self.vars:
> > >         value = self.vars[fieldname]
> > > etc
> > > widget = field.widget(field, value)
>
> > > Then ListWidget exects to be getting an array as the value.
>
> > > So might need a check on the value type if using self.vars, like:
> > > if field.type.startswith('list:') and isinstance(value, str):
> > >     value = [value]
>
> > > Thanks
> > > Ryan


[web2py] Re: LOAD ajax=True and non submit buttons

2011-09-08 Thread Anthony
Can you give an example?

On Thursday, September 8, 2011 5:55:22 PM UTC-4, DenesL wrote:
>
>
> Components with buttons that are meant for client side scripting are 
> being reloaded via ajax post request (I think), shouldn't this 
> behavior be limited to the submit button?. 
>
>
>

[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Anthony
You might also find this of interest (particularly the first section about 
exec): http://web2py.com/AlterEgo/default/show/271

Anthony

On Thursday, September 8, 2011 9:28:45 PM UTC-4, Anthony wrote:
>
> Yes, in this regard web2py is not quite like most other Python web 
> frameworks. All of your model files are executed in a prepared environment 
> that includes various framework objects, such as request, response, session, 
> and many of the API objects. Your controller is then executed in that 
> environment after the models have been run, so whatever objects have been 
> created in your models are available in the controller. If your controller 
> function returns a dictionary, the execution environment is then updated to 
> include the items in the dictionary, and your view is executed in that 
> updated environment.
>
> So, the "boundaries of this happy sharing," as you put it, are the model, 
> controller, and view files (note, the view files see everything created in 
> the model files, but only the items returned in the dictionary of the 
> controller function, not any other objects created in the controller).
>
> Any other code you want to access (e.g., Python standard library, Python 
> site-packages, files in your application's 'modules' folder) have to be 
> imported as usual.
>
> See http://web2py.com/book/default/chapter/04#Dispatching (particularly 
> the bulleted list near the end of the section) and 
> http://web2py.com/book/default/chapter/04#Execution-Environment (first 
> paragraph).
>
> Anthony
>
> On Thursday, September 8, 2011 8:13:05 PM UTC-4, Luca wrote:
>>
>> I understand, but this is very un-python like and weird... you mean that 
>> if I have 
>>
>> a = 1
>>
>> in a file, and then load another file, then a is still 1 also in the other 
>> file?  This is incredibly weird to me -- normally, files have to import each 
>> other to share variables in this way. 
>>
>> Ok... now I just wonder what the precise boundaries of this happy sharing 
>> are.  Thanks!!
>>
>> Luca
>>
>

[web2py] Data entry for list:integer or list:string field

2011-09-08 Thread Noel Villamor
I wanted the data entry of a list type field as a plain text box with
comma separated data values. Thus, in my model,I defined the field as:

Field('fld', 'list:integer', widget=SQLFORM.widgets.string.widget)

Using a crud.create form, what extra steps should I do to be able to
save a value such as '10,8,2' as a proper list data in the database?



[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Anthony
Yes, in this regard web2py is not quite like most other Python web 
frameworks. All of your model files are executed in a prepared environment 
that includes various framework objects, such as request, response, session, 
and many of the API objects. Your controller is then executed in that 
environment after the models have been run, so whatever objects have been 
created in your models are available in the controller. If your controller 
function returns a dictionary, the execution environment is then updated to 
include the items in the dictionary, and your view is executed in that 
updated environment.

So, the "boundaries of this happy sharing," as you put it, are the model, 
controller, and view files (note, the view files see everything created in 
the model files, but only the items returned in the dictionary of the 
controller function, not any other objects created in the controller).

Any other code you want to access (e.g., Python standard library, Python 
site-packages, files in your application's 'modules' folder) have to be 
imported as usual.

See http://web2py.com/book/default/chapter/04#Dispatching (particularly the 
bulleted list near the end of the section) and 
http://web2py.com/book/default/chapter/04#Execution-Environment (first 
paragraph).

Anthony

On Thursday, September 8, 2011 8:13:05 PM UTC-4, Luca wrote:
>
> I understand, but this is very un-python like and weird... you mean that if 
> I have 
>
> a = 1
>
> in a file, and then load another file, then a is still 1 also in the other 
> file?  This is incredibly weird to me -- normally, files have to import each 
> other to share variables in this way. 
>
> Ok... now I just wonder what the precise boundaries of this happy sharing 
> are.  Thanks!!
>
> Luca
>


[web2py] Re: About the welcome app

2011-09-08 Thread Massimo Di Pierro
First time I see it. I downloaded but does not run, shows a page that
only lets me select the languages. Before I look at the source code...
can you make it work?

On Sep 8, 5:11 pm, António Ramos  wrote:
> What? cant believe it
>
> see thishttp://code.google.com/p/web2pyadmin2/
>
> 2011/9/8 Massimo Di Pierro 
>
>
>
>
>
>
>
> > Never heard of it before.
>
> > On Sep 8, 11:01 am, António Ramos  wrote:
> > > does the web2py-adm...@googlegroups.com still exists?
>
> > > What do they have about the new admin they talked about months ago?
>
> > > 2011/9/8 Massimo Di Pierro 
>
> > > > This is a problem indeed.
>
> > > > Anyway, I think it would be a good idea to have a convention about
> > > > icons representing apps. Listing all the apps publicly does not belong
> > > > in welcome and it is a security hazard. there could be a public page
> > > > in admin that does that and admin can be disabled anyway.
>
> > > > On Sep 8, 8:45 am, Richard Vézina  wrote:
> > > > > But the idea of António is pretty nice...
>
> > > > > Only one problem, the speed of development web2py seems to generate
> > > > obsolete
> > > > > code in the applications published that force Massimo to launch adopt
> > an
> > > > App
> > > > > movement... I don't know if it as work until now... I think this
> > should
> > > > be
> > > > > fixed first, I mean make evolve the published apps at the same rythm
> > of
> > > > > evolution than web2py...
>
> > > > > Richard
>
> > > > > On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
> > > > > > The 'welcome' app is intended to be a scaffolding upon which to
> > build
> > > > an
> > > > > > app. The app selector you suggest might be more appropriate for
> > > > inclusion in
> > > > > > the 'admin' app (where the 'welcome' app could be one of the
> > choices).
>
> > > > > > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
>
> > > > > >> I think the welcome app should be for users to see all apps
> > available
> > > > > >> i would like to see an welcome app like the attached file
> > > > > >> All apps are associated with an icon for easy remembering
>
> > > > > >> António
>
> > > > > >> 2011/9/8 pbreit 
>
> > > > > >> I certainly would not call it useless. It provides a bit of
> > > > information
> > > > > >>> about how pages get rendered as well as some useful links.
>
> > > > > >>> Do you have any suggestions for how to improve?


[web2py] Re: Date Picker Widget

2011-09-08 Thread Massimo Di Pierro
can you send me a patch (until a get one for a better calendar ;-)

On Sep 8, 4:31 pm, Richard Vézina  wrote:
> Ok, putting much more then the basic z-index init of dialog works find at
> least...
>
> I don't see when you want a datepicker to be behind an other element?!
>
> Richard
>
> On Thu, Sep 8, 2011 at 5:27 PM, Richard Vézina
> wrote:
>
>
>
>
>
>
>
> > God... The fix seems to work only for the first trigger of the popup...
>
> > Richard
>
> > On Thu, Sep 8, 2011 at 5:25 PM, Richard Vézina <
> > ml.richard.vez...@gmail.com> wrote:
>
> >> It seems that you can initialise dialog with a given zIndex
>
> >> And the default zIndex that I have in the js is zIndex: 1000
>
> >> I just read the js and it seems to change between 1000 and 1001... I try
> >> with 1002 in the .calendar css class of "web2py datepicker" and it works
> >> find.
>
> >> Don't know maybe adding a note in the css file of the "web2py datepicker"
> >> near the z-index parameter should be done to inform user of what to do in
> >> case of problem...
>
> >> ;-)
>
> >> Richard
>
> >> On Thu, Sep 8, 2011 at 5:11 PM, Richard Vézina <
> >> ml.richard.vez...@gmail.com> wrote:
>
> >>> .calendar{
> >>>     z-index: 1000;
> >>>     position: relative;
> >>>     display: none;
> >>>     border-right: 1px solid #808080;
> >>>     border-left: 1px solid #808080;
> >>>     border-bottom: 1px solid #808080;
> >>>     font-size: 11px;
> >>>     color: #9A9A9A;
> >>>     cursor: default;
> >>>     background: #fafaed;
> >>>     font-family: Arial, Helvetica,sans-serif;
> >>> }
>
> >>> SOLVED
>
> >>> It maybe to much should check the dialog plugin and put just one value
> >>> above...
>
> >>>  Richard
>
> >>> On Thu, Sep 8, 2011 at 5:07 PM, Richard Vézina <
> >>> ml.richard.vez...@gmail.com> wrote:
>
>  I have the same problem is you find a solution...
>
>  I will try with z-index, but I am not sure if it will work, should pick
>  one upper the dialog plugin use if it's the source of the problem.
>
>  Richard
>
>  On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard <
>  p...@gerrardconsulting.com> wrote:
>
> > Hi,
>
> > I used this css as is (although I did change the background colour to
> > match my site. however... I'm using the dat picker on a field
> > displayed in a jquerydialog. the datepicket pops up - behind the
> > dialog box. I think the z-indexvalue needs bumping up (or is it
> > down?)
>
> > Looks good tho :O)
>
> > On Sep 7, 7:23 am, annet  wrote:
> > > Hi David,
>
> > > I didn't like the calendar that comes with web2py, not for its
> > > functionality but for its appearance. Instead of replacing it I just
> > > restyled it:
>
> > > .calendar {
> > >   cursor: default;
> > >   background-color: #FF;
> > >   color: #44;
> > >   font-size: 11px;
> > >   border: 1px solid #AA;
> > >   border-radius: 6px;
> > >   -webkit-border-radius: 6px;
> > >   -moz-border-radius: 6px;
> > >   padding: 6px;}
>
> > > .calendar table {
> > >   border-collapse: separate;
> > >   border-spacing: 2px;}
>
> > > .calendar thead {}
> > > .calendar thead tr, .calendar thead .headrow {
> > >   background-color: #4169E1;
> > >   color: #44;}
>
> > > .calendar thead .daynames {}
> > > .calendar .button, .calendar thead .title {
> > >   color: #FF;
> > >   font-size: 12px;
> > >   text-align: center;
> > >   padding: 3px;}
>
> > > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
> > > thead .headrow .hilite, .calendar thead .headrow .active {
> > >   background-color: #FF;
> > >   color: #4169E1;
> > >   padding: 3px;}
>
> > > .calendar thead .daynames .hilite, .calendar thead .daynames .active
> > {
> > >   background-color: #FF;
> > >   color: #44;}
>
> > > .calendar thead .name {
> > >   background-color: #FF;
> > >   text-align: center;
> > >   padding: 3px;}
>
> > > .calendar tbody {}
> > > .calendar tbody td {
> > >   text-align: right;
> > >   border: 1px solid #AA;}
>
> > > .calendar tbody td.hilite {
> > >   background-color: #77;
> > >   color: #FF;}
>
> > > .calendar tbody td.active, .calendar tbody td.selected {
> > >   font-weight: bold;
> > >   background-color: #FF;
> > >   color: #4169E1;}
>
> > > .calendar tbody td.today {
> > >   font-weight: bold;
> > >   background-color: #4169E1;
> > >   color: #FF;}
>
> > > .calendar tbody .disabled {
> > >   color: #77;}
>
> > > .calendar tbody .emptycell {
> > >   visibility: hidden;}
>
> > > .calendar tbody .emptyrow {
> > >   display: none;}
>
> > > .calendar tfoot .ttip {
> > >   background-color: #77;
> > >   color: #FF;
> > >   text-align: center;
> > >   border: 1px solid #33;
> > >   padding: 1px;}
>
> 

[web2py] Re: Where to find in-depth documentation?

2011-09-08 Thread Anthony
Have you read through this 
chapter: http://web2py.com/book/default/chapter/07

In particular:
http://web2py.com/book/default/chapter/07#SQLFORM.factory
http://web2py.com/book/default/chapter/07#Custom-forms
http://web2py.com/book/default/chapter/07#SQLFORM-in-HTML

There's also http://www.web2pyslices.com/search?criteria=tags&query=form.

Anthony

On Thursday, September 8, 2011 8:22:23 PM UTC-4, Luca wrote:
>
> I am new to web2py, as I mentioned in another post, and I am wondering 
> where to find in-depth documentation. 
> Let me give you an example.  I wanted to do a form that does not correspond 
> to a db table, and that has several input fields.  I also wanted to render 
> it in a table. 
>
> In the English web2py book, all the examples are with forms which (a) 
> either have only one input field, or (b) are derived more or less directly 
> from db tables.  I could not find clear documentation anywhere on how to 
> cook up my own funny form.  In the end, I understood, or so I think, and I 
> wrote something like
>
> form = FORM(TABLE(
> TR(TD('City'), TH(INPUT(_name='city', requires=IS_NOT_EMPTY(,
> TR(TD('County'), TH(INPUT(_name='county'))),
> INPUT(_value='Add', _type='submit', _action=URL('add'
>
> I have no idea whether this is the best way -- I would have preferred to 
> leave the HTML tags in the view, rather than in the controller, but then I 
> could find no explanation on how to access the components of a form in a 
> view. 
>
> Now, the problem is not so much in this form.  The problem is, where is 
> documentation that is more in-depth than the overview given in the book?  I 
> ran into this problem not only with forms, but with database fields (e.g., 
> default=now as cited in the book does not work for datetime fields), with 
> the role of controllers, with the way in which models are loaded... 
>
> When _you_ need this information, where do you find it?  What's the secret 
> source of knowledge I am missing? :-) 
>
> Luca
>


Re: [web2py] Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Luca
Thank you, this is very helpful indeed. 
Luca


[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Luca
I understand, but this is very un-python like and weird... you mean that if 
I have 

a = 1

in a file, and then load another file, then a is still 1 also in the other 
file?  This is incredibly weird to me -- normally, files have to import each 
other to share variables in this way. 

Ok... now I just wonder what the precise boundaries of this happy sharing 
are.  Thanks!!

Luca


[web2py] Where to find in-depth documentation?

2011-09-08 Thread Luca
I am new to web2py, as I mentioned in another post, and I am wondering where 
to find in-depth documentation. 
Let me give you an example.  I wanted to do a form that does not correspond 
to a db table, and that has several input fields.  I also wanted to render 
it in a table. 

In the English web2py book, all the examples are with forms which (a) either 
have only one input field, or (b) are derived more or less directly from db 
tables.  I could not find clear documentation anywhere on how to cook up my 
own funny form.  In the end, I understood, or so I think, and I wrote 
something like

form = FORM(TABLE(
TR(TD('City'), TH(INPUT(_name='city', requires=IS_NOT_EMPTY(,
TR(TD('County'), TH(INPUT(_name='county'))),
INPUT(_value='Add', _type='submit', _action=URL('add'

I have no idea whether this is the best way -- I would have preferred to 
leave the HTML tags in the view, rather than in the controller, but then I 
could find no explanation on how to access the components of a form in a 
view. 

Now, the problem is not so much in this form.  The problem is, where is 
documentation that is more in-depth than the overview given in the book?  I 
ran into this problem not only with forms, but with database fields (e.g., 
default=now as cited in the book does not work for datetime fields), with 
the role of controllers, with the way in which models are loaded... 

When _you_ need this information, where do you find it?  What's the secret 
source of knowledge I am missing? :-) 

Luca


[web2py] Re: widget for list:reference field in SQLFORM

2011-09-08 Thread Anthony
I think you're getting the standard multiselect box, and I'm not aware of 
any problem with this.

Anthony

On Thursday, September 8, 2011 8:11:01 PM UTC-4, monotasker wrote:
>
> I think I'm up to date: v. 1.98.2 
>
> I'm a little confused now. Anthony was saying that the behaviour I 
> described was intentional. Has there been a discussion about changing 
> it? 
>
> Ian 
>
> On Sep 8, 5:17 pm, Richard Vézina  wrote: 
> > Wich version of web2py version do you use... The problem you describe hab 
>
> > been a issue in the past that have been fixed now... 
> > 
> > Maybe you have a old version of web2py? 
> > 
> > Richard 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Thu, Sep 8, 2011 at 4:16 PM, monotasker  wrote: 
> > > Thanks for the links. I'm still trying to figure out how much to look 
> > > for the framework to do and how much to look for client-side 
> > > solutions. This helps. 
> > 
> > > Ian 
> > 
> > > On Sep 7, 5:48 pm, Anthony  wrote: 
> > > > Since developers will have different preferences for multiselect 
> widgets 
> > > and 
> > > > it is so easy to plug something in on the client side, I'm not sure 
> the 
> > > > framework needs to commit to a particular widget. Here are a few good 
>
> > > > options: 
> > 
> > >http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/... 
>
> > 
> > > > On Wednesday, September 7, 2011 5:12:55 PM UTC-4, monotasker wrote: 
> > 
> > > > > OK. That description confused me in the book (I'm not used to 
> > > > > describing multi-select boxes as a 'drop-box' so I assumed it meant 
>
> > > > > drop-down). Thanks. I think it would be more usable if the default 
> > > > > widget were something like the one used in the app-creation wizard 
> for 
> > > > > table and field creation: 
> > 
> > > > > 1) present a single text field with autocomplete based on the 
> > > > > referenced table, then 
> > 
> > > > > 2) when the user fills that field (or on ?) another field 
> > > > > appears below it. 
> > 
> > > > > A multi-select field doesn't seem to me very user-friendly if we're 
>
> > > > > trying to select multiple options from a long pre-populated set of 
> > > > > choices. The user has to use CTRL-LMB just to select a second 
> option, 
> > > > > and has to scroll manually through the list. Do you think this is 
> > > > > something worth changing? 
> > 
> > > > > Ian 
> > 
> > > > > On Sep 7, 4:02 pm, Anthony  wrote: 
> > > > > > No, you should not get a series of select boxes, just a single 
> > > > > multi-select 
> > > > > > box, like 
> > > > > > this: 
> > 
> > >
> http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple. 
> > 
> > > > > > The book states that a list:reference field "produces a 
> > > > > SELECT/OPTIONmultiple drop-box". 
> > 
> > > > > > Anthony 
> > 
> > > > > > On Wednesday, September 7, 2011 3:43:11 PM UTC-4, monotasker 
> wrote: 
> > 
> > > > > > > In a form generated by SQLFORM I'm finding that a 
> list:reference 
> > > field 
> > > > > > > is represented with a single list-box. What I expected based on 
> the 
> > > > > > > section on list: in the manual was a series of select 
> boxes. 
> > > Was 
> > > > > > > I reading the manual wrong? If not, does anyone know why I 
> might be 
> > > > > > > getting the wrong widget presented? 
> > 
> > > > > > > Here is the relevant part of my model: 
> > 
> > > > > > > db.define_table('tags', 
> > > > > > > Field('tag', 'string'), format='%(tag)s') 
> > 
> > > > > > > db.tags.tag.requires = IS_NOT_IN_DB(db, db.tags.tag) 
> > 
> > > > > > > db.define_table('questions', 
> > > > > > > Field('question', 'text', required=True), 
> > > > > > > Field('answer', 'string', required=True), 
> > > > > > > Field('score', default=1, required=True), 
> > > > > > > Field('answer2', 'string', default='null'), 
> > > > > > > Field('score2', 'double', default=0.5), 
> > > > > > > Field('answer3', 'string', default='null'), 
> > > > > > > Field('score3', 'double', default=0.3), 
> > > > > > > Field('readable_answer', 'string', default='null'), 
> > > > > > > Field('tags', 'list:reference tags'), 
> > > > > > > Field('nt_frequency', 'double')) 
> > 
> > > > > > > db.questions.tags.requires = IS_IN_DB(db, 'tags.id', 
> > > db.tags._format, 
> > > > > > > multiple=True) 
> > 
> > > > > > > And here is the controller that creates the form: 
> > 
> > > > > > > def create_question(): 
> > > > > > > form = SQLFORM(db.questions) 
> > > > > > > if form.accepts(request.vars, session): 
> > > > > > > response.flash = 'form accepted' 
> > > > > > > elif form.errors: 
> > > > > > > response.flash = 'form has errors' 
> > > > > > > else: 
> > > > > > > response.flash = 'please fill out the form' 
> > > > > > > return dict(form=form)



[web2py] Re: Quick authentication question

2011-09-08 Thread Anthony
Have you tried

auth.settings.allow_basic_login = True

See 
http://web2py.com/book/default/chapter/08#Access-Control-and-Basic-Authentication.

Anthony

On Thursday, September 8, 2011 7:48:04 PM UTC-4, Matt wrote:
>
> Hi there, 
>
> I have a very quick question about basic authentication. 
>
> Does web2py support this approach? 
>
> https://username:passw...@www.website.com/index 
>
> Matt 
>
>

[web2py] routest_onerror don't work after deploy

2011-09-08 Thread kachna
Hi,
I am trying to catch "invalid request" after requesting non-existing
file from static folder of application "eshop". My routest.py:


routes_onerror = [
#('eshop/400', '/eshop/default/HTTP_404'),
('*/*', '/eshop/default/HTTP_error')
]

routes_app = (
(r'.*http://meganabytek\.cz.*', r'eshop'),
(r'.*http://www\.meganabytek\.cz.*', r'eshop'),

(r'.*http://kitenavigator\.com.*', r'kitenavigator'),
(r'.*http://www\.kitenavigator\.com.*', r'kitenavigator'),

(r'.*http://blog\.meganabytek\.cz.*', r'blog'),
(r'.*http://vysocinacup\.meganabytek\.cz.*', r'o_apmas'),

#('/eshop/appadmin/$f', '/eshop/appadmin/$f'), # enable
administration
#('/eshop/static/$f', '/eshop/static/$f'), # enable static files

)

On my PC it works good. Just request.vars.requested_uri in HTTP_error
function is None. It stop working When I move the code on hosting.
Looks like on http error happend but in uwsgi log I can see:

GET /eshop/static/photo.thumb.9ee2c7f07e9b810b.
4b30315f736b72696e6b612d757a617672656e612d6b6f6d622d2e6a7067.jpg =>
generated 573 bytes in 2 msecs (HTTP/1.1 404) 3 headers in 115 bytes
(1 switches on core 0)

Can anybody help me?




[web2py] Re: widget for list:reference field in SQLFORM

2011-09-08 Thread monotasker
I think I'm up to date: v. 1.98.2

I'm a little confused now. Anthony was saying that the behaviour I
described was intentional. Has there been a discussion about changing
it?

Ian

On Sep 8, 5:17 pm, Richard Vézina  wrote:
> Wich version of web2py version do you use... The problem you describe hab
> been a issue in the past that have been fixed now...
>
> Maybe you have a old version of web2py?
>
> Richard
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 4:16 PM, monotasker  wrote:
> > Thanks for the links. I'm still trying to figure out how much to look
> > for the framework to do and how much to look for client-side
> > solutions. This helps.
>
> > Ian
>
> > On Sep 7, 5:48 pm, Anthony  wrote:
> > > Since developers will have different preferences for multiselect widgets
> > and
> > > it is so easy to plug something in on the client side, I'm not sure the
> > > framework needs to commit to a particular widget. Here are a few good
> > > options:
>
> >http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/...
>
> > > On Wednesday, September 7, 2011 5:12:55 PM UTC-4, monotasker wrote:
>
> > > > OK. That description confused me in the book (I'm not used to
> > > > describing multi-select boxes as a 'drop-box' so I assumed it meant
> > > > drop-down). Thanks. I think it would be more usable if the default
> > > > widget were something like the one used in the app-creation wizard for
> > > > table and field creation:
>
> > > > 1) present a single text field with autocomplete based on the
> > > > referenced table, then
>
> > > > 2) when the user fills that field (or on ?) another field
> > > > appears below it.
>
> > > > A multi-select field doesn't seem to me very user-friendly if we're
> > > > trying to select multiple options from a long pre-populated set of
> > > > choices. The user has to use CTRL-LMB just to select a second option,
> > > > and has to scroll manually through the list. Do you think this is
> > > > something worth changing?
>
> > > > Ian
>
> > > > On Sep 7, 4:02 pm, Anthony  wrote:
> > > > > No, you should not get a series of select boxes, just a single
> > > > multi-select
> > > > > box, like
> > > > > this:
>
> >http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple.
>
> > > > > The book states that a list:reference field "produces a
> > > > SELECT/OPTIONmultiple drop-box".
>
> > > > > Anthony
>
> > > > > On Wednesday, September 7, 2011 3:43:11 PM UTC-4, monotasker wrote:
>
> > > > > > In a form generated by SQLFORM I'm finding that a list:reference
> > field
> > > > > > is represented with a single list-box. What I expected based on the
> > > > > > section on list: in the manual was a series of select boxes.
> > Was
> > > > > > I reading the manual wrong? If not, does anyone know why I might be
> > > > > > getting the wrong widget presented?
>
> > > > > > Here is the relevant part of my model:
>
> > > > > > db.define_table('tags',
> > > > > >     Field('tag', 'string'), format='%(tag)s')
>
> > > > > > db.tags.tag.requires = IS_NOT_IN_DB(db, db.tags.tag)
>
> > > > > > db.define_table('questions',
> > > > > >     Field('question', 'text', required=True),
> > > > > >     Field('answer', 'string', required=True),
> > > > > >     Field('score', default=1, required=True),
> > > > > >     Field('answer2', 'string', default='null'),
> > > > > >     Field('score2', 'double', default=0.5),
> > > > > >     Field('answer3', 'string', default='null'),
> > > > > >     Field('score3', 'double', default=0.3),
> > > > > >     Field('readable_answer', 'string', default='null'),
> > > > > >     Field('tags', 'list:reference tags'),
> > > > > >     Field('nt_frequency', 'double'))
>
> > > > > > db.questions.tags.requires = IS_IN_DB(db, 'tags.id',
> > db.tags._format,
> > > > > > multiple=True)
>
> > > > > > And here is the controller that creates the form:
>
> > > > > > def create_question():
> > > > > >     form = SQLFORM(db.questions)
> > > > > >     if form.accepts(request.vars, session):
> > > > > >         response.flash = 'form accepted'
> > > > > >     elif form.errors:
> > > > > >         response.flash = 'form has errors'
> > > > > >     else:
> > > > > >         response.flash = 'please fill out the form'
> > > > > >     return dict(form=form)


[web2py] Quick authentication question

2011-09-08 Thread Matt
Hi there,

I have a very quick question about basic authentication.

Does web2py support this approach?

https://username:passw...@www.website.com/index

Matt



Re: [web2py] Re: About the welcome app

2011-09-08 Thread Anthony
Yeah, that was dropped. It was initiated by the guy who did the redesign of 
the current admin app, but he moved on.

Anthony

On Thursday, September 8, 2011 6:11:47 PM UTC-4, Ramos wrote:
>
> What? cant believe it
>
> see this 
> http://code.google.com/p/web2pyadmin2/
>
>
>
> 2011/9/8 Massimo Di Pierro 
>
>> Never heard of it before.
>>
>> On Sep 8, 11:01 am, António Ramos  wrote:
>> > does the web2py...@googlegroups.com still exists?
>> >
>> > What do they have about the new admin they talked about months ago?
>> >
>> > 2011/9/8 Massimo Di Pierro 
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > This is a problem indeed.
>> >
>> > > Anyway, I think it would be a good idea to have a convention about
>> > > icons representing apps. Listing all the apps publicly does not belong
>> > > in welcome and it is a security hazard. there could be a public page
>> > > in admin that does that and admin can be disabled anyway.
>> >
>> > > On Sep 8, 8:45 am, Richard Vézina  wrote:
>> > > > But the idea of António is pretty nice...
>> >
>> > > > Only one problem, the speed of development web2py seems to generate
>> > > obsolete
>> > > > code in the applications published that force Massimo to launch 
>> adopt an
>> > > App
>> > > > movement... I don't know if it as work until now... I think this 
>> should
>> > > be
>> > > > fixed first, I mean make evolve the published apps at the same rythm 
>> of
>> > > > evolution than web2py...
>> >
>> > > > Richard
>> >
>> > > > On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
>> > > > > The 'welcome' app is intended to be a scaffolding upon which to 
>> build
>> > > an
>> > > > > app. The app selector you suggest might be more appropriate for
>> > > inclusion in
>> > > > > the 'admin' app (where the 'welcome' app could be one of the 
>> choices).
>> >
>> > > > > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
>> >
>> > > > >> I think the welcome app should be for users to see all apps 
>> available
>> > > > >> i would like to see an welcome app like the attached file
>> > > > >> All apps are associated with an icon for easy remembering
>> >
>> > > > >> António
>> >
>> > > > >> 2011/9/8 pbreit 
>> >
>> > > > >> I certainly would not call it useless. It provides a bit of
>> > > information
>> > > > >>> about how pages get rendered as well as some useful links.
>> >
>> > > > >>> Do you have any suggestions for how to improve?
>>
>
>

[web2py] Re: select (field alias)

2011-09-08 Thread Noel Villamor

Your work-around works well Anthony. Thanks.

What I intend of doing is querying just a subset of a list:string
field (e.g. mytblalias.data[0:6] which in select would appear as:
SUBSTR(mytblalias.data,1,(7 - 1))

The field results, however, turned out to be raw with the '|' showing
as separators instead of a list but I could process that before
passing it to a function as the fields final destination.

Noel

On Sep 9, 8:18 am, Anthony  wrote:
> You can select db.mytbl.id*2, but I don't think you can reference the result
> with an alias -- you'd have to reference it with something like 
> rows[0]['(mytbl.id
> * 2)']. Of course, for convenience, you could define fld2='(mytbl.id * 2)' and
>  then do rows[0][fld2].
>
> What do you want to do with the results?
>
> Anthony
>
>
>
>
>
>
>
> On Thursday, September 8, 2011 3:07:55 AM UTC-4, Noel Villamor wrote:
>
> > I am aware about:
> > tblAlias = db.mytbl.with_alias('tblAlias')
>
> > Is there a similar thing that we can use for fields in select()?
> > As in:
> > ... .select( db.mytbl.id, db.mytbl.id*2 as fld2)


[web2py] Re: problems changing database field type

2011-09-08 Thread Eric
And settings.migrate is set to 'True'.

On Sep 8, 1:45 pm, Richard Vézina  wrote:
> Drop the table... and recreate it... Use pgAdmin or erase your db model
> reload your app... paste your model reload...
>
> Don't need fake migrate just migrate true...
>
> Richard
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 1:36 PM, Eric  wrote:
> > I'm running web2py on PostGreSQL.  I accidentally created a model that
> > specified a table with column type "double" when I needed "decimal".
> > Now I'm trying to change it from double to decimal, with no luck.  I
> > deleted all the records, and have used
> > 'migrate=True,fake_migrate=True', and all the variations thereof.
> > Will I need to re-create the app to change the database field type?
>
> > Changing models (adding or modifying columns) is a problem I've
> > encountered consistently with web2py, and it's the one problem that
> > (so far) I've been unable to trace back to my own mistake or
> > oversight.  Working with the DAL is not easy, even when using
> > PostGreSQL.
>
> > Thanks in advance for your help.


Re: [web2py] Re: Re-Launch a Better version www.beunick.com

2011-09-08 Thread António Ramos
maybe be-unik

2011/9/8 pbreit 

> Looks nice. "beunick" is a bit of a strange name. The first thing I think
> of is "eunuch" which is not the most pleasant thought.


[web2py] Re: how to use cgi in web2py

2011-09-08 Thread pbreit
Freak, what hosting options do you have? Do you already have a hosting 
provider? Which one? What service level do you have? Do you know what your 
provider's Python hosting capabilities are?

[web2py] Re: problems changing database field type

2011-09-08 Thread Eric
Thanks for your reply, Richard.  I dropped the table, and when I went
to reload and got this traceback (same one I got before I dropped the
table).  db_wizard.py is where the table is defined.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 192, in
restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/baristacode/models/
db_wizard.py", line 59, in 
migrate=settings.migrate)
  File "/home/www-data/web2py/gluon/dal.py", line 4311, in
define_table
polymodel=polymodel)
  File "/home/www-data/web2py/gluon/dal.py", line 555, in create_table
precision, scale = map(int,field.type[8:-1].split(','))
ValueError: invalid literal for int() with base 10: ''



On Sep 8, 1:45 pm, Richard Vézina  wrote:
> Drop the table... and recreate it... Use pgAdmin or erase your db model
> reload your app... paste your model reload...
>
> Don't need fake migrate just migrate true...
>
> Richard
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 1:36 PM, Eric  wrote:
> > I'm running web2py on PostGreSQL.  I accidentally created a model that
> > specified a table with column type "double" when I needed "decimal".
> > Now I'm trying to change it from double to decimal, with no luck.  I
> > deleted all the records, and have used
> > 'migrate=True,fake_migrate=True', and all the variations thereof.
> > Will I need to re-create the app to change the database field type?
>
> > Changing models (adding or modifying columns) is a problem I've
> > encountered consistently with web2py, and it's the one problem that
> > (so far) I've been unable to trace back to my own mistake or
> > oversight.  Working with the DAL is not easy, even when using
> > PostGreSQL.
>
> > Thanks in advance for your help.


Re: [web2py] Re: About the welcome app

2011-09-08 Thread António Ramos
What? cant believe it

see this
http://code.google.com/p/web2pyadmin2/



2011/9/8 Massimo Di Pierro 

> Never heard of it before.
>
> On Sep 8, 11:01 am, António Ramos  wrote:
> > does the web2py-adm...@googlegroups.com still exists?
> >
> > What do they have about the new admin they talked about months ago?
> >
> > 2011/9/8 Massimo Di Pierro 
> >
> >
> >
> >
> >
> >
> >
> > > This is a problem indeed.
> >
> > > Anyway, I think it would be a good idea to have a convention about
> > > icons representing apps. Listing all the apps publicly does not belong
> > > in welcome and it is a security hazard. there could be a public page
> > > in admin that does that and admin can be disabled anyway.
> >
> > > On Sep 8, 8:45 am, Richard Vézina  wrote:
> > > > But the idea of António is pretty nice...
> >
> > > > Only one problem, the speed of development web2py seems to generate
> > > obsolete
> > > > code in the applications published that force Massimo to launch adopt
> an
> > > App
> > > > movement... I don't know if it as work until now... I think this
> should
> > > be
> > > > fixed first, I mean make evolve the published apps at the same rythm
> of
> > > > evolution than web2py...
> >
> > > > Richard
> >
> > > > On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
> > > > > The 'welcome' app is intended to be a scaffolding upon which to
> build
> > > an
> > > > > app. The app selector you suggest might be more appropriate for
> > > inclusion in
> > > > > the 'admin' app (where the 'welcome' app could be one of the
> choices).
> >
> > > > > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
> >
> > > > >> I think the welcome app should be for users to see all apps
> available
> > > > >> i would like to see an welcome app like the attached file
> > > > >> All apps are associated with an icon for easy remembering
> >
> > > > >> António
> >
> > > > >> 2011/9/8 pbreit 
> >
> > > > >> I certainly would not call it useless. It provides a bit of
> > > information
> > > > >>> about how pages get rendered as well as some useful links.
> >
> > > > >>> Do you have any suggestions for how to improve?
>


[web2py] Re: Re-Launch a Better version www.beunick.com

2011-09-08 Thread pbreit
Looks nice. "beunick" is a bit of a strange name. The first thing I think of 
is "eunuch" which is not the most pleasant thought.

[web2py] Re: Lazy virtual fields - strange result!

2011-09-08 Thread Michael Toomim
After some thought, I'm really liking this design for virtual
fields... what if lazy/virtual fields were declared directly in
db.define_table()?  Like so:

db.define_table('item',
Field('unit_price','double'),
Field('quantity','integer'),
VirtualField('total_price',
 lambda self:
self.item.unit_price*self.item.quantity,
 lazy=True))

It's so simple.

I still kinda feel like we might find better names than lazy/virtual
though.  So here's a design I like even more:

db.define_table('item',
Field('unit_price','double'),
Field('quantity','integer'),
Method('total_price',
   lambda self:
self.item.unit_price*self.item.quantity,
   precompute=False))

`precompute' means "not lazy" and would default to false.

On Aug 25, 6:14 am, Massimo Di Pierro 
wrote:
> We are moving away from this because of many problems. Try this
> instead. It is still experimental but may go into stable soon.
>
> def vfields():
>    db.define_table('item',
>      Field('unit_price','double'),
>      Field('quantity','integer'))
>    db(db.item.id>0).delete()
>
>    db.item.lazy_total_price=Field.lazy(lambda
> self:self.item.unit_price*self.item.quantity)
>
>    db.item.bulk_insert([{'unit_price':12.00, 'quantity': 15},
>      {'unit_price':10.00, 'quantity': 99},
>      {'unit_price':120.00, 'quantity': 2},])
>    res = []
>    for r in db(db.item.id>0).select():
>      res.append([r.unit_price, r.quantity, r.lazy_total_price()])
>    return dict(res=res)
>


[web2py] Re: Integrate Third Party Modules that Connect to MySql DB

2011-09-08 Thread pbreit
It should be fine using your other database access library. I think you'll 
probably want to import the libraries from each controller file. And won't 
need to put any of that stuff in model files.

I think reading chapters 00-07 in the Book are a good start (08 if you are 
using registration/login). And then just dive in and start programming.

There's a lot of existing code to read and review. For example the 
appadmin.py controller (except that it is DAL-heavy).


[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread pbreit
Having multiple controller files gives you the ability to organize your code 
and URLs and it works nicely. To hide the app name and/or controller name, 
look at the router.example.py file.

All the code in all the files in the "models" directory is executed on each 
page request so you can put your code anywhere. The model files are executed 
in alphabetical order and there are a few things that need to be processed 
in order (which is why you will frequently see model files pre-pended with 
1_, 2_, etc as another poster pointed out). If you add a model file, make 
sure the db.py file takes precedent since it has some code that needs to be 
run first. You could put all your model information into a file named 
models.py or you could create individual model files for each table...your 
preference.

It'e pretty easy to re-arrange things so don't get too hung up in the 
beginning.


[web2py] Re: select box size (height) : how to change in View

2011-09-08 Thread Anthony


On Thursday, September 8, 2011 12:52:42 PM UTC-4, Vineet wrote:
>
> I have posted the code in 'View' file at 
>
> http://stackoverflow.com/questions/7343374/web2py-view-height-size-of-a-select-box-in
>  
> So avoiding the reposting of code here.
>

I left a comment on SO -- still can't replicate the problem, even using your 
exact code. Maybe you can send a full app that replicates the problem.

Anthony 


[web2py] LOAD ajax=True and non submit buttons

2011-09-08 Thread DenesL

Components with buttons that are meant for client side scripting are
being reloaded via ajax post request (I think), shouldn't this
behavior be limited to the submit button?.




Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Vézina
haha

I wasn't understand why he was putting that there and I didn't realise it
was a mistake ;-)

Richard

On Thu, Sep 8, 2011 at 5:30 PM, Anthony  wrote:

> No, you need to add return dict() to the end of you index() function in
> your controller -- not to the view file.
>
> Anthony
>
>
> On Thursday, September 8, 2011 4:45:51 PM UTC-4, Richard wrote:
>>
>>  The view is not executed. Adding return dict() doesn't have effect. Even
>> this dict() does not lead to an error.
>>
>> {{extend 'layout.html'}}
>> {{if 'message' in globals():}}
>>
>>  Outfile from Matplotlib
>> 
>> 
>>
>> return dict()
>>
>>
>>
>> Op 8-9-2011 22:24, Anthony schreef:
>>
>> Have you shown us your entire index() function? If so, your view file
>> isn't getting called at all because your index function is not returning a
>> dictionary. Instead, web2py is simply returning whatever your function
>> returns, which is probably None if the last line is a call to plt.savefig().
>> Add return dict() to the end of your index function, and see if it works.
>> Views are only called if the controller function returns a dictionary.
>>
>>  Anthony
>>
>> On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote:
>>>
>>>  The mp1.png file is in the static directory of my application
>>>
>>> The following views/default/index  only gives an empty page with
>>> "None"  in the top left corner.
>>>
>>> {{left_sidebar_enabled=right_**sidebar_enabled=False}}
>>>
>>> {{extend 'layout.html'}}
>>> {{if 'message' in globals():}}
>>>
>>> {{=message}}
>>>
>>> #Events
>>> #{{=db().select(db.Events.ALL)**}}
>>>
>>>  Outfile from Matplotlib
>>> 
>>> 
>>>
>>> {{else:}}
>>> {{=BEATIFY(response.vars)}}
>>> {{pass}}
>>>
>>> {{block left_sidebar}}New Left Sidebar Content{{end}}
>>> {{block right_sidebar}}New Right Sidebar Content{{end}}
>>>
>>>
>>> Op 7-9-2011 23:35, Richard Dijkstra schreef:
>>>
>>> Looking closer an output window appears and the console gives errors on
>>> the sequence of calling matplotlib.backends:
>>>
>>>  I'll check first.
>>>
>>>
>>>
>>>  Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:
>>>
>>> But does 
>>> plt.savefig(os.path.join(**request.folder,'static','mp1.**png'),format='png')
>>> result in a file being saved in c:\web2py\applications\your_**app\static\?
>>>
>>>
>>>
>>> On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:

  Anthony,

 plt.savefig('c:\web2py\**outputfile.png',format='png')

 does me give an accessable png-file

 Op 7-9-2011 22:20, Anthony schreef:

 Have you confirmed that the file is actually getting saved in the
 expected location? Are you able to run the matplotlib code and save the 
 file
 outside of web2py?


 On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote:
>
>  Only adding the .png extention is not sufficient.
>
> outputfile = os.path.join(request.folder,'**static','mp1.png')
> plt.savefig(outputfile,format=**'png')
>
>
>  Outfile from Matplotlib
> 
> 
>
>
> Besides this issue; is using a temporarily file a mature solution or is
> streaming preferrable?
>
> Richard
>
>
> Op 7-9-2011 21:46, Anthony schreef:
>
> On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard wrote:
>>
>>
>> 
>>
>
>  Should be URL('static','mp1.png').
>
>  Anthony
>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
> 09/02/11 08:34:00
>
>
>
>

 Geen virus gevonden in het binnenkomende-bericht.
 Gecontroleerd door AVG - www.avg.com
 Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
 09/02/11 08:34:00




>>>
>>>
>>> Geen virus gevonden in het binnenkomende-bericht.
>>> Gecontroleerd door AVG - www.avg.com
>>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 
>>> 09/05/11 08:35:00
>>>
>>>
>>>
>>>
>>
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
>> 08:35:00
>>
>>
>>
>>


Re: [web2py] Re: Date Picker Widget

2011-09-08 Thread Richard Vézina
Ok, putting much more then the basic z-index init of dialog works find at
least...

I don't see when you want a datepicker to be behind an other element?!

Richard

On Thu, Sep 8, 2011 at 5:27 PM, Richard Vézina
wrote:

> God... The fix seems to work only for the first trigger of the popup...
>
> Richard
>
>
> On Thu, Sep 8, 2011 at 5:25 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> It seems that you can initialise dialog with a given zIndex
>>
>> And the default zIndex that I have in the js is zIndex: 1000
>>
>> I just read the js and it seems to change between 1000 and 1001... I try
>> with 1002 in the .calendar css class of "web2py datepicker" and it works
>> find.
>>
>> Don't know maybe adding a note in the css file of the "web2py datepicker"
>> near the z-index parameter should be done to inform user of what to do in
>> case of problem...
>>
>> ;-)
>>
>> Richard
>>
>>
>> On Thu, Sep 8, 2011 at 5:11 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> .calendar{
>>> z-index: 1000;
>>> position: relative;
>>> display: none;
>>> border-right: 1px solid #808080;
>>> border-left: 1px solid #808080;
>>> border-bottom: 1px solid #808080;
>>> font-size: 11px;
>>> color: #9A9A9A;
>>> cursor: default;
>>> background: #fafaed;
>>> font-family: Arial, Helvetica,sans-serif;
>>> }
>>>
>>> SOLVED
>>>
>>> It maybe to much should check the dialog plugin and put just one value
>>> above...
>>>
>>>  Richard
>>>
>>> On Thu, Sep 8, 2011 at 5:07 PM, Richard Vézina <
>>> ml.richard.vez...@gmail.com> wrote:
>>>
 I have the same problem is you find a solution...

 I will try with z-index, but I am not sure if it will work, should pick
 one upper the dialog plugin use if it's the source of the problem.

 Richard


 On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard <
 p...@gerrardconsulting.com> wrote:

> Hi,
>
> I used this css as is (although I did change the background colour to
> match my site. however... I'm using the dat picker on a field
> displayed in a jquerydialog. the datepicket pops up - behind the
> dialog box. I think the z-indexvalue needs bumping up (or is it
> down?)
>
> Looks good tho :O)
>
> On Sep 7, 7:23 am, annet  wrote:
> > Hi David,
> >
> > I didn't like the calendar that comes with web2py, not for its
> > functionality but for its appearance. Instead of replacing it I just
> > restyled it:
> >
> > .calendar {
> >   cursor: default;
> >   background-color: #FF;
> >   color: #44;
> >   font-size: 11px;
> >   border: 1px solid #AA;
> >   border-radius: 6px;
> >   -webkit-border-radius: 6px;
> >   -moz-border-radius: 6px;
> >   padding: 6px;}
> >
> > .calendar table {
> >   border-collapse: separate;
> >   border-spacing: 2px;}
> >
> > .calendar thead {}
> > .calendar thead tr, .calendar thead .headrow {
> >   background-color: #4169E1;
> >   color: #44;}
> >
> > .calendar thead .daynames {}
> > .calendar .button, .calendar thead .title {
> >   color: #FF;
> >   font-size: 12px;
> >   text-align: center;
> >   padding: 3px;}
> >
> > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
> > thead .headrow .hilite, .calendar thead .headrow .active {
> >   background-color: #FF;
> >   color: #4169E1;
> >   padding: 3px;}
> >
> > .calendar thead .daynames .hilite, .calendar thead .daynames .active
> {
> >   background-color: #FF;
> >   color: #44;}
> >
> > .calendar thead .name {
> >   background-color: #FF;
> >   text-align: center;
> >   padding: 3px;}
> >
> > .calendar tbody {}
> > .calendar tbody td {
> >   text-align: right;
> >   border: 1px solid #AA;}
> >
> > .calendar tbody td.hilite {
> >   background-color: #77;
> >   color: #FF;}
> >
> > .calendar tbody td.active, .calendar tbody td.selected {
> >   font-weight: bold;
> >   background-color: #FF;
> >   color: #4169E1;}
> >
> > .calendar tbody td.today {
> >   font-weight: bold;
> >   background-color: #4169E1;
> >   color: #FF;}
> >
> > .calendar tbody .disabled {
> >   color: #77;}
> >
> > .calendar tbody .emptycell {
> >   visibility: hidden;}
> >
> > .calendar tbody .emptyrow {
> >   display: none;}
> >
> > .calendar tfoot .ttip {
> >   background-color: #77;
> >   color: #FF;
> >   text-align: center;
> >   border: 1px solid #33;
> >   padding: 1px;}
> >
> > .calendar tfoot .hilite {
> >   padding: 1px;
> >   background-color:
> >   #EE;}
> >
> > .calendar tfoot .active {
> >   padding: 2px 0px 0px 2px;}
> >
> > .calendar .combo {

Re: [web2py] Re: matplotlib output

2011-09-08 Thread Anthony
No, you need to add return dict() to the end of you index() function in your 
controller -- not to the view file.

Anthony

On Thursday, September 8, 2011 4:45:51 PM UTC-4, Richard wrote:
>
>  The view is not executed. Adding return dict() doesn't have effect. Even 
> this dict() does not lead to an error.
>
> {{extend 'layout.html'}}
> {{if 'message' in globals():}}
>
>  Outfile from Matplotlib
> 
> 
>
> return dict()
>
>
>
> Op 8-9-2011 22:24, Anthony schreef: 
>
> Have you shown us your entire index() function? If so, your view file isn't 
> getting called at all because your index function is not returning a 
> dictionary. Instead, web2py is simply returning whatever your function 
> returns, which is probably None if the last line is a call to plt.savefig(). 
> Add return dict() to the end of your index function, and see if it works. 
> Views are only called if the controller function returns a dictionary. 
>
>  Anthony
>
> On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote: 
>>
>>  The mp1.png file is in the static directory of my application
>>
>> The following views/default/index  only gives an empty page with
>> "None"  in the top left corner.
>>
>> {{left_sidebar_enabled=right_sidebar_enabled=False}}
>>
>> {{extend 'layout.html'}}
>> {{if 'message' in globals():}}
>>
>> {{=message}}
>>
>> #Events
>> #{{=db().select(db.Events.ALL)}}
>>
>>  Outfile from Matplotlib
>> 
>> 
>>
>> {{else:}}
>> {{=BEATIFY(response.vars)}}
>> {{pass}}
>>
>> {{block left_sidebar}}New Left Sidebar Content{{end}}
>> {{block right_sidebar}}New Right Sidebar Content{{end}}
>>
>>
>> Op 7-9-2011 23:35, Richard Dijkstra schreef: 
>>
>> Looking closer an output window appears and the console gives errors on 
>> the sequence of calling matplotlib.backends:
>>
>>  I'll check first.
>>
>>  
>>  
>>  Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:
>>
>> But does 
>> plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png') 
>> result in a file being saved in c:\web2py\applications\your_app\static\? 
>>
>>  
>> On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote: 
>>>
>>>  Anthony,
>>>
>>> plt.savefig('c:\web2py\outputfile.png',format='png')
>>>
>>> does me give an accessable png-file
>>>
>>> Op 7-9-2011 22:20, Anthony schreef: 
>>>
>>> Have you confirmed that the file is actually getting saved in the 
>>> expected location? Are you able to run the matplotlib code and save the 
>>> file 
>>> outside of web2py? 
>>>
>>>  
>>> On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote: 

  Only adding the .png extention is not sufficient.

 outputfile = os.path.join(request.folder,'static','mp1.png')
 plt.savefig(outputfile,format='png')


  Outfile from Matplotlib
 
 


 Besides this issue; is using a temporarily file a mature solution or is 
 streaming preferrable?

 Richard


 Op 7-9-2011 21:46, Anthony schreef: 

 On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard wrote: 
>
>
> 
>

  Should be URL('static','mp1.png').

  Anthony

  
 Geen virus gevonden in het binnenkomende-bericht.
 Gecontroleerd door AVG - www.avg.com 
 Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
 09/02/11 08:34:00


  
   
>>>  
>>> Geen virus gevonden in het binnenkomende-bericht.
>>> Gecontroleerd door AVG - www.avg.com 
>>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
>>> 09/02/11 08:34:00
>>>
>>>
>>>  
>>>
>>
>>  
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com 
>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
>> 08:35:00
>>
>>
>>  
>>   
>  
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com 
> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
> 08:35:00
>
>
>  
>  

Re: [web2py] Re: Date Picker Widget

2011-09-08 Thread Richard Vézina
God... The fix seems to work only for the first trigger of the popup...

Richard

On Thu, Sep 8, 2011 at 5:25 PM, Richard Vézina
wrote:

> It seems that you can initialise dialog with a given zIndex
>
> And the default zIndex that I have in the js is zIndex: 1000
>
> I just read the js and it seems to change between 1000 and 1001... I try
> with 1002 in the .calendar css class of "web2py datepicker" and it works
> find.
>
> Don't know maybe adding a note in the css file of the "web2py datepicker"
> near the z-index parameter should be done to inform user of what to do in
> case of problem...
>
> ;-)
>
> Richard
>
>
> On Thu, Sep 8, 2011 at 5:11 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> .calendar{
>> z-index: 1000;
>> position: relative;
>> display: none;
>> border-right: 1px solid #808080;
>> border-left: 1px solid #808080;
>> border-bottom: 1px solid #808080;
>> font-size: 11px;
>> color: #9A9A9A;
>> cursor: default;
>> background: #fafaed;
>> font-family: Arial, Helvetica,sans-serif;
>> }
>>
>> SOLVED
>>
>> It maybe to much should check the dialog plugin and put just one value
>> above...
>>
>>  Richard
>>
>> On Thu, Sep 8, 2011 at 5:07 PM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> I have the same problem is you find a solution...
>>>
>>> I will try with z-index, but I am not sure if it will work, should pick
>>> one upper the dialog plugin use if it's the source of the problem.
>>>
>>> Richard
>>>
>>>
>>> On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard >> > wrote:
>>>
 Hi,

 I used this css as is (although I did change the background colour to
 match my site. however... I'm using the dat picker on a field
 displayed in a jquerydialog. the datepicket pops up - behind the
 dialog box. I think the z-indexvalue needs bumping up (or is it
 down?)

 Looks good tho :O)

 On Sep 7, 7:23 am, annet  wrote:
 > Hi David,
 >
 > I didn't like the calendar that comes with web2py, not for its
 > functionality but for its appearance. Instead of replacing it I just
 > restyled it:
 >
 > .calendar {
 >   cursor: default;
 >   background-color: #FF;
 >   color: #44;
 >   font-size: 11px;
 >   border: 1px solid #AA;
 >   border-radius: 6px;
 >   -webkit-border-radius: 6px;
 >   -moz-border-radius: 6px;
 >   padding: 6px;}
 >
 > .calendar table {
 >   border-collapse: separate;
 >   border-spacing: 2px;}
 >
 > .calendar thead {}
 > .calendar thead tr, .calendar thead .headrow {
 >   background-color: #4169E1;
 >   color: #44;}
 >
 > .calendar thead .daynames {}
 > .calendar .button, .calendar thead .title {
 >   color: #FF;
 >   font-size: 12px;
 >   text-align: center;
 >   padding: 3px;}
 >
 > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
 > thead .headrow .hilite, .calendar thead .headrow .active {
 >   background-color: #FF;
 >   color: #4169E1;
 >   padding: 3px;}
 >
 > .calendar thead .daynames .hilite, .calendar thead .daynames .active {
 >   background-color: #FF;
 >   color: #44;}
 >
 > .calendar thead .name {
 >   background-color: #FF;
 >   text-align: center;
 >   padding: 3px;}
 >
 > .calendar tbody {}
 > .calendar tbody td {
 >   text-align: right;
 >   border: 1px solid #AA;}
 >
 > .calendar tbody td.hilite {
 >   background-color: #77;
 >   color: #FF;}
 >
 > .calendar tbody td.active, .calendar tbody td.selected {
 >   font-weight: bold;
 >   background-color: #FF;
 >   color: #4169E1;}
 >
 > .calendar tbody td.today {
 >   font-weight: bold;
 >   background-color: #4169E1;
 >   color: #FF;}
 >
 > .calendar tbody .disabled {
 >   color: #77;}
 >
 > .calendar tbody .emptycell {
 >   visibility: hidden;}
 >
 > .calendar tbody .emptyrow {
 >   display: none;}
 >
 > .calendar tfoot .ttip {
 >   background-color: #77;
 >   color: #FF;
 >   text-align: center;
 >   border: 1px solid #33;
 >   padding: 1px;}
 >
 > .calendar tfoot .hilite {
 >   padding: 1px;
 >   background-color:
 >   #EE;}
 >
 > .calendar tfoot .active {
 >   padding: 2px 0px 0px 2px;}
 >
 > .calendar .combo {
 >   background-color: #FF;
 >   position: absolute;
 >   display: none;
 >   width: 4em;
 >   top: 0px;
 >   left: 0px;
 >   cursor: default;
 >   border: 1px solid #DD;
 >   padding: 1px;
 >   z-index: 100;}
 >
 > .calendar .combo .label, .calendar .combo .label-IEfix {
 >   text-align: center;
 >   padding: 1px;}
 >
 > .calendar .combo .label-IEfix {
 >   width: 4em;}
 >

Re: [web2py] Re: Date Picker Widget

2011-09-08 Thread Richard Vézina
It seems that you can initialise dialog with a given zIndex

And the default zIndex that I have in the js is zIndex: 1000

I just read the js and it seems to change between 1000 and 1001... I try
with 1002 in the .calendar css class of "web2py datepicker" and it works
find.

Don't know maybe adding a note in the css file of the "web2py datepicker"
near the z-index parameter should be done to inform user of what to do in
case of problem...

;-)

Richard

On Thu, Sep 8, 2011 at 5:11 PM, Richard Vézina
wrote:

> .calendar{
> z-index: 1000;
> position: relative;
> display: none;
> border-right: 1px solid #808080;
> border-left: 1px solid #808080;
> border-bottom: 1px solid #808080;
> font-size: 11px;
> color: #9A9A9A;
> cursor: default;
> background: #fafaed;
> font-family: Arial, Helvetica,sans-serif;
> }
>
> SOLVED
>
> It maybe to much should check the dialog plugin and put just one value
> above...
>
> Richard
>
> On Thu, Sep 8, 2011 at 5:07 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> I have the same problem is you find a solution...
>>
>> I will try with z-index, but I am not sure if it will work, should pick
>> one upper the dialog plugin use if it's the source of the problem.
>>
>> Richard
>>
>>
>> On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard 
>> wrote:
>>
>>> Hi,
>>>
>>> I used this css as is (although I did change the background colour to
>>> match my site. however... I'm using the dat picker on a field
>>> displayed in a jquerydialog. the datepicket pops up - behind the
>>> dialog box. I think the z-indexvalue needs bumping up (or is it
>>> down?)
>>>
>>> Looks good tho :O)
>>>
>>> On Sep 7, 7:23 am, annet  wrote:
>>> > Hi David,
>>> >
>>> > I didn't like the calendar that comes with web2py, not for its
>>> > functionality but for its appearance. Instead of replacing it I just
>>> > restyled it:
>>> >
>>> > .calendar {
>>> >   cursor: default;
>>> >   background-color: #FF;
>>> >   color: #44;
>>> >   font-size: 11px;
>>> >   border: 1px solid #AA;
>>> >   border-radius: 6px;
>>> >   -webkit-border-radius: 6px;
>>> >   -moz-border-radius: 6px;
>>> >   padding: 6px;}
>>> >
>>> > .calendar table {
>>> >   border-collapse: separate;
>>> >   border-spacing: 2px;}
>>> >
>>> > .calendar thead {}
>>> > .calendar thead tr, .calendar thead .headrow {
>>> >   background-color: #4169E1;
>>> >   color: #44;}
>>> >
>>> > .calendar thead .daynames {}
>>> > .calendar .button, .calendar thead .title {
>>> >   color: #FF;
>>> >   font-size: 12px;
>>> >   text-align: center;
>>> >   padding: 3px;}
>>> >
>>> > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
>>> > thead .headrow .hilite, .calendar thead .headrow .active {
>>> >   background-color: #FF;
>>> >   color: #4169E1;
>>> >   padding: 3px;}
>>> >
>>> > .calendar thead .daynames .hilite, .calendar thead .daynames .active {
>>> >   background-color: #FF;
>>> >   color: #44;}
>>> >
>>> > .calendar thead .name {
>>> >   background-color: #FF;
>>> >   text-align: center;
>>> >   padding: 3px;}
>>> >
>>> > .calendar tbody {}
>>> > .calendar tbody td {
>>> >   text-align: right;
>>> >   border: 1px solid #AA;}
>>> >
>>> > .calendar tbody td.hilite {
>>> >   background-color: #77;
>>> >   color: #FF;}
>>> >
>>> > .calendar tbody td.active, .calendar tbody td.selected {
>>> >   font-weight: bold;
>>> >   background-color: #FF;
>>> >   color: #4169E1;}
>>> >
>>> > .calendar tbody td.today {
>>> >   font-weight: bold;
>>> >   background-color: #4169E1;
>>> >   color: #FF;}
>>> >
>>> > .calendar tbody .disabled {
>>> >   color: #77;}
>>> >
>>> > .calendar tbody .emptycell {
>>> >   visibility: hidden;}
>>> >
>>> > .calendar tbody .emptyrow {
>>> >   display: none;}
>>> >
>>> > .calendar tfoot .ttip {
>>> >   background-color: #77;
>>> >   color: #FF;
>>> >   text-align: center;
>>> >   border: 1px solid #33;
>>> >   padding: 1px;}
>>> >
>>> > .calendar tfoot .hilite {
>>> >   padding: 1px;
>>> >   background-color:
>>> >   #EE;}
>>> >
>>> > .calendar tfoot .active {
>>> >   padding: 2px 0px 0px 2px;}
>>> >
>>> > .calendar .combo {
>>> >   background-color: #FF;
>>> >   position: absolute;
>>> >   display: none;
>>> >   width: 4em;
>>> >   top: 0px;
>>> >   left: 0px;
>>> >   cursor: default;
>>> >   border: 1px solid #DD;
>>> >   padding: 1px;
>>> >   z-index: 100;}
>>> >
>>> > .calendar .combo .label, .calendar .combo .label-IEfix {
>>> >   text-align: center;
>>> >   padding: 1px;}
>>> >
>>> > .calendar .combo .label-IEfix {
>>> >   width: 4em;}
>>> >
>>> > .calendar .combo .active {
>>> >   background-color: #CC;
>>> >   color: #FF;
>>> >   padding: 0px;}
>>> >
>>> > .calendar .combo .hilite {
>>> >   background-color: #77;
>>> >   color: #FF;}
>>> >
>>> > .floatleft {
>>> >   float: left;}
>>> >
>>> > .CP_over {
>>> >   background-color: #FF
>>> >  }
>>> >
>>> > Just another optio

Re: [web2py] Re: widget for list:reference field in SQLFORM

2011-09-08 Thread Richard Vézina
Wich version of web2py version do you use... The problem you describe hab
been a issue in the past that have been fixed now...

Maybe you have a old version of web2py?

Richard

On Thu, Sep 8, 2011 at 4:16 PM, monotasker  wrote:

> Thanks for the links. I'm still trying to figure out how much to look
> for the framework to do and how much to look for client-side
> solutions. This helps.
>
> Ian
>
> On Sep 7, 5:48 pm, Anthony  wrote:
> > Since developers will have different preferences for multiselect widgets
> and
> > it is so easy to plug something in on the client side, I'm not sure the
> > framework needs to commit to a particular widget. Here are a few good
> > options:
> >
> >
> http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/...http://www.quasipartikel.at/multiselect/http://jqueryui.com/demos/autocomplete/#multiple
> >
> >
> >
> >
> >
> >
> >
> > On Wednesday, September 7, 2011 5:12:55 PM UTC-4, monotasker wrote:
> >
> > > OK. That description confused me in the book (I'm not used to
> > > describing multi-select boxes as a 'drop-box' so I assumed it meant
> > > drop-down). Thanks. I think it would be more usable if the default
> > > widget were something like the one used in the app-creation wizard for
> > > table and field creation:
> >
> > > 1) present a single text field with autocomplete based on the
> > > referenced table, then
> >
> > > 2) when the user fills that field (or on ?) another field
> > > appears below it.
> >
> > > A multi-select field doesn't seem to me very user-friendly if we're
> > > trying to select multiple options from a long pre-populated set of
> > > choices. The user has to use CTRL-LMB just to select a second option,
> > > and has to scroll manually through the list. Do you think this is
> > > something worth changing?
> >
> > > Ian
> >
> > > On Sep 7, 4:02 pm, Anthony  wrote:
> > > > No, you should not get a series of select boxes, just a single
> > > multi-select
> > > > box, like
> > > > this:
> > >
> http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple.
> >
> > > > The book states that a list:reference field "produces a
> > > SELECT/OPTIONmultiple drop-box".
> >
> > > > Anthony
> >
> > > > On Wednesday, September 7, 2011 3:43:11 PM UTC-4, monotasker wrote:
> >
> > > > > In a form generated by SQLFORM I'm finding that a list:reference
> field
> > > > > is represented with a single list-box. What I expected based on the
> > > > > section on list: in the manual was a series of select boxes.
> Was
> > > > > I reading the manual wrong? If not, does anyone know why I might be
> > > > > getting the wrong widget presented?
> >
> > > > > Here is the relevant part of my model:
> >
> > > > > db.define_table('tags',
> > > > > Field('tag', 'string'), format='%(tag)s')
> >
> > > > > db.tags.tag.requires = IS_NOT_IN_DB(db, db.tags.tag)
> >
> > > > > db.define_table('questions',
> > > > > Field('question', 'text', required=True),
> > > > > Field('answer', 'string', required=True),
> > > > > Field('score', default=1, required=True),
> > > > > Field('answer2', 'string', default='null'),
> > > > > Field('score2', 'double', default=0.5),
> > > > > Field('answer3', 'string', default='null'),
> > > > > Field('score3', 'double', default=0.3),
> > > > > Field('readable_answer', 'string', default='null'),
> > > > > Field('tags', 'list:reference tags'),
> > > > > Field('nt_frequency', 'double'))
> >
> > > > > db.questions.tags.requires = IS_IN_DB(db, 'tags.id',
> db.tags._format,
> > > > > multiple=True)
> >
> > > > > And here is the controller that creates the form:
> >
> > > > > def create_question():
> > > > > form = SQLFORM(db.questions)
> > > > > if form.accepts(request.vars, session):
> > > > > response.flash = 'form accepted'
> > > > > elif form.errors:
> > > > > response.flash = 'form has errors'
> > > > > else:
> > > > > response.flash = 'please fill out the form'
> > > > > return dict(form=form)
>


Re: [web2py] Re: Date Picker Widget

2011-09-08 Thread Richard Vézina
.calendar{
z-index: 1000;
position: relative;
display: none;
border-right: 1px solid #808080;
border-left: 1px solid #808080;
border-bottom: 1px solid #808080;
font-size: 11px;
color: #9A9A9A;
cursor: default;
background: #fafaed;
font-family: Arial, Helvetica,sans-serif;
}

SOLVED

It maybe to much should check the dialog plugin and put just one value
above...

Richard

On Thu, Sep 8, 2011 at 5:07 PM, Richard Vézina
wrote:

> I have the same problem is you find a solution...
>
> I will try with z-index, but I am not sure if it will work, should pick one
> upper the dialog plugin use if it's the source of the problem.
>
> Richard
>
>
> On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard 
> wrote:
>
>> Hi,
>>
>> I used this css as is (although I did change the background colour to
>> match my site. however... I'm using the dat picker on a field
>> displayed in a jquerydialog. the datepicket pops up - behind the
>> dialog box. I think the z-indexvalue needs bumping up (or is it
>> down?)
>>
>> Looks good tho :O)
>>
>> On Sep 7, 7:23 am, annet  wrote:
>> > Hi David,
>> >
>> > I didn't like the calendar that comes with web2py, not for its
>> > functionality but for its appearance. Instead of replacing it I just
>> > restyled it:
>> >
>> > .calendar {
>> >   cursor: default;
>> >   background-color: #FF;
>> >   color: #44;
>> >   font-size: 11px;
>> >   border: 1px solid #AA;
>> >   border-radius: 6px;
>> >   -webkit-border-radius: 6px;
>> >   -moz-border-radius: 6px;
>> >   padding: 6px;}
>> >
>> > .calendar table {
>> >   border-collapse: separate;
>> >   border-spacing: 2px;}
>> >
>> > .calendar thead {}
>> > .calendar thead tr, .calendar thead .headrow {
>> >   background-color: #4169E1;
>> >   color: #44;}
>> >
>> > .calendar thead .daynames {}
>> > .calendar .button, .calendar thead .title {
>> >   color: #FF;
>> >   font-size: 12px;
>> >   text-align: center;
>> >   padding: 3px;}
>> >
>> > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
>> > thead .headrow .hilite, .calendar thead .headrow .active {
>> >   background-color: #FF;
>> >   color: #4169E1;
>> >   padding: 3px;}
>> >
>> > .calendar thead .daynames .hilite, .calendar thead .daynames .active {
>> >   background-color: #FF;
>> >   color: #44;}
>> >
>> > .calendar thead .name {
>> >   background-color: #FF;
>> >   text-align: center;
>> >   padding: 3px;}
>> >
>> > .calendar tbody {}
>> > .calendar tbody td {
>> >   text-align: right;
>> >   border: 1px solid #AA;}
>> >
>> > .calendar tbody td.hilite {
>> >   background-color: #77;
>> >   color: #FF;}
>> >
>> > .calendar tbody td.active, .calendar tbody td.selected {
>> >   font-weight: bold;
>> >   background-color: #FF;
>> >   color: #4169E1;}
>> >
>> > .calendar tbody td.today {
>> >   font-weight: bold;
>> >   background-color: #4169E1;
>> >   color: #FF;}
>> >
>> > .calendar tbody .disabled {
>> >   color: #77;}
>> >
>> > .calendar tbody .emptycell {
>> >   visibility: hidden;}
>> >
>> > .calendar tbody .emptyrow {
>> >   display: none;}
>> >
>> > .calendar tfoot .ttip {
>> >   background-color: #77;
>> >   color: #FF;
>> >   text-align: center;
>> >   border: 1px solid #33;
>> >   padding: 1px;}
>> >
>> > .calendar tfoot .hilite {
>> >   padding: 1px;
>> >   background-color:
>> >   #EE;}
>> >
>> > .calendar tfoot .active {
>> >   padding: 2px 0px 0px 2px;}
>> >
>> > .calendar .combo {
>> >   background-color: #FF;
>> >   position: absolute;
>> >   display: none;
>> >   width: 4em;
>> >   top: 0px;
>> >   left: 0px;
>> >   cursor: default;
>> >   border: 1px solid #DD;
>> >   padding: 1px;
>> >   z-index: 100;}
>> >
>> > .calendar .combo .label, .calendar .combo .label-IEfix {
>> >   text-align: center;
>> >   padding: 1px;}
>> >
>> > .calendar .combo .label-IEfix {
>> >   width: 4em;}
>> >
>> > .calendar .combo .active {
>> >   background-color: #CC;
>> >   color: #FF;
>> >   padding: 0px;}
>> >
>> > .calendar .combo .hilite {
>> >   background-color: #77;
>> >   color: #FF;}
>> >
>> > .floatleft {
>> >   float: left;}
>> >
>> > .CP_over {
>> >   background-color: #FF
>> >  }
>> >
>> > Just another option ;-)
>> >
>> > Kind regards,
>> >
>> > Annet.
>>
>
>


Re: [web2py] Re: Date Picker Widget

2011-09-08 Thread Richard Vézina
I have the same problem is you find a solution...

I will try with z-index, but I am not sure if it will work, should pick one
upper the dialog plugin use if it's the source of the problem.

Richard

On Thu, Sep 8, 2011 at 4:34 PM, Paul Gerrard wrote:

> Hi,
>
> I used this css as is (although I did change the background colour to
> match my site. however... I'm using the dat picker on a field
> displayed in a jquerydialog. the datepicket pops up - behind the
> dialog box. I think the z-indexvalue needs bumping up (or is it
> down?)
>
> Looks good tho :O)
>
> On Sep 7, 7:23 am, annet  wrote:
> > Hi David,
> >
> > I didn't like the calendar that comes with web2py, not for its
> > functionality but for its appearance. Instead of replacing it I just
> > restyled it:
> >
> > .calendar {
> >   cursor: default;
> >   background-color: #FF;
> >   color: #44;
> >   font-size: 11px;
> >   border: 1px solid #AA;
> >   border-radius: 6px;
> >   -webkit-border-radius: 6px;
> >   -moz-border-radius: 6px;
> >   padding: 6px;}
> >
> > .calendar table {
> >   border-collapse: separate;
> >   border-spacing: 2px;}
> >
> > .calendar thead {}
> > .calendar thead tr, .calendar thead .headrow {
> >   background-color: #4169E1;
> >   color: #44;}
> >
> > .calendar thead .daynames {}
> > .calendar .button, .calendar thead .title {
> >   color: #FF;
> >   font-size: 12px;
> >   text-align: center;
> >   padding: 3px;}
> >
> > .calendar thead tr .hilite, .calendar thead tr .active, .calendar
> > thead .headrow .hilite, .calendar thead .headrow .active {
> >   background-color: #FF;
> >   color: #4169E1;
> >   padding: 3px;}
> >
> > .calendar thead .daynames .hilite, .calendar thead .daynames .active {
> >   background-color: #FF;
> >   color: #44;}
> >
> > .calendar thead .name {
> >   background-color: #FF;
> >   text-align: center;
> >   padding: 3px;}
> >
> > .calendar tbody {}
> > .calendar tbody td {
> >   text-align: right;
> >   border: 1px solid #AA;}
> >
> > .calendar tbody td.hilite {
> >   background-color: #77;
> >   color: #FF;}
> >
> > .calendar tbody td.active, .calendar tbody td.selected {
> >   font-weight: bold;
> >   background-color: #FF;
> >   color: #4169E1;}
> >
> > .calendar tbody td.today {
> >   font-weight: bold;
> >   background-color: #4169E1;
> >   color: #FF;}
> >
> > .calendar tbody .disabled {
> >   color: #77;}
> >
> > .calendar tbody .emptycell {
> >   visibility: hidden;}
> >
> > .calendar tbody .emptyrow {
> >   display: none;}
> >
> > .calendar tfoot .ttip {
> >   background-color: #77;
> >   color: #FF;
> >   text-align: center;
> >   border: 1px solid #33;
> >   padding: 1px;}
> >
> > .calendar tfoot .hilite {
> >   padding: 1px;
> >   background-color:
> >   #EE;}
> >
> > .calendar tfoot .active {
> >   padding: 2px 0px 0px 2px;}
> >
> > .calendar .combo {
> >   background-color: #FF;
> >   position: absolute;
> >   display: none;
> >   width: 4em;
> >   top: 0px;
> >   left: 0px;
> >   cursor: default;
> >   border: 1px solid #DD;
> >   padding: 1px;
> >   z-index: 100;}
> >
> > .calendar .combo .label, .calendar .combo .label-IEfix {
> >   text-align: center;
> >   padding: 1px;}
> >
> > .calendar .combo .label-IEfix {
> >   width: 4em;}
> >
> > .calendar .combo .active {
> >   background-color: #CC;
> >   color: #FF;
> >   padding: 0px;}
> >
> > .calendar .combo .hilite {
> >   background-color: #77;
> >   color: #FF;}
> >
> > .floatleft {
> >   float: left;}
> >
> > .CP_over {
> >   background-color: #FF
> >  }
> >
> > Just another option ;-)
> >
> > Kind regards,
> >
> > Annet.
>


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Vézina
The view need a controller to return a dict variable at least one to be
executed I think...

So maybe your controller has noting to do so you just have created a view
with the code that you want to be executed (the code that you showed us)...

Try returning a empty var from your controller if you have noting to compute
in your controller... Something like this :

def func():
a = None
return dict(a=a)

use the same controller name and view name of the function in the folder of
the dedicated controller in your view...

Richard

On Thu, Sep 8, 2011 at 4:45 PM, Richard Dijkstra  wrote:

>  The view is not executed. Adding return dict() doesn't have effect. Even
> this dict() does not lead to an error.
>
>
> {{extend 'layout.html'}}
> {{if 'message' in globals():}}
>
>  Outfile from Matplotlib
> 
> 
>
> return dict()
>
>
>
> Op 8-9-2011 22:24, Anthony schreef:
>
> Have you shown us your entire index() function? If so, your view file isn't
> getting called at all because your index function is not returning a
> dictionary. Instead, web2py is simply returning whatever your function
> returns, which is probably None if the last line is a call to plt.savefig().
> Add return dict() to the end of your index function, and see if it works.
> Views are only called if the controller function returns a dictionary.
>
>  Anthony
>
> On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote:
>>
>>  The mp1.png file is in the static directory of my application
>>
>> The following views/default/index  only gives an empty page with
>> "None"  in the top left corner.
>>
>> {{left_sidebar_enabled=right_**sidebar_enabled=False}}
>>
>> {{extend 'layout.html'}}
>> {{if 'message' in globals():}}
>>
>> {{=message}}
>>
>> #Events
>> #{{=db().select(db.Events.ALL)**}}
>>
>>  Outfile from Matplotlib
>> 
>> 
>>
>> {{else:}}
>> {{=BEATIFY(response.vars)}}
>> {{pass}}
>>
>> {{block left_sidebar}}New Left Sidebar Content{{end}}
>> {{block right_sidebar}}New Right Sidebar Content{{end}}
>>
>>
>> Op 7-9-2011 23:35, Richard Dijkstra schreef:
>>
>> Looking closer an output window appears and the console gives errors on
>> the sequence of calling matplotlib.backends:
>>
>>  I'll check first.
>>
>>
>>
>>  Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:
>>
>> But does 
>> plt.savefig(os.path.join(**request.folder,'static','mp1.**png'),format='png')
>> result in a file being saved in c:\web2py\applications\your_**app\static\?
>>
>>
>>
>> On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:
>>>
>>>  Anthony,
>>>
>>> plt.savefig('c:\web2py\**outputfile.png',format='png')
>>>
>>> does me give an accessable png-file
>>>
>>> Op 7-9-2011 22:20, Anthony schreef:
>>>
>>> Have you confirmed that the file is actually getting saved in the
>>> expected location? Are you able to run the matplotlib code and save the file
>>> outside of web2py?
>>>
>>>
>>> On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote:

  Only adding the .png extention is not sufficient.

 outputfile = os.path.join(request.folder,'**static','mp1.png')
 plt.savefig(outputfile,format=**'png')


  Outfile from Matplotlib
 
 


 Besides this issue; is using a temporarily file a mature solution or is
 streaming preferrable?

 Richard


 Op 7-9-2011 21:46, Anthony schreef:

 On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard wrote:
>
>
> 
>

  Should be URL('static','mp1.png').

  Anthony


 Geen virus gevonden in het binnenkomende-bericht.
 Gecontroleerd door AVG - www.avg.com
 Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
 09/02/11 08:34:00




>>>
>>> Geen virus gevonden in het binnenkomende-bericht.
>>> Gecontroleerd door AVG - www.avg.com
>>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
>>> 09/02/11 08:34:00
>>>
>>>
>>>
>>>
>>
>>
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
>> 08:35:00
>>
>>
>>
>>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
> 08:35:00
>
>
>
>


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Dijkstra
The view is not executed. Adding return dict() doesn't have effect. Even 
this dict() does not lead to an error.


{{extend 'layout.html'}}
{{if 'message' in globals():}}

 Outfile from Matplotlib



return dict()



Op 8-9-2011 22:24, Anthony schreef:
Have you shown us your entire index() function? If so, your view file 
isn't getting called at all because your index function is not 
returning a dictionary. Instead, web2py is simply returning whatever 
your function returns, which is probably None if the last line is a 
call to plt.savefig(). Add return dict() to the end of your index 
function, and see if it works. Views are only called if the controller 
function returns a dictionary.


Anthony

On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote:

The mp1.png file is in the static directory of my application

The following views/default/index  only gives an empty page with
   "None"  in the top left corner.

{{left_sidebar_enabled=right_sidebar_enabled=False}}

{{extend 'layout.html'}}
{{if 'message' in globals():}}

{{=message}}

#Events
#{{=db().select(db.Events.ALL)}}

 Outfile from Matplotlib



{{else:}}
{{=BEATIFY(response.vars)}}
{{pass}}

{{block left_sidebar}}New Left Sidebar Content{{end}}
{{block right_sidebar}}New Right Sidebar Content{{end}}


Op 7-9-2011 23:35, Richard Dijkstra schreef:

Looking closer an output window appears and the console gives
errors on the sequence of calling matplotlib.backends:

I'll check first.



Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:


But does
plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png')
result in a file being saved in
c:\web2py\applications\your_app\static\?


On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:

Anthony,

plt.savefig('c:\web2py\outputfile.png',format='png')

does me give an accessable png-file

Op 7-9-2011 22:20, Anthony schreef:

Have you confirmed that the file is actually getting saved
in the expected location? Are you able to run the
matplotlib code and save the file outside of web2py?


On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard
wrote:

Only adding the .png extention is not sufficient.

outputfile =
os.path.join(request.folder,'static','mp1.png')
plt.savefig(outputfile,format='png')


 Outfile from Matplotlib




Besides this issue; is using a temporarily file a
mature solution or is streaming preferrable?

Richard


Op 7-9-2011 21:46, Anthony schreef:

On Wednesday, September 7, 2011 3:35:23 PM UTC-4,
Richard wrote:





Should be URL('static','mp1.png').

Anthony


Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00







Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 
09/05/11 08:35:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
08:35:00





[web2py] Re: Date Picker Widget

2011-09-08 Thread Paul Gerrard
Hi,

I used this css as is (although I did change the background colour to
match my site. however... I'm using the dat picker on a field
displayed in a jquerydialog. the datepicket pops up - behind the
dialog box. I think the z-indexvalue needs bumping up (or is it
down?)

Looks good tho :O)

On Sep 7, 7:23 am, annet  wrote:
> Hi David,
>
> I didn't like the calendar that comes with web2py, not for its
> functionality but for its appearance. Instead of replacing it I just
> restyled it:
>
> .calendar {
>   cursor: default;
>   background-color: #FF;
>   color: #44;
>   font-size: 11px;
>   border: 1px solid #AA;
>   border-radius: 6px;
>   -webkit-border-radius: 6px;
>   -moz-border-radius: 6px;
>   padding: 6px;}
>
> .calendar table {
>   border-collapse: separate;
>   border-spacing: 2px;}
>
> .calendar thead {}
> .calendar thead tr, .calendar thead .headrow {
>   background-color: #4169E1;
>   color: #44;}
>
> .calendar thead .daynames {}
> .calendar .button, .calendar thead .title {
>   color: #FF;
>   font-size: 12px;
>   text-align: center;
>   padding: 3px;}
>
> .calendar thead tr .hilite, .calendar thead tr .active, .calendar
> thead .headrow .hilite, .calendar thead .headrow .active {
>   background-color: #FF;
>   color: #4169E1;
>   padding: 3px;}
>
> .calendar thead .daynames .hilite, .calendar thead .daynames .active {
>   background-color: #FF;
>   color: #44;}
>
> .calendar thead .name {
>   background-color: #FF;
>   text-align: center;
>   padding: 3px;}
>
> .calendar tbody {}
> .calendar tbody td {
>   text-align: right;
>   border: 1px solid #AA;}
>
> .calendar tbody td.hilite {
>   background-color: #77;
>   color: #FF;}
>
> .calendar tbody td.active, .calendar tbody td.selected {
>   font-weight: bold;
>   background-color: #FF;
>   color: #4169E1;}
>
> .calendar tbody td.today {
>   font-weight: bold;
>   background-color: #4169E1;
>   color: #FF;}
>
> .calendar tbody .disabled {
>   color: #77;}
>
> .calendar tbody .emptycell {
>   visibility: hidden;}
>
> .calendar tbody .emptyrow {
>   display: none;}
>
> .calendar tfoot .ttip {
>   background-color: #77;
>   color: #FF;
>   text-align: center;
>   border: 1px solid #33;
>   padding: 1px;}
>
> .calendar tfoot .hilite {
>   padding: 1px;
>   background-color:
>   #EE;}
>
> .calendar tfoot .active {
>   padding: 2px 0px 0px 2px;}
>
> .calendar .combo {
>   background-color: #FF;
>   position: absolute;
>   display: none;
>   width: 4em;
>   top: 0px;
>   left: 0px;
>   cursor: default;
>   border: 1px solid #DD;
>   padding: 1px;
>   z-index: 100;}
>
> .calendar .combo .label, .calendar .combo .label-IEfix {
>   text-align: center;
>   padding: 1px;}
>
> .calendar .combo .label-IEfix {
>   width: 4em;}
>
> .calendar .combo .active {
>   background-color: #CC;
>   color: #FF;
>   padding: 0px;}
>
> .calendar .combo .hilite {
>   background-color: #77;
>   color: #FF;}
>
> .floatleft {
>   float: left;}
>
> .CP_over {
>   background-color: #FF
>  }
>
> Just another option ;-)
>
> Kind regards,
>
> Annet.


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Dijkstra

Richard,

To be sure about the comment I made the following view, which had the 
same None  result


{{extend 'layout.html'}}

 Outfile from Matplotlib



regards,
Richard



Op 8-9-2011 22:11, Richard Vézina schreef:
Not sure but I think there is a mistake in your view that should be ok 
without it


The # not work to comment a line in the view so try remove your line 
completly or you may try with  html commenting caracter... But 
those don't prevent web2py to interpret the {{=}}, so what I usually 
do si to remove the "="


Hope it helps

Richard


On Thu, Sep 8, 2011 at 3:55 PM, Richard Dijkstra 
mailto:richard.dijks...@planet.nl>> wrote:


The mp1.png file is in the static directory of my application

The following views/default/index  only gives an empty page with
   "None"  in the top left corner.

{{left_sidebar_enabled=right_sidebar_enabled=False}}

{{extend 'layout.html'}}
{{if 'message' in globals():}}

{{=message}}

#Events
#{{=db().select(db.Events.ALL)}}


 Outfile from Matplotlib



{{else:}}
{{=BEATIFY(response.vars)}}
{{pass}}

{{block left_sidebar}}New Left Sidebar Content{{end}}
{{block right_sidebar}}New Right Sidebar Content{{end}}


Op 7-9-2011 23:35, Richard Dijkstra schreef:

Looking closer an output window appears and the console gives
errors on the sequence of calling matplotlib.backends:

I'll check first.



Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:


But does
plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png')
result in a file being saved in
c:\web2py\applications\your_app\static\?


On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:

Anthony,

plt.savefig('c:\web2py\outputfile.png',format='png')

does me give an accessable png-file

Op 7-9-2011 22:20, Anthony schreef:

Have you confirmed that the file is actually getting saved
in the expected location? Are you able to run the
matplotlib code and save the file outside of web2py?


On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard
wrote:

Only adding the .png extention is not sufficient.

outputfile =
os.path.join(request.folder,'static','mp1.png')
plt.savefig(outputfile,format='png')


 Outfile from Matplotlib




Besides this issue; is using a temporarily file a
mature solution or is streaming preferrable?

Richard


Op 7-9-2011 21:46, Anthony schreef:

On Wednesday, September 7, 2011 3:35:23 PM UTC-4,
Richard wrote:





Should be URL('static','mp1.png').

Anthony


Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00







Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd
door AVG - www.avg.com 

Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 
09/05/11 08:35:00






Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
08:35:00





Re: [web2py] Re: matplotlib output

2011-09-08 Thread Anthony
Have you shown us your entire index() function? If so, your view file isn't 
getting called at all because your index function is not returning a 
dictionary. Instead, web2py is simply returning whatever your function 
returns, which is probably None if the last line is a call to plt.savefig(). 
Add return dict() to the end of your index function, and see if it works. 
Views are only called if the controller function returns a dictionary.

Anthony

On Thursday, September 8, 2011 3:55:35 PM UTC-4, Richard wrote:
>
>  The mp1.png file is in the static directory of my application
>
> The following views/default/index  only gives an empty page with"None"  
> in the top left corner.
>
> {{left_sidebar_enabled=right_sidebar_enabled=False}}
>
> {{extend 'layout.html'}}
> {{if 'message' in globals():}}
>
> {{=message}}
>
> #Events
> #{{=db().select(db.Events.ALL)}}
>
>  Outfile from Matplotlib
> 
> 
>
> {{else:}}
> {{=BEATIFY(response.vars)}}
> {{pass}}
>
> {{block left_sidebar}}New Left Sidebar Content{{end}}
> {{block right_sidebar}}New Right Sidebar Content{{end}}
>
>
> Op 7-9-2011 23:35, Richard Dijkstra schreef: 
>
> Looking closer an output window appears and the console gives errors on the 
> sequence of calling matplotlib.backends:
>
>  I'll check first.
>
>  
>  
>  Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:
>
> But does 
> plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png') 
> result in a file being saved in c:\web2py\applications\your_app\static\? 
>
>  
> On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote: 
>>
>>  Anthony,
>>
>> plt.savefig('c:\web2py\outputfile.png',format='png')
>>
>> does me give an accessable png-file
>>
>> Op 7-9-2011 22:20, Anthony schreef: 
>>
>> Have you confirmed that the file is actually getting saved in the expected 
>> location? Are you able to run the matplotlib code and save the file outside 
>> of web2py? 
>>
>>  
>> On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote: 
>>>
>>>  Only adding the .png extention is not sufficient.
>>>
>>> outputfile = os.path.join(request.folder,'static','mp1.png')
>>> plt.savefig(outputfile,format='png')
>>>
>>>
>>>  Outfile from Matplotlib
>>> 
>>> 
>>>
>>>
>>> Besides this issue; is using a temporarily file a mature solution or is 
>>> streaming preferrable?
>>>
>>> Richard
>>>
>>>
>>> Op 7-9-2011 21:46, Anthony schreef: 
>>>
>>> On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard wrote: 


 

>>>
>>>  Should be URL('static','mp1.png').
>>>
>>>  Anthony
>>>
>>>  
>>> Geen virus gevonden in het binnenkomende-bericht.
>>> Gecontroleerd door AVG - www.avg.com 
>>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
>>> 09/02/11 08:34:00
>>>
>>>
>>>  
>>>   
>>  
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com 
>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 09/02/11 
>> 08:34:00
>>
>>
>>  
>>
>
>  
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com 
> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
> 08:35:00
>
>
>  
>  

[web2py] Re: select (field alias)

2011-09-08 Thread Anthony
You can select db.mytbl.id*2, but I don't think you can reference the result 
with an alias -- you'd have to reference it with something like 
rows[0]['(mytbl.id 
* 2)']. Of course, for convenience, you could define fld2='(mytbl.id * 2)' and 
 then do rows[0][fld2].

What do you want to do with the results?

Anthony

On Thursday, September 8, 2011 3:07:55 AM UTC-4, Noel Villamor wrote:
>
> I am aware about: 
> tblAlias = db.mytbl.with_alias('tblAlias') 
>
> Is there a similar thing that we can use for fields in select()? 
> As in: 
> ... .select( db.mytbl.id, db.mytbl.id*2 as fld2) 
>
>
>
>
>

[web2py] Re: widget for list:reference field in SQLFORM

2011-09-08 Thread monotasker
Thanks for the links. I'm still trying to figure out how much to look
for the framework to do and how much to look for client-side
solutions. This helps.

Ian

On Sep 7, 5:48 pm, Anthony  wrote:
> Since developers will have different preferences for multiselect widgets and
> it is so easy to plug something in on the client side, I'm not sure the
> framework needs to commit to a particular widget. Here are a few good
> options:
>
> http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/...http://www.quasipartikel.at/multiselect/http://jqueryui.com/demos/autocomplete/#multiple
>
>
>
>
>
>
>
> On Wednesday, September 7, 2011 5:12:55 PM UTC-4, monotasker wrote:
>
> > OK. That description confused me in the book (I'm not used to
> > describing multi-select boxes as a 'drop-box' so I assumed it meant
> > drop-down). Thanks. I think it would be more usable if the default
> > widget were something like the one used in the app-creation wizard for
> > table and field creation:
>
> > 1) present a single text field with autocomplete based on the
> > referenced table, then
>
> > 2) when the user fills that field (or on ?) another field
> > appears below it.
>
> > A multi-select field doesn't seem to me very user-friendly if we're
> > trying to select multiple options from a long pre-populated set of
> > choices. The user has to use CTRL-LMB just to select a second option,
> > and has to scroll manually through the list. Do you think this is
> > something worth changing?
>
> > Ian
>
> > On Sep 7, 4:02 pm, Anthony  wrote:
> > > No, you should not get a series of select boxes, just a single
> > multi-select
> > > box, like
> > > this:
> >http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple.
>
> > > The book states that a list:reference field "produces a
> > SELECT/OPTIONmultiple drop-box".
>
> > > Anthony
>
> > > On Wednesday, September 7, 2011 3:43:11 PM UTC-4, monotasker wrote:
>
> > > > In a form generated by SQLFORM I'm finding that a list:reference field
> > > > is represented with a single list-box. What I expected based on the
> > > > section on list: in the manual was a series of select boxes. Was
> > > > I reading the manual wrong? If not, does anyone know why I might be
> > > > getting the wrong widget presented?
>
> > > > Here is the relevant part of my model:
>
> > > > db.define_table('tags',
> > > >     Field('tag', 'string'), format='%(tag)s')
>
> > > > db.tags.tag.requires = IS_NOT_IN_DB(db, db.tags.tag)
>
> > > > db.define_table('questions',
> > > >     Field('question', 'text', required=True),
> > > >     Field('answer', 'string', required=True),
> > > >     Field('score', default=1, required=True),
> > > >     Field('answer2', 'string', default='null'),
> > > >     Field('score2', 'double', default=0.5),
> > > >     Field('answer3', 'string', default='null'),
> > > >     Field('score3', 'double', default=0.3),
> > > >     Field('readable_answer', 'string', default='null'),
> > > >     Field('tags', 'list:reference tags'),
> > > >     Field('nt_frequency', 'double'))
>
> > > > db.questions.tags.requires = IS_IN_DB(db, 'tags.id', db.tags._format,
> > > > multiple=True)
>
> > > > And here is the controller that creates the form:
>
> > > > def create_question():
> > > >     form = SQLFORM(db.questions)
> > > >     if form.accepts(request.vars, session):
> > > >         response.flash = 'form accepted'
> > > >     elif form.errors:
> > > >         response.flash = 'form has errors'
> > > >     else:
> > > >         response.flash = 'please fill out the form'
> > > >     return dict(form=form)


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Vézina
Not sure but I think there is a mistake in your view that should be ok
without it

The # not work to comment a line in the view so try remove your line
completly or you may try with  html commenting caracter... But those
don't prevent web2py to interpret the {{=}}, so what I usually do si to
remove the "="

Hope it helps

Richard


On Thu, Sep 8, 2011 at 3:55 PM, Richard Dijkstra  wrote:

>  The mp1.png file is in the static directory of my application
>
> The following views/default/index  only gives an empty page with"None"
> in the top left corner.
>
> {{left_sidebar_enabled=right_sidebar_enabled=False}}
>
> {{extend 'layout.html'}}
> {{if 'message' in globals():}}
>
> {{=message}}
>
> #Events
> #{{=db().select(db.Events.ALL)}}
>
>
>  Outfile from Matplotlib
> 
> 
>
> {{else:}}
> {{=BEATIFY(response.vars)}}
> {{pass}}
>
> {{block left_sidebar}}New Left Sidebar Content{{end}}
> {{block right_sidebar}}New Right Sidebar Content{{end}}
>
>
> Op 7-9-2011 23:35, Richard Dijkstra schreef:
>
> Looking closer an output window appears and the console gives errors on the
> sequence of calling matplotlib.backends:
>
>  I'll check first.
>
>
>
>  Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:
>
> But does 
> plt.savefig(os.path.join(request.folder,'**static','mp1.png'),format='png')
> result in a file being saved in c:\web2py\applications\your_app\static\?
>
>
> On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:
>>
>>  Anthony,
>>
>> plt.savefig('c:\web2py\**outputfile.png',format='png')
>>
>> does me give an accessable png-file
>>
>> Op 7-9-2011 22:20, Anthony schreef:
>>
>> Have you confirmed that the file is actually getting saved in the expected
>> location? Are you able to run the matplotlib code and save the file outside
>> of web2py?
>>
>>
>> On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote:
>>>
>>>  Only adding the .png extention is not sufficient.
>>>
>>> outputfile = os.path.join(request.folder,'**static','mp1.png')
>>> plt.savefig(outputfile,format=**'png')
>>>
>>>
>>>  Outfile from Matplotlib
>>> 
>>> 
>>>
>>>
>>> Besides this issue; is using a temporarily file a mature solution or is
>>> streaming preferrable?
>>>
>>> Richard
>>>
>>>
>>> Op 7-9-2011 21:46, Anthony schreef:
>>>
>>> On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard wrote:


 

>>>
>>>  Should be URL('static','mp1.png').
>>>
>>>  Anthony
>>>
>>>
>>> Geen virus gevonden in het binnenkomende-bericht.
>>> Gecontroleerd door AVG - www.avg.com
>>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
>>> 09/02/11 08:34:00
>>>
>>>
>>>
>>>
>>
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 09/02/11 
>> 08:34:00
>>
>>
>>
>>
>
>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
>
> Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
> 08:35:00
>
>
>
>


Re: [web2py] Re: matplotlib output

2011-09-08 Thread Richard Dijkstra

The mp1.png file is in the static directory of my application

The following views/default/index  only gives an empty page with
"None"  in the top left corner.


{{left_sidebar_enabled=right_sidebar_enabled=False}}

{{extend 'layout.html'}}
{{if 'message' in globals():}}

{{=message}}

#Events
#{{=db().select(db.Events.ALL)}}

 Outfile from Matplotlib



{{else:}}
{{=BEATIFY(response.vars)}}
{{pass}}

{{block left_sidebar}}New Left Sidebar Content{{end}}
{{block right_sidebar}}New Right Sidebar Content{{end}}


Op 7-9-2011 23:35, Richard Dijkstra schreef:
Looking closer an output window appears and the console gives errors 
on the sequence of calling matplotlib.backends:


I'll check first.



Op 7 sep 2011, om 22:43 heeft Anthony het volgende geschreven:

But does 
plt.savefig(os.path.join(request.folder,'static','mp1.png'),format='png') 
result in a file being saved in c:\web2py\applications\your_app\static\?



On Wednesday, September 7, 2011 4:38:13 PM UTC-4, Richard wrote:

Anthony,

plt.savefig('c:\web2py\outputfile.png',format='png')

does me give an accessable png-file

Op 7-9-2011 22:20, Anthony schreef:

Have you confirmed that the file is actually getting saved in
the expected location? Are you able to run the matplotlib code
and save the file outside of web2py?


On Wednesday, September 7, 2011 4:05:08 PM UTC-4, Richard wrote:

Only adding the .png extention is not sufficient.

outputfile = os.path.join(request.folder,'static','mp1.png')
plt.savefig(outputfile,format='png')


 Outfile from Matplotlib




Besides this issue; is using a temporarily file a mature
solution or is streaming preferrable?

Richard


Op 7-9-2011 21:46, Anthony schreef:

On Wednesday, September 7, 2011 3:35:23 PM UTC-4, Richard
wrote:





Should be URL('static','mp1.png').

Anthony


Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00





Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG -www.avg.com  
Versie: 9.0.872 / Virusdatabase: 271.1.1/3872 - datum van uitgifte: 
09/02/11 08:34:00







Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.872 / Virusdatabase: 271.1.1/3878 - datum van uitgifte: 09/05/11 
08:35:00





Re: [web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Valter Foresto
*Great framework mean great peoples with great ideas, great technical 
knowlwdge and passion !*

Thank to Massimo, to Web2Py developers and all web2py-users group supports 
and users peoples.
- Valter


[web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Christopher Steel
congratulations everyone and thank you Massimo for creating, leading and 
keeping the Web2py project so awesome. This is well deserved recognition for 
a project that rocks in so very many ways.




[web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread guruyaya
+1

On Sep 8, 5:59 am, wwwgong  wrote:
> Congratulations!
>
> more details from 
> here:http://www.infoworld.com/d/open-source-software/bossie-awards-2011-th...


Re: [web2py] Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Kenneth Lundström
> I am new to web2py (I've been using Django), and I am confused about 
a couple of things.


Welcome to web2py.

> First, the presence of multiple controllers.

Every time a function in the controller is called the whole file is 
compiled. By having smaller controller you get an faster application. If 
I have e.g. five options in mainmenu I create five different controllers.


All .py files in models directory is processed for every request. So you 
can have everything in one file or in 20 files. Files are processed in 
alphabetical order.


I have made four files, 1_db_settings (name of the database, password 
and so on), 2_database (table declarations), 3_functions (if needed I 
create functions that can be used in every controller), 4_meny 
(declaration of the meny).


Hope this helps a bit.


Kenneth
Second, in the default setup, I see db.py and menu.py.   In db.py it 
is noted that I should really add my table declarations to another 
model file.  But, all the logic to decide if web2py is running on 
appengine or not, etc, is all in db.py; if I write my table 
declarations in another file, do I have to cut and paste that logic?  
Or how is this supposed to work?  All the example in the tutorial just 
edit db.py.


Many thanks! --Luca





[web2py] Re: Why multiple controllers, models, and what to do with them?

2011-09-08 Thread howesc
Luca,

multiple controllers allow you to break your code into logical chunks, so 
big projects are more manageable.  there are a few different options for URL 
routing to make the URLs your user sees something different from the 
underlying structure.  Take a look in the web2py book for info on the 
routers.  I tend to route a specific controller/function to be the default 
that services my domain, and then keep the controller/function path for 
other pages

i have not looked at the default generated db.py in a whilebut check the 
book for the section on how models are loaded.  you can create one large 
db.py, though it is recommended that you split files for code organization.  
you only need the bootstrap logic once, in the first model file that is 
loaded (models are loaded alphabetically)

hope that helps some!

cfh


[web2py] Integrate Third Party Modules that Connect to MySql DB

2011-09-08 Thread rami
Hello everyone,

1)
I know web2py provides the DAL, however I have already Python code
(let's call it "third party") that connects to a MySql database, has
some classes that hold the data, and returns objects that contain data
that I need to display in the website and not just display but of
course I want to be able to change the data in the MySql databse by
using this Third Party module.
I am new to the MVC architecture and I kind of see how web2py is using
the "Model" part of it with DAL. So, if my third party code deals with
the database, does that mean that I just do not use the Models part of
the web2py and I just import all the third party modules inside my
controllers? (This is the first option.) I did try importing the third
party modules and I can successfully retrieve data inside my
controller, but I am wondering if this is the way to go...I mean I
want to have a nice designed website. I am a bit new with building
websites and so I also want to know what is the proper way to design
and integrate these two components: my third party code with web2py.

Or as a second option, I was thinking to create some more files inside
the Models and import those third party modules in there? Not sure how
will work though since the models is all supposed to nicely work with
DAL. I will need a few hints on how to set this up.

I kept reading that Web2py is compatible with MySql, but how does that
work?


2)
Also, since I am new to web2py, the reason why I tried it is because
everybody says that is pretty easy to get started (easier than
Django). I like it so far, but I feel like I am reading and reading
and reading, but I still 20 questions about how to build the website I
want and feel that is taking a bit longer than I expected (maybe just
because I am relatively new with MVC and am not a pro yet in building
websites especially in python). Does anybody recommend a good way to
get started with web2py? Like I kind of did the first part of Overview
Chapter, and then I went over the The View Chapter and now I am
starting to read about the core...and I somehow wanna see how I can
build my website after reading all this. Any suggestions would be
useful. The main core part of my website is to work with this third
party code and to use JQuery and Ajax to update things that it
displays on the fly data from the database.


Thank you for reading and thank you in advance for helping!


[web2py] Re-Launch a Better version www.beunick.com

2011-09-08 Thread Yannick
Beunick App sitting on top of Web2py has a new version.

Thanks to Massimo for this great Web2py Tool.

Check it out on:   http://www.beunick.com

Drop us some feedback if you can.

Cheers,
Yannick P.


[web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Yannick
I'm Happy Congrat!

On Sep 7, 10:59 pm, wwwgong  wrote:
> Congratulations!
>
> more details from 
> here:http://www.infoworld.com/d/open-source-software/bossie-awards-2011-th...


[web2py] Re: About the welcome app

2011-09-08 Thread Massimo Di Pierro
Never heard of it before.

On Sep 8, 11:01 am, António Ramos  wrote:
> does the web2py-adm...@googlegroups.com still exists?
>
> What do they have about the new admin they talked about months ago?
>
> 2011/9/8 Massimo Di Pierro 
>
>
>
>
>
>
>
> > This is a problem indeed.
>
> > Anyway, I think it would be a good idea to have a convention about
> > icons representing apps. Listing all the apps publicly does not belong
> > in welcome and it is a security hazard. there could be a public page
> > in admin that does that and admin can be disabled anyway.
>
> > On Sep 8, 8:45 am, Richard Vézina  wrote:
> > > But the idea of António is pretty nice...
>
> > > Only one problem, the speed of development web2py seems to generate
> > obsolete
> > > code in the applications published that force Massimo to launch adopt an
> > App
> > > movement... I don't know if it as work until now... I think this should
> > be
> > > fixed first, I mean make evolve the published apps at the same rythm of
> > > evolution than web2py...
>
> > > Richard
>
> > > On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
> > > > The 'welcome' app is intended to be a scaffolding upon which to build
> > an
> > > > app. The app selector you suggest might be more appropriate for
> > inclusion in
> > > > the 'admin' app (where the 'welcome' app could be one of the choices).
>
> > > > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
>
> > > >> I think the welcome app should be for users to see all apps available
> > > >> i would like to see an welcome app like the attached file
> > > >> All apps are associated with an icon for easy remembering
>
> > > >> António
>
> > > >> 2011/9/8 pbreit 
>
> > > >> I certainly would not call it useless. It provides a bit of
> > information
> > > >>> about how pages get rendered as well as some useful links.
>
> > > >>> Do you have any suggestions for how to improve?


Re: [web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Phyo Arkar
Wow .This is very big!

Congrats Massimo and all the web2py developers!

On Thu, Sep 8, 2011 at 8:45 PM, Ivica Kralj  wrote:

> Congratulation!!
> This is something members of this group knew already anyway :) Although,
> it's great to have recognition on black and white... or in html, for
> everybody to see it. ;)
>
>
>
> On 8 September 2011 14:37, LightDot  wrote:
>
>> Congratulations!
>>
>> I'm glad to see CakePHP and web2py receive an award in the same category.
>> IMHO, these truly are top frameworks for PHP and python.
>>
>
>


[web2py] Re: gluon.widget.start(cron=True)

2011-09-08 Thread Massimo Di Pierro
This is web2py.py (starts web2py) except you have an extra line

On Sep 8, 11:43 am, annet  wrote:
> I came a cross this file and wonder what it does.
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import os
> import sys
>
> try:
>     path = os.path.dirname(os.path.abspath(__file__))
> except NameError:
>     path=os.getcwd() # Seems necessary for py2exe
>
> if not path in sys.path:
>     sys.path.append(path)
> os.chdir(path)
>
> # import gluon.import_all
> import gluon.widget
>
> # Start Web2py and Web2py cron service!
> gluon.widget.start(cron=True)
>
> According to the comment I wrote it has something to do with memory
> usage
>
> Kind regards,
>
> Annet.


[web2py] Why multiple controllers, models, and what to do with them?

2011-09-08 Thread Luca
I am new to web2py (I've been using Django), and I am confused about a 
couple of things. 

First, the presence of multiple controllers. 
I am trying to build a main app, called (say) www.example.com. 
So I would like to have something like www.example.com/index.html
But if I use the default.py controller, the URL that is automatically mapped 
is default/index.html, not index.html directly.  How do people typically 
organize their URL schema? 

Second, in the default setup, I see db.py and menu.py.   In db.py it is 
noted that I should really add my table declarations to another model file.  
But, all the logic to decide if web2py is running on appengine or not, etc, 
is all in db.py; if I write my table declarations in another file, do I have 
to cut and paste that logic?  Or how is this supposed to work?  All the 
example in the tutorial just edit db.py. 

Many thanks! --Luca



[web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Jesús
+1


Re: [web2py] message when login required

2011-09-08 Thread Richard Vézina
For myself I made a kind of gate login page like ubuntu... So as long as you
are not loged on you don't access the page and see noting except the login
page...

But, for sure it's not applicable to all situation...

The only problem with my design is that I can't byte compile cause I return
from the controller the proper layout to be shown to the user if he is loged
or not...

Richard

On Wed, Sep 7, 2011 at 7:22 PM, Chris Steel  wrote:

> A long time ago someone talked about adding a message parameter to
> @auth.requires_login() so that a message could be passed but it does not
> seem to be working:
>
> Example:
>
> @auth.requires_login(message=T('You need to be log in to perform this
> action'))
> def blog_create_entry:
> bla bla bla
> return...
>
> Did this ever get added or can we do this another way. Right now users are
> automatically redirected to the login screen which I am guessing is a bit
> confusing because we have no message explaining what happened.
>
> Thanks
> --
>
> Christopher Steel
>
> Voice of Access
>


Re: [web2py] Re: list:reference , reprensent not working : potential issue

2011-09-08 Thread Richard Vézina
I forgot that I had create it [?], here it is :

http://code.google.com/p/web2py/issues/detail?id=382&q=list

Thanks to taking care...

Richard

On Thu, Sep 8, 2011 at 11:51 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Please open a ticket.
>
> On Sep 8, 8:57 am, Richard Vézina  wrote:
> > PING
> >
> > Richard
> >
> > On Wed, Aug 17, 2011 at 4:43 PM, Richard Vézina <
> ml.richard.vez...@gmail.com
> >
> >
> >
> >
> >
> >
> >
> > > wrote:
> > > Ok, forget notice, I think, I just should use something like this :
> >
> > > db.table2.linked_self.requires=\
> > > IS_EMPTY_OR(IS_IN_DB(db,'table2.id','%(field1t2)s',\
> > > orderby=('field1t2'),multiple=True))
> >
> > > But, still the list representation not working in crud.select for self
> > > referenced field.
> >
> > > Richard
> >
> > > On Wed, Aug 17, 2011 at 4:29 PM, Richard Vézina <
> > > ml.richard.vez...@gmail.com> wrote:
> >
> > >> Here a simple app that show the problem, I made on the same table a
> self
> > >> referenced field and a foreign referenced field...
> >
> > >> I notice, also, that the "nav built-in wigdet" for multiple don't
> works
> > >> neither in the crud.update or create form...
> >
> > >> Thanks
> >
> > >> Richard
> >
> > >> On Wed, Aug 17, 2011 at 4:09 PM, Richard  >wrote:
> >
> > >>> Hello,
> >
> > >>> I think I have a issue with list:reference with a self referenced
> > >>> table the representation not working in sqltable... It's work when I
> > >>> change my referenced table from the self referenced to a different
> > >>> table...
> >
> > >>> Book says :
> > >>> While list:reference has a default validator and a default
> > >>> representation...
> >
> > >>> web2py 1.98.2
> >
> > >>> Thanks
> >
> > >>> Richard
>
<<330.gif>>

Re: [web2py] problems changing database field type

2011-09-08 Thread Richard Vézina
Drop the table... and recreate it... Use pgAdmin or erase your db model
reload your app... paste your model reload...

Don't need fake migrate just migrate true...


Richard

On Thu, Sep 8, 2011 at 1:36 PM, Eric  wrote:

> I'm running web2py on PostGreSQL.  I accidentally created a model that
> specified a table with column type "double" when I needed "decimal".
> Now I'm trying to change it from double to decimal, with no luck.  I
> deleted all the records, and have used
> 'migrate=True,fake_migrate=True', and all the variations thereof.
> Will I need to re-create the app to change the database field type?
>
> Changing models (adding or modifying columns) is a problem I've
> encountered consistently with web2py, and it's the one problem that
> (so far) I've been unable to trace back to my own mistake or
> oversight.  Working with the DAL is not easy, even when using
> PostGreSQL.
>
> Thanks in advance for your help.


[web2py] Testing ajax autocompletion as said in the book

2011-09-08 Thread António Ramos
hello i´m testing ajax auto completion example as said in the book
it works fine

Now i want to return not the months for the user to select but an image
because i´m testing graphviz dot language!

the user writes for example

a->b
an image is created . It see it in the image in the static folder
then a->b->C
the first images is updated.  I see the updated image it in the static
folder

 However in the view in the browser i only see the first image. I have to
mousover the image and select update image . Why


*My view*
{{extend 'layout.html'}}

#suggestions { position: relative; }
.suggestions { background: white; border: solid 1px #55A6C8; }
.suggestions DIV { padding: 2px 4px 2px 4px; }







jQuery("#strCmd").keyup(function(){
ajax('Graphit', ['strCmd'], 'suggestions')});



*Controller:*
def Graphit():
temp=request.vars.strCmd
print temp
if not temp: return ''
dott = win32com.client.Dispatch(r'Wingraphviz.dot')
img=win32com.client.Dispatch(r'Wingraphviz.BinaryImage')

strCMD2 = "digraph G {"+temp+";}"
print strCMD2
img=dott.ToGIF(strCMD2)

img.Save((os.path.join(request.folder,'static','wf.gif')))
return IMG(_src=URL('static','wf.gif'))


Strangers in the night  :)


[web2py] problems changing database field type

2011-09-08 Thread Eric
I'm running web2py on PostGreSQL.  I accidentally created a model that
specified a table with column type "double" when I needed "decimal".
Now I'm trying to change it from double to decimal, with no luck.  I
deleted all the records, and have used
'migrate=True,fake_migrate=True', and all the variations thereof.
Will I need to re-create the app to change the database field type?

Changing models (adding or modifying columns) is a problem I've
encountered consistently with web2py, and it's the one problem that
(so far) I've been unable to trace back to my own mistake or
oversight.  Working with the DAL is not easy, even when using
PostGreSQL.

Thanks in advance for your help.


Re: [web2py] Re: select box size (height) : how to change in View

2011-09-08 Thread Martín Mulone
perhaps you want something like this?:

form#yourid select {height: 50px;}


2011/9/8 Vineet 

> I have posted the code in 'View' file at
>
> http://stackoverflow.com/questions/7343374/web2py-view-height-size-of-a-select-box-in
> So avoiding the reposting of code here.
>
> ---Vineet
>
> On Sep 8, 4:01 pm, Vineet  wrote:
> > @Kenneth Lundström, @Martín Mulone,
> > I agree that this is an issue related to css setting.
> >
> > Somewhere in a /static/css file(s), there is a setting which is
> > forcing the  box of size="1".
> > Same  box is accepting size="1" in a standalone html file
> > (outside of web2py).
> >
> > Can anybody pl. point out which is that css file & what is the proper
> > place in that file to set (or maybe remove) the "size= "
> > setting.
> >
> > ---Vineet
> >
> > On Sep 8, 3:11 pm, Martín Mulone  wrote:
> >
> >
> >
> > >http://stackoverflow.com/questions/119961/select-tags-size-attribute-.
> ..
> >
> > > 2011/9/8 Kenneth Lundström 
> >
> > > > This is just a wild guess but I think CSS is doing it.
> >
> > > > Kenneth
> >
> > > >  I wish to render a select box with size="3" sothat it will display 3
> > > >> items (instead of default size 1)
> >
> > > >> I specified it in View as under--
> >
> > > >> 
> > > >> 
> > > >> opt1
> > > >> opt2
> > > >> opt3
> >
> > > >> etc.
> > > >> 
> > > >> 
> >
> > > >> But its height(size) remains unaltered (1).
> > > >> It displays a scrollbar though.
> > > >> 
> > > >> The same code, if tested in a standalone html file, works correct
> > > >> (i.e. the size is altered to 3)
> > > >> 
> > > >> Why my code in "View" is not able to override the default size of 1?
> >
> > > >> Thanks,
> >
> > > >> Vineet
> >
> > > --
> > >  http://martin.tecnodoc.com.ar-Hide quoted text -
> >
> > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -




-- 
 http://martin.tecnodoc.com.ar


[web2py] Re: select box size (height) : how to change in View

2011-09-08 Thread Vineet
I have posted the code in 'View' file at
http://stackoverflow.com/questions/7343374/web2py-view-height-size-of-a-select-box-in
So avoiding the reposting of code here.

---Vineet

On Sep 8, 4:01 pm, Vineet  wrote:
> @Kenneth Lundström, @Martín Mulone,
> I agree that this is an issue related to css setting.
>
> Somewhere in a /static/css file(s), there is a setting which is
> forcing the  box of size="1".
> Same  box is accepting size="1" in a standalone html file
> (outside of web2py).
>
> Can anybody pl. point out which is that css file & what is the proper
> place in that file to set (or maybe remove) the "size= "
> setting.
>
> ---Vineet
>
> On Sep 8, 3:11 pm, Martín Mulone  wrote:
>
>
>
> >http://stackoverflow.com/questions/119961/select-tags-size-attribute-...
>
> > 2011/9/8 Kenneth Lundström 
>
> > > This is just a wild guess but I think CSS is doing it.
>
> > > Kenneth
>
> > >  I wish to render a select box with size="3" sothat it will display 3
> > >> items (instead of default size 1)
>
> > >> I specified it in View as under--
>
> > >> 
> > >> 
> > >> opt1
> > >> opt2
> > >> opt3
>
> > >> etc.
> > >> 
> > >> 
>
> > >> But its height(size) remains unaltered (1).
> > >> It displays a scrollbar though.
> > >> 
> > >> The same code, if tested in a standalone html file, works correct
> > >> (i.e. the size is altered to 3)
> > >> 
> > >> Why my code in "View" is not able to override the default size of 1?
>
> > >> Thanks,
>
> > >> Vineet
>
> > --
> >  http://martin.tecnodoc.com.ar-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[web2py] Re: deploying web2py on IIS

2011-09-08 Thread Omi Chiba
Remco,

I'm another guy struggling with IIS.
Following the Receipt 2 for ISAPI and I'm lost at 2.3.2. If possible,
can you explain what I should do from here.

So far, virtual directory "ochibaapp" (Renamed it from appname) is
created under "Default Web Site". I have setup junction for C:\w2p
\application just like in the step and it's empty now.


http://www.web2pyslices.com/slices/take_slice/128


On Sep 8, 7:10 am, Remco  wrote:
> You can doIISwith WSGI:http://code.google.com/p/isapi-wsgi/so you
> don't host two webservers, but only one.
>
> Hope this helps.
>
> Regards,
> Remco Boerma
>
> On 6 sep, 12:03, Web2Py Freak  wrote:
>
>
>
>
>
>
>
> > how can i deploy web2py onIIS??


[web2py] gluon.widget.start(cron=True)

2011-09-08 Thread annet
I came a cross this file and wonder what it does.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

try:
path = os.path.dirname(os.path.abspath(__file__))
except NameError:
path=os.getcwd() # Seems necessary for py2exe

if not path in sys.path:
sys.path.append(path)
os.chdir(path)

# import gluon.import_all
import gluon.widget

# Start Web2py and Web2py cron service!
gluon.widget.start(cron=True)


According to the comment I wrote it has something to do with memory
usage


Kind regards,

Annet.


Re: [web2py] Re: About the welcome app

2011-09-08 Thread António Ramos
does the web2py-adm...@googlegroups.com still exists?

What do they have about the new admin they talked about months ago?



2011/9/8 Massimo Di Pierro 

> This is a problem indeed.
>
> Anyway, I think it would be a good idea to have a convention about
> icons representing apps. Listing all the apps publicly does not belong
> in welcome and it is a security hazard. there could be a public page
> in admin that does that and admin can be disabled anyway.
>
> On Sep 8, 8:45 am, Richard Vézina  wrote:
> > But the idea of António is pretty nice...
> >
> > Only one problem, the speed of development web2py seems to generate
> obsolete
> > code in the applications published that force Massimo to launch adopt an
> App
> > movement... I don't know if it as work until now... I think this should
> be
> > fixed first, I mean make evolve the published apps at the same rythm of
> > evolution than web2py...
> >
> > Richard
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
> > > The 'welcome' app is intended to be a scaffolding upon which to build
> an
> > > app. The app selector you suggest might be more appropriate for
> inclusion in
> > > the 'admin' app (where the 'welcome' app could be one of the choices).
> >
> > > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
> >
> > >> I think the welcome app should be for users to see all apps available
> > >> i would like to see an welcome app like the attached file
> > >> All apps are associated with an icon for easy remembering
> >
> > >> António
> >
> > >> 2011/9/8 pbreit 
> >
> > >> I certainly would not call it useless. It provides a bit of
> information
> > >>> about how pages get rendered as well as some useful links.
> >
> > >>> Do you have any suggestions for how to improve?
>


[web2py] Re: Error running sqlform.grid from trunk

2011-09-08 Thread Massimo Di Pierro
What takes time is not fixing the bugs, it is reading emails and
reproducing the errors.
If your email is short and to the point and contains enough code that
runs out of the box and reproduces the bug, it is easy to fix.
This was the case.

massimo

On Sep 8, 9:41 am, Jim Steil  wrote:
> Fixed - Thanks Massimo, that was fast!
>
>      -Jim
>
> http://code.google.com/p/web2py/issues/detail?id=412
>
> On 9/7/2011 4:30 PM, Jim Steil wrote:
>
>
>
>
>
>
>
> > Submitted -http://code.google.com/p/web2py/issues/detail?id=412
>
> >     -Jim
>
> > On 9/7/2011 4:25 PM, Mart�n Mulone wrote:
> >> I think is a bug, please report it:
> >>http://code.google.com/p/web2py/issues/list
>
> >> 2011/9/7 Jim Steil mailto:j...@qlf.com>>
>
> >>     Hi
>
> >>     I'm getting the following:
>
> >>     Traceback(most recent call last):
> >>        File"C:\dev\trunk\web2py\gluon\restricted.py",line194,inrestricted
> >>          execccodeinenvironment
> >>        
> >> File"C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py"  
> >> ,line25,in
> >>        File"C:\dev\trunk\web2py\gluon\globals.py",line145,in
> >>          self._caller=lambdaf:f()
> >>        
> >> File"C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py"  
> >> ,line21,inpersons
> >>          form=SQLFORM.grid(db.person,ui='jquery-ui',paginate=20)
> >>        File"C:\dev\trunk\web2py\gluon\sqlhtml.py",line1655,ingrid
> >>          id=row[field_id]
> >>        File"C:\dev\trunk\web2py\gluon\dal.py",line3832,in__getitem__
> >>          returndict.__getitem__(self,m.group(1))[m.group(2)]
> >>     TypeError:'Set'objectisunsubscriptable
>
> >>     with the the following setup:
>
> >>     db.py
> >>     person = db.define_table('person',
> >>         Field('personId', 'id'),
> >>         Field('firstName', length=25, required=True, label='First Name'),
> >>         Field('lastName', length=25, required=True, label='Last Name'),
> >>         Field('address', 'text'),
> >>         Field('city', length=30),
> >>         Field('state', length=2),
> >>         Field('zipCode', length=10, label='ZIP Code'),
> >>         Field('phone', length=25),
> >>         Field('dob', 'date', label='Date of Birth'),
> >>         Field('sex', length=1),
> >>         Field('disability', length=50),
> >>         Field('singleParent', 'boolean', default=False, label='Single
> >>     Parent'),
> >>         Field('healthInsurance', length=50, label='Health Insurance'),
> >>         Field('origin', length=50),
> >>         Field('headOfHousehold', 'reference person', label='Head of
> >>     Household'),
> >>         Field('lastFirst', compute=lambda u: '%s, %s' % (u['lastName'],
>
> >>     u['firstName'])))
> >>     person.firstName.requires = IS_NOT_EMPTY()
> >>     person.lastName.requires = IS_NOT_EMPTY()
> >>     person.dob.requires = IS_DATE()
> >>     person.sex.requires = IS_IN_SET(['M', 'F'])
> >>     person.headOfHousehold.requires = IS_EMPTY_OR(IS_IN_DB(db, db.person,
>
> >>     '%(lastFirst)s',
>
> >>     zero='...choose one...'))
>
> >>     default.py
>
> >>     def persons():
> >>         form = SQLFORM.grid(db.person, ui='jquery-ui', paginate=20)
>
> >>         return dict(form=form)
>
> >>     Any thoughts?
>
> >>         -Jim
>
> >> --
> >>http://martin.tecnodoc.com.ar


[web2py] Re: how to use cgi in web2py

2011-09-08 Thread Massimo Di Pierro
Running web2py under CGI will result in more headaches then running is
in proxy mode.

On Sep 8, 9:07 am, Michele Comitini 
wrote:
> Freak,
>
> which one?
> a) you want to run CGI inside web2py?
> b) you want to run web2py as CGI?
>
> mic
>
> 2011/9/8 stefaan :
>
>
>
>
>
>
>
> >> web2py provides a file cgihandler.py to interface to CGI.
>
> > If still in doubt, use google:
>
> >http://web2py.com/AlterEgo/default/show/93
>
> > (As far as I understand, a cgi program expects input via stdin, and
> > sends output to stdout,
> > but I'm by no means an expert)
>
> > Best regards,
> > Stefaan.


[web2py] Re: list:reference , reprensent not working : potential issue

2011-09-08 Thread Massimo Di Pierro
Please open a ticket.

On Sep 8, 8:57 am, Richard Vézina  wrote:
> PING
>
> Richard
>
> On Wed, Aug 17, 2011 at 4:43 PM, Richard Vézina 
>
>
>
>
>
>
> > wrote:
> > Ok, forget notice, I think, I just should use something like this :
>
> > db.table2.linked_self.requires=\
> >     IS_EMPTY_OR(IS_IN_DB(db,'table2.id','%(field1t2)s',\
> >         orderby=('field1t2'),multiple=True))
>
> > But, still the list representation not working in crud.select for self
> > referenced field.
>
> > Richard
>
> > On Wed, Aug 17, 2011 at 4:29 PM, Richard Vézina <
> > ml.richard.vez...@gmail.com> wrote:
>
> >> Here a simple app that show the problem, I made on the same table a self
> >> referenced field and a foreign referenced field...
>
> >> I notice, also, that the "nav built-in wigdet" for multiple don't works
> >> neither in the crud.update or create form...
>
> >> Thanks
>
> >> Richard
>
> >> On Wed, Aug 17, 2011 at 4:09 PM, Richard 
> >> wrote:
>
> >>> Hello,
>
> >>> I think I have a issue with list:reference with a self referenced
> >>> table the representation not working in sqltable... It's work when I
> >>> change my referenced table from the self referenced to a different
> >>> table...
>
> >>> Book says :
> >>> While list:reference has a default validator and a default
> >>> representation...
>
> >>> web2py 1.98.2
>
> >>> Thanks
>
> >>> Richard


[web2py] Re: About the welcome app

2011-09-08 Thread Massimo Di Pierro
This is a problem indeed.

Anyway, I think it would be a good idea to have a convention about
icons representing apps. Listing all the apps publicly does not belong
in welcome and it is a security hazard. there could be a public page
in admin that does that and admin can be disabled anyway.

On Sep 8, 8:45 am, Richard Vézina  wrote:
> But the idea of António is pretty nice...
>
> Only one problem, the speed of development web2py seems to generate obsolete
> code in the applications published that force Massimo to launch adopt an App
> movement... I don't know if it as work until now... I think this should be
> fixed first, I mean make evolve the published apps at the same rythm of
> evolution than web2py...
>
> Richard
>
>
>
>
>
>
>
> On Thu, Sep 8, 2011 at 9:08 AM, Anthony  wrote:
> > The 'welcome' app is intended to be a scaffolding upon which to build an
> > app. The app selector you suggest might be more appropriate for inclusion in
> > the 'admin' app (where the 'welcome' app could be one of the choices).
>
> > On Thursday, September 8, 2011 5:18:42 AM UTC-4, Ramos wrote:
>
> >> I think the welcome app should be for users to see all apps available
> >> i would like to see an welcome app like the attached file
> >> All apps are associated with an icon for easy remembering
>
> >> António
>
> >> 2011/9/8 pbreit 
>
> >> I certainly would not call it useless. It provides a bit of information
> >>> about how pages get rendered as well as some useful links.
>
> >>> Do you have any suggestions for how to improve?


[web2py] Re: Say My Name Example not working, version 1.98.2

2011-09-08 Thread rami
Thank you, all. Web2Py books has been really helpful in understanding
this generics feature.

On Aug 30, 3:36 pm, pbreit  wrote:
> If you only use generics during development (good practice), put this in
> db.py or another model file:
>
> response.generic_patterns = ['*'] if request.is_local else []


[web2py] Re: select (field alias)

2011-09-08 Thread Massimo Di Pierro
No.

On Sep 8, 2:07 am, Noel Villamor  wrote:
> I am aware about:
> tblAlias = db.mytbl.with_alias('tblAlias')
>
> Is there a similar thing that we can use for fields in select()?
> As in:
> ... .select( db.mytbl.id, db.mytbl.id*2 as fld2)


[web2py] Re: Web2py is in the Bossie awards

2011-09-08 Thread Massimo Di Pierro
And congratulations again to all users and contributors!

On Sep 8, 2:01 am, Mike Veltman  wrote:
> I dont know if someone else already mentioned it. But web2py is in the Bossie
> awards. ;-)
>
> Congrats
>
> http://www.infoworld.com/d/open-source-software/bossie-awards-2011-th...
> open-source-software-the-year-171567-1
>
> With regards,
> Mike Veltman


[web2py] Re: Web2py is in the Bossie awards

2011-09-08 Thread Massimo Di Pierro
Another good news!

http://www.infoworld.com/d/open-source-software/bossie-awards-2011-the-best-open-source-application-development-software-171759-0¤t=10&last=1#slideshowTop

On Sep 8, 2:01 am, Mike Veltman  wrote:
> I dont know if someone else already mentioned it. But web2py is in the Bossie
> awards. ;-)
>
> Congrats
>
> http://www.infoworld.com/d/open-source-software/bossie-awards-2011-th...
> open-source-software-the-year-171567-1
>
> With regards,
> Mike Veltman


[web2py] Re: deploying web2py on IIS

2011-09-08 Thread Remco
>From the sqlite site:
  SQLite uses POSIX advisory locks to implement locking on Unix. On
Windows it uses the LockFile(), LockFileEx(), and UnlockFile()
system calls. SQLite assumes that these system calls all work as
advertised. If that is not the case, then database corruption can
result. One should note that POSIX advisory locking is known to be
buggy or even unimplemented on many NFS implementations (including
recent versions of Mac OS X) and that there are reports of locking
problems for network filesystems under Windows. Your best defense is
to not use SQLite for files on a network filesystem.
  -- http://www.sqlite.org/lockingv3.html

sqlite2 is different from sqlite3, but seems to me best not to use
sqlite if you have the option for any other database.

On 8 sep, 16:03, Richard Vézina  wrote:
> SQLite is a file DB so it the file is locked when there is operation in
> process... I think it become pretty slow when multiple users are on at the
> same time... I am not sure if it only allow concurrent access management
> correctly...
>
> Richard
>
> On Wed, Sep 7, 2011 at 3:18 AM, Web2Py Freak 
> wrote:
>
>
>
>
>
>
>
> > why cant i use SQLite ??


[web2py] Re: Building a non-trivial SOAP service using web2py

2011-09-08 Thread Remco
I'm as eager to know as you are.

So i tried a few things and found the following to work, though
not as they way you'd like it to work:

- [start service snippet]
@service.soap('GetQuote1', returns={'result':{'c':[{'c':float}],'b':
{'name':str,'value':str}}}, args={'symbol':str})
def stock_quote(symbol):
"Return stock quote info - everything is hardcoded..."
return dict(result={'c':[dict(c=1.0),dict(c=2.0)],
'b':dict(name='remco')})
- [end service snippet]

which produces the following WSDL (snippet)
- [start wsdl snippet]
























- [end wsdl snippet]

now if you call this like

- [start client snippet]
from gluon.contrib.pysimplesoap.client import SoapClient
print '*** crafting client '
client = SoapClient(wsdl='http://127.0.0.1:8000/welcome/default/call/
soap/?WSDL')
print '*** query '
print client.GetQuote1(symbol='google')
- [end client snippet]

this *does* successfully output the following:

 {'result': {'c': [{'c': 1.0}, {'c': 2.0}], 'b': {'name': 'remco'}}}

which is exactly what it should be.

What I've encountered and couldn't solve on my own:
 * c Can't be a list of float, it has to be a list of a dictionary
   with the key equal to the parent's key ('c' in this example).
   Try some different things for yourself and see the errors.

 * When returning result you have to return a complex type instead
   of (the more intuitive):
   return {'c':[dict(c=1.0),dict(c=2.0)], 'b':dict(name='remco')}

 * Internally it seems to use Ordered dictionaries, but the actual
   use of it is missing (somewhere in pysimplesoap\server.py@228)
   so you might run into errors of the ordering of keys in
   dictionaries. WSDL might be picky about it.

 * depending on your client you might need to patch a little in the
   source that produces the WSDL. I haven't tried a WSDL lint or
   similar but i am not surprised if not all clients properly handle
   pysimplesoaps wsdl because most clients are quite picky...

Hope this helps.

On 8 sep, 04:47, David Mitchell  wrote:
> Bump
>
> On 6 September 2011 19:13, David Mitchell  wrote:
>
>
>
>
>
>
>
> > Hello all,
>
> > I'm looking at using web2py to build a SOAP service to work as a test
> > harness for an infrastructure upgrade we're planning.  Unfortunately, all
> > the web2py SOAP info I've found has been trivial services such as adding 2
> > numbers together - in my case, I need my SOAP server to be able to do
> > something more complicated.
>
> > The sort of complexity I need to build is something like
> >http://www.webservicex.com/stockquote.asmx?WSDL
> > When I query this service from suds, the code looks something like:
> > >>> import suds
> > >>> url = 'http://www.webservicex.com/stockquote.asmx?WSDL'
> > >>> client = suds.client.Client(url)
> > >>> print client
>
> > Suds (https://fedorahosted.org/suds/)  version: 0.4 GA  build:
> > R699-20100913
>
> > Service ( StockQuote ) tns="http://www.webserviceX.NET/";
> >    Prefixes (0)
> >    Ports (2):
> >       (StockQuoteSoap)
> >          Methods (1):
> >             GetQuote(xs:string symbol, )
> >          Types (0):
> >       (StockQuoteSoap12)
> >          Methods (1):
> >             GetQuote(xs:string symbol, )
> >          Types (0):
>
> > >>> client.service.GetQuote('IBM')
> > IBM166.989/2/2011 > Date>4:00pm0.00N/AN/A > h>N/A200199.4B1 
> > 66.980.00%12 
> > 5.39
> > - 185.6312.31513.56International
> > Bus
>
> > I figure my web2py controller code to do this would look something like:
>
> > from gluon.tools import Service
> > service = Service(globals())
>
> > @service.soap('GetQuote', returns={SOMETHING_HERE}, args={'symbol':str})
> > def stock_quote(stock):
> >     "Return stock quote info - everything is hardcoded..."
> >     symbol = "IBM"
> >     last = 166.98
> >     date = '9/2/2011'
> >     quote_time = '4:00pm'
> >     change = 0.00
> >     #...
> >     return SOMETHING_HERE
>
> > def call():
> >     return service()
>
> > I'm trying to work out what the 2 SOMETHING_HERE pieces should look like in
> > the above code.
>
> > Could someone please point me in the right direction?
>
> > Thanks in advance
>
> > Dave M.


Re: [web2py] Error running sqlform.grid from trunk

2011-09-08 Thread Jim Steil

Fixed - Thanks Massimo, that was fast!

-Jim

http://code.google.com/p/web2py/issues/detail?id=412


On 9/7/2011 4:30 PM, Jim Steil wrote:

Submitted - http://code.google.com/p/web2py/issues/detail?id=412

-Jim

On 9/7/2011 4:25 PM, Martín Mulone wrote:
I think is a bug, please report it: 
http://code.google.com/p/web2py/issues/list


2011/9/7 Jim Steil mailto:j...@qlf.com>>

Hi

I'm getting the following:

Traceback(most recent call last):
   File"C:\dev\trunk\web2py\gluon\restricted.py",line194,inrestricted
 execccodeinenvironment
   File"C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py"  
,line25,in
   File"C:\dev\trunk\web2py\gluon\globals.py",line145,in
 self._caller=lambdaf:f()
   File"C:/dev/trunk/web2py/applications/FoodPantry/controllers/default.py"  
,line21,inpersons
 form=SQLFORM.grid(db.person,ui='jquery-ui',paginate=20)
   File"C:\dev\trunk\web2py\gluon\sqlhtml.py",line1655,ingrid
 id=row[field_id]
   File"C:\dev\trunk\web2py\gluon\dal.py",line3832,in__getitem__
 returndict.__getitem__(self,m.group(1))[m.group(2)]
TypeError:'Set'objectisunsubscriptable


with the the following setup:

db.py
person = db.define_table('person',
Field('personId', 'id'),
Field('firstName', length=25, required=True, label='First Name'),
Field('lastName', length=25, required=True, label='Last Name'),
Field('address', 'text'),
Field('city', length=30),
Field('state', length=2),
Field('zipCode', length=10, label='ZIP Code'),
Field('phone', length=25),
Field('dob', 'date', label='Date of Birth'),
Field('sex', length=1),
Field('disability', length=50),
Field('singleParent', 'boolean', default=False, label='Single
Parent'),
Field('healthInsurance', length=50, label='Health Insurance'),
Field('origin', length=50),
Field('headOfHousehold', 'reference person', label='Head of
Household'),
Field('lastFirst', compute=lambda u: '%s, %s' % (u['lastName'],

u['firstName'])))

person.firstName.requires = IS_NOT_EMPTY()
person.lastName.requires = IS_NOT_EMPTY()
person.dob.requires = IS_DATE()
person.sex.requires = IS_IN_SET(['M', 'F'])
person.headOfHousehold.requires = IS_EMPTY_OR(IS_IN_DB(db, db.person,
 
'%(lastFirst)s',
 
zero='...choose one...'))


default.py

def persons():
form = SQLFORM.grid(db.person, ui='jquery-ui', paginate=20)

return dict(form=form)

Any thoughts?

-Jim





--
http://martin.tecnodoc.com.ar



Re: [web2py] DAL insert dictionary fails

2011-09-08 Thread Bruno Rocha
How your dict looks like?

http://zerp.ly/rochacbruno
Em 08/09/2011 11:10, "seongjoo"  escreveu:
> Hello,
>
> I am using web2py 1.98.2.
>
> The problem is that below instruction fails with error message:
> "TypeError: insert() keywords must be strings"
>
> db.table.insert(**dictionary)
>
> While db(query).update(**dictionary) works find.
>
> For now, I have to use as a workaround as below.
>
> bulk_insert( [dictionary] )
>
> What would be wrong?


Re: [web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Ivica Kralj
Congratulation!!
This is something members of this group knew already anyway :) Although,
it's great to have recognition on black and white... or in html, for
everybody to see it. ;)


On 8 September 2011 14:37, LightDot  wrote:

> Congratulations!
>
> I'm glad to see CakePHP and web2py receive an award in the same category.
> IMHO, these truly are top frameworks for PHP and python.
>


[web2py] DAL insert dictionary fails

2011-09-08 Thread seongjoo
Hello,

I am using web2py 1.98.2.

The problem is that below instruction fails with error message:
"TypeError: insert() keywords must be strings"

db.table.insert(**dictionary)

While db(query).update(**dictionary) works find.

For now, I have to use as a workaround as below.

bulk_insert( [dictionary] )

What would be wrong?


Re: [web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Richard Vézina
Congratulation Massimo and core developpement team...

Richard

On Thu, Sep 8, 2011 at 9:37 AM, LightDot  wrote:

> Congratulations!
>
> I'm glad to see CakePHP and web2py receive an award in the same category.
> IMHO, these truly are top frameworks for PHP and python.
>


  1   2   >