[web2py] Web2py is in the Bossie awards

2011-09-08 Thread Mike Veltman
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-the-best-
open-source-software-the-year-171567-1

With regards,
Mike Veltman




Re: [web2py] billing app

2011-09-08 Thread Kenneth Lundström

Hello Nikolai,

I have created a simple billing application that contains customers, 
products, hour tracker (simple) and receipt handling.


If interested I could during the weekend put up a english version of it 
(Well swedish too it thats better) so you can check it out.



Kenneth


is there any billing component among the web2py appliances that can be
used as a base or a billing appliance?

Just wondering if there's any such code out there before starting from
scratch.

Thanks.




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

2011-09-08 Thread 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




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

2011-09-08 Thread Noel Villamor
Title is well deserved! Congratulations to the team.


[web2py] select (field alias)

2011-09-08 Thread Noel Villamor
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)






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

2011-09-08 Thread Michele Comitini
+1

2011/9/8 Noel Villamor :
> Title is well deserved! Congratulations to the team.


[web2py] Re: How to customise the reset password function

2011-09-08 Thread Dave H
I did look into that initially, but I wrote my app before I knew about
that so the scoping users in accounts bit was already done. I'll bear
it in mind for my next project though.

Thanks!
Dave


On Sep 7, 4:11 pm, Anthony  wrote:
> I'm not sure if this is relevant to what you're doing, but you might also
> check out web2py's new multi-tenant functionality, which might enable you to
> use Auth but maintain separate accounts for different groups of
> users:https://groups.google.com/d/topic/web2py/NrvxeWQJvH0/discussion
>
> Anthony
>
>
>
>
>
>
>
> On Wednesday, September 7, 2011 9:59:13 AM UTC-4, Dave H wrote:
>
> > Thanks for your replies - I've decided to roll my own in the end, as I
> > also need to scope the user lookup inside an account. It's not too
> > complicated to adapt the code in the Auth module as it's quite
> > straightforward.
>
> > Cheers
> > Dave
>
> > On Sep 3, 9:04 pm, Anthony  wrote:
> > > Maybe something like this:
>
> > > def user():
> > >     form=auth()
> > >     if request.args(0)=='request_reset_password' and form.errors:
> > >         session.flash='If your user ID was found, we have sent you reset
> > > details by email.'
> > >         redirect(URL('user',args='login'))
> > >     return dict(form=form)
>
> > > Anthony
>
> > > On Saturday, September 3, 2011 12:55:56 PM UTC-4, Dave H wrote:
>
> > > > Hi, I'd like to customise the "reset password" part of the
> > > > authentication module. At the moment, it tells you if you have entered
> > > > an incorrect email address, and doesn't in fact try to send the email
> > > > unless the user is found in the database. I'd like to change it so
> > > > that if a valid email address is entered, it says something like
>
> > > > "if your user was found, we have sent you reset details by email"
>
> > > > so that someone couldn't discover if an email address was valid or not
> > > > just by using the password reset function.
>
> > > > I've tried to hook into the code using this:
>
> > > > auth.settings.reset_password_onvalidation = my_onvalidation_function
> > > > auth.settings.reset_password_onaccept = my_onaccept_function
>
> > > > but it seems to do the email check before then. (the second line above
> > > > actually gives an error and says the key doesn't exist).
>
> > > > Is there any way to do this without subclassing the auth module?
>
> > > > Any suggestions are greatly appreciated!
>
> > > > Many thanks
> > > > Dave


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

2011-09-08 Thread Robert Kooij
About time. ;) 

Grats everyone and Massimo in particular!



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

2011-09-08 Thread Vasile Ermicioi
congrats Massimo, you deserve that


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

2011-09-08 Thread António Ramos
Again the top 5 is missing and the criteria also missing..
just a curiosity where django and rails fitted.

Congrats Massimo and his friend :)

2011/9/8 Vasile Ermicioi 

> congrats Massimo, you deserve that


[web2py] cgihandler path

2011-09-08 Thread Web2Py Freak
in cgi handler  the Path  ... what path ??   can anyone give me an
example ??


[web2py] Re: cgihandler path

2011-09-08 Thread Web2Py Freak


i sow this  :
In order to run web2py as a CGI script just call the cgihandler.py in
the main web2py folder. You may need to add a first line like

#!/usr/local/bin/python2.5
pointing to the local interpreter, follower by

import os; os.chdir('/home/you/web2py/')
so that web2py knows in which folder it is located.

> what is this path :/home/you/web2py/


Re: [web2py] appadmin and db.Table definition

2011-09-08 Thread Manuele

On 05/09/2011 21:21, pbreit wrote:

Is there some reason your table definitions depart so significantly from what 
is shown in the docs?
If I right understand what you mean... I wanted to develop a plugin that 
do not create the tables in the db when it's installed in the app but 
let the developer to choose which tables he needs and create them 
easily... is it clear?


M.


[web2py] Re: Published my collection of plugins

2011-09-08 Thread kenji4569
Thanks for the information. But it seems that I have to buy a licence
to get the full source code. I will look for other solutions.

Kenji

On 9月8日, 午前2:59, Richard Vézina  wrote:
> Hello Kenji,
>
> You will maybe find the code of the actual datepicker here 
> :http://www.dynarch.com/projects/calendar/
>
> If you clic on the "?" when the datepicker popup you will have the
> disclaimer of the author of the plugin...
>
> Richard
>
>
>
>
>
>
>
> On Tue, Sep 6, 2011 at 8:59 PM, kenji4569  wrote:
> > > After i upload a file i get a icon in the text.
> > > How do i lauch the file that i just embedded in the text?
> > The elrte editor prevents the icon link from clicking to download the
> > file.
> > So you have to first submit the editing html,
> > and save the html in db,
> > and then display the html in the view (as {{=XML(record.text)}}).
> > But currently, the demo do not demonstrate this (so you need to
> > implement this on your app).
> > In the meantime, you can check the html source from the editor by
> > clicking the "source" tab at the bottom of the editor.
>
> > Kenji
>
> > On 9月7日, 午前1:02, António Ramos  wrote:
> > > After i upload a file i get a icon in the text.
> > > How do i lauch the file that i just embedded in the text?
>
> > > Thank you
>
> > > 2011/9/6 kenji4569 
>
> > > > > web2py gives the file in the download
> > > > > directory for example
>
> > 5e74c950-95b2-4843-b4c6-53bc8efca8fe
> > lrte_widget_file.file.9a877c8c8c9d285c.4361726f6c696e61323031305f612e646f63
> > > > .doc>
> > > > The former random string is a display file name, and just for demo.
> > > > The latter one is an actual file name generated by web2py.
>
> > > > Now, I remove the former, since it's confusing:
> > > >http://dev.s-cubism.com/plugin_elrte_widget
>
> > > > Changing the latter would require much work with deeper inspection
> > > > into the web2py upload mechanism.
>
> > > > Changing the look and feel such as replacing icons would be easier,
> > > > and you should see the file_upload_or_choose() function in the usage
> > > > code of the demo.
>
> > > > Note that I do not implement a ready-made image/file chooser, and you
> > > > have to implement it for your own application, starting from the usage
> > > > code, including setting up your db and defining your image and file
> > > > tables.
>
> > > > Regards,
> > > > Kenji
>
> > > > On 9月6日, 午後6:01, António Ramos  wrote:
> > > > > Hello Kenji,
> > > > > Thank you for your fast work
>
> > > > > One problem!
> > > > > The form is not very friendly.
>
> > > > > In the submit form i choose a pdf for example myfile.pdf but in the
> > name
> > > > > field you write the name that web2py gives the file in the download
> > > > > directory for example
>
> > 5e74c950-95b2-4843-b4c6-53bc8efca8fe
> > lrte_widget_file.file.9a877c8c8c9d285c.4361726f6c696e61323031305f612e646f63
> > > > .doc>
> > > > > This has no meaning to the user!
>
> > > > > Please see attached file for what i think it would be really
> > helpfull.
>
> > > > > Thank you again
>
> > > > > António
>
> > > > > 2011/9/6 kenji4569 
>
> > > > > > Hi António,
>
> > > > > > I implemented a file chooser for the elrte widget.
> > > > > > Please try it:
> > > > > >http://dev.s-cubism.com/plugin_elrte_widget
>
> > > > > > Since the file chooser is very primitive, you may need to customize
> > > > > > it.
> > > > > > But, the customization would be easy with the expressive power of
> > > > > > web2py (see the demo code).
> > > > > > (Notice: I applied a small patch for the original elrte.js to make
> > the
> > > > > > file chooser available.)
>
> > > > > > Thanks again for your valuable feedback,
> > > > > > Kenji
>
> > > > > > On 9月4日, 午後8:01, António Ramos  wrote:
> > > > > > > Thank you.
> > > > > > > I realy need your plugin ASAP but with the option to attach
> > multiple
> > > > pdf
> > > > > > or
> > > > > > > doc files.
>
> > > > > > > 2011/9/4 kenji4569 
>
> > > > > > > > >the elRTE WYSIWYG Widget does not allow to "import" a file
> > other
> > > > than
> > > > > > an
> > > > > > > > >image.
> > > > > > > > >It would be nice to import for example a pdf or a doc file
> > > > > > > > Thanks for your proposal.
> > > > > > > > I think it would be easy to implement it, because the image
> > chooser
> > > > > > > > can be customized to anything.
> > > > > > > > I'll try to do this.
>
> > > > > > > > Kenji
>
> > > > > > > > On 9月4日, 午後6:02, António Ramos  wrote:
> > > > > > > > > Hello
> > > > > > > > > the elRTE WYSIWYG Widget does not allow to "import" a file
> > other
> > > > than
> > > > > > an
> > > > > > > > > image.
> > > > > > > > > It would be nice to import for example a pdf or a doc file
>
> > > > > > > > > Thank you
> > > > > > > > > António
>
> > > > > > > > > 2011/9/4 kenji4569 
>
> > > > > > > > > > >Maybe the actual datepicker could be of some help to
> > figure
> > > > out
> > > > > > how to
> > > > > > > > > > make it moves...
> > > > > > > > > > Thanks, but I couldn't read the source of the datepicker
> >

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

2011-09-08 Thread Martín Mulone
+1

2011/9/7 wwwgong 

> Congratulations!
>
> more details from here:
>
> 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
>



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


[web2py] Re: billing app

2011-09-08 Thread Gour-Gadadhara Dasa
On Thu, 08 Sep 2011 10:05:50 +0300
Kenneth Lundström
 wrote:

> Hello Nikolai,
> 
> I have created a simple billing application that contains customers, 
> products, hour tracker (simple) and receipt handling.
> 
> If interested I could during the weekend put up a english version of
> it (Well swedish too it thats better) so you can check it out.

I'd be interested for web2py billing app as well.

So, far, the best what I've found is MyClientBase
(http://www.myclientbase.com/) which is nice but being written in PHP limits my
enthusiasm to hack on it.


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


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

2011-09-08 Thread Martín Mulone
http://stackoverflow.com/questions/119961/select-tags-size-attribute-through-css

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


[web2py] how to use cgi in web2py

2011-09-08 Thread Web2Py Freak
hey guys ,

anyone can tell me how to use cgi in web2py ??


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

2011-09-08 Thread Vineet
@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 where, which is that css file & which 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 -


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

2011-09-08 Thread Vineet
@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 -


[web2py] Re: how to use cgi in web2py

2011-09-08 Thread stefaan

> hey guys ,
>
> anyone can tell me how to use cgi in web2py ??

If in doubt, always check the online book first...
http://www.web2py.com/book/default/chapter/11?search=cgi

Best regards,
Stefaan.


[web2py] Re: how to use cgi in web2py

2011-09-08 Thread Web2Py Freak
there is nothing about using CGI  just :

web2py provides a file cgihandler.py to interface to CGI.


[web2py] Can anyone explain this jQuery behavior?

2011-09-08 Thread Cliff
My jQuery scripts work great, as long as I embed them in the the view
itself.

When I move them out of the view into a file such as 'static/js/some-
jjquery.js', ajax calls cause the script to stop working.

If I comment out the ajax calls, the script works, except for
executing the ajax, of course.

Any clues??


[web2py] Re: Can anyone explain this jQuery behavior?

2011-09-08 Thread Anthony
Can you show some example code? How are you loading the JS files, making the 
Ajax calls, calling functions, etc.?

On Thursday, September 8, 2011 8:01:20 AM UTC-4, Cliff wrote:
>
> My jQuery scripts work great, as long as I embed them in the the view 
> itself. 
>
> When I move them out of the view into a file such as 'static/js/some- 
> jjquery.js', ajax calls cause the script to stop working. 
>
> If I comment out the ajax calls, the script works, except for 
> executing the ajax, of course. 
>
> Any clues??



[web2py] Re: Can anyone explain this jQuery behavior?

2011-09-08 Thread Ross Peoples
Seeing some code would help. I also wonder if you have encapsulated your 
external js code in something like:

jQuery(document).ready(function() {

});


[web2py] Re: deploying web2py on IIS

2011-09-08 Thread Remco
You can do IIS with 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 on IIS ??


Re: [web2py] Re: how to use cgi in web2py

2011-09-08 Thread Sebastian E. Ovide
believe me... web2py in a sharehost using CGI it is very SLOW ! (tested in
iPage)...

On Thu, Sep 8, 2011 at 12:30 PM, Web2Py Freak wrote:

> there is nothing about using CGI  just :
>
> web2py provides a file cgihandler.py to interface to CGI.
>



-- 
Sebastian E. Ovide


[web2py] nyroModal to edit a form in a modal window

2011-09-08 Thread Kenneth Lundström

Hi listmembers,

I have created a page that contains a list of customers. Every row has 
an link to edit it. This link opens a modal window with nyroModal.


But how do I change the size of the modal window?


Kenneth



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

2011-09-08 Thread DenesL

Best kept secret... not anymore.
Thanks to Massimo and all contributors.


[web2py] Re: how to use cgi in web2py

2011-09-08 Thread 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: web2py received 2011 BOSSIE Award by InfoWorld.com

2011-09-08 Thread Omi Chiba
Wow !

On Sep 8, 7:55 am, DenesL  wrote:
> Best kept secret... not anymore.
> Thanks to Massimo and all contributors.


Re: [web2py] Re: About the welcome app

2011-09-08 Thread Anthony
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: billing app

2011-09-08 Thread niknok
That would be awesome! Looking forward to it.

On Sep 8, 3:05 pm, Kenneth Lundström 
wrote:
> Hello Nikolai,
>
> I have created a simple billing application that contains customers,
> products, hour tracker (simple) and receipt handling.
>
> If interested I could during the weekend put up a english version of it
> (Well swedish too it thats better) so you can check it out.
>
> Kenneth
>
>
>
>
>
>
>
> > is there any billing component among the web2py appliances that can be
> > used as a base or a billing appliance?
>
> > Just wondering if there's any such code out there before starting from
> > scratch.
>
> > Thanks.


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

2011-09-08 Thread LightDot
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.


Re: [web2py] Re: About the welcome app

2011-09-08 Thread António Ramos
Yep i agree.

2011/9/8 Anthony 

> 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: About the welcome app

2011-09-08 Thread Richard Vézina
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] list:reference , reprensent not working : potential issue

2011-09-08 Thread Richard Vézina
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
>>
>>
>>
>


Re: [web2py] Re: deploying web2py on IIS

2011-09-08 Thread Richard Vézina
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 ??


Re: [web2py] Re: how to use cgi in web2py

2011-09-08 Thread Michele Comitini
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.
>
>


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.
>


[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 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.
>


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] 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



[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.


[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: 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: 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: 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: 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: 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: 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: 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: 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


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] 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.


[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] 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 -


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] 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.


[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  :)


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.


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] 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
>


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

2011-09-08 Thread Jesús
+1


[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: 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.


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: 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?


[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-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] 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: 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


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: 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...


[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.




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


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: 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
>
>
>
>


[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)


[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) 
>
>
>
>
>

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
>
>
>  
>  

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





[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
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 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: 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: 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: 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
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: 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: 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
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 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
>>
>>
>>
>>


[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?.




[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] 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: 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: 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: 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.

  1   2   >