Re: {Disarmed} Re: {Disarmed} Re: [web2py] Re: web2py and SEO

2017-06-16 Thread rajjmatthur

I have this in index.html before {{extend 'layout.html'}}

{{ 
response.title='My Site Name' 
response.meta.keywords='web2py web development Denver' 
response.meta.description='my description' 
response.meta.author='my name' 
}} 

Most of the content of the page is in layout.html

#

I also installed the simple SEO plugins from slice and in my db.py I have:

#-

from plugin_simple_seo.seo import set_seo_meta

set_seo_meta(title='web2py-simple-seo', 
 author="daxSlab",
 description='Simple SEO metadata plugin for web2py including 
Open Graph and Twitter Cards',
 keywords='web2py consulting in Denver',
 card='summary',
 generator="Web2py Web Framework",
 url='http://myurl.com',
 image=['http://myurl.com/image1.jpg', 
'http://myurl.com/image2.jpg'],
 site_name='my_site',
 locale='en_US')


For the above I am not sure what will be the url or the image. 

Anyway, I have both. Non works. 




On Thursday, June 15, 2017 at 9:16:25 AM UTC-4, Carlos Cesar Caballero 
wrote:
>
> Hi, it seems to be working in my apps, can you share how are you using it, 
> and the web2py version?
>
> Greetings.
>
> El 14/06/17 a las 15:21, rajjm...@gmail.com  escribió:
>
> Did anyone had any success on inserting metadata on layout or SEO ( 
> http://www.web2pyslices.com/slice/show/2048/simple-seo) plugins? It 
> doesn't seem to work at all. 
>
>
> On Friday, January 3, 2014 at 9:25:14 AM UTC-5, Gael Princivalle wrote: 
>>
>> Hi Bruno.
>>
>> In a same page where you make translations, how can you manage meta 
>> informations for all languages ?
>> With a if T.accepted_language you can set different values, but when you 
>> give your site to a tool like that :
>> http://www.seoutility.com/it/tools/google/sitemap_generator.aspx
>> it see only meta informations in default language.
>>
>> page title (response.meta.title)
>> page keywords ( response.meta.keywords)
>> page description ( response.meta.description)
>>
>> How do you manage this argument ?
>>
>> Thanks.
>>
>>
>> Il giorno venerdì 6 agosto 2010 15:13:58 UTC+2, rochacbruno ha scritto: 
>>>
>>> SEO is basically done through:
>>>
>>> page title (response.meta.title)
>>> page keywords ( response.meta.keywords)
>>> page description ( response.meta.description)
>>>
>>> plus: 
>>> the robots.txt file under website root directory, 
>>> good practices for creating links and inserting images, 
>>> Semantic html markup ( I mean always including "name" , "alt", "title" 
>>> for relevant tags), 
>>> and also using correctly the most relevant tags (h1,h2,h..., , 
>>>  etc )
>>>
>>> And one of the most important thing: Build a sitemap [1]
>>>
>>> web2py is ready to do all that, but we need to do it all from the 
>>> scratch, what we need now is a helper or a mechanism to make it more user 
>>> friendly.As is done by the plugin ALL-IN-ONE-PACK-SEO on wordpress for 
>>> example.
>>>
>>>
>>> [1] http://en.wikipedia.org/wiki/Site_map
>>>
>>>
>>>
>>>
>>>
>>> 2010/8/6 mdipierro 
>>>
 web2py does not care. I do not think there is any difference between
 frameworks about this. The issue how you use them.

 web2py provides response.meta that combined with the default layout
 allows you to set

 response.meta.keywords
 response.meta.description
 response.meta.author

 If you have recommendations about specific features that need to be
 implemented at the framework level, let us know.






 On Aug 6, 6:13 am, puercoespin 
 wrote:
 > Is web2py designed for a good practices about SEO? Are some frameworks
 > SEO-friends and others no SEO-friends and, if this is true, are web2py
 > SEO-friend?
 >
 > Thanks

>>>
>>>
>>>
>>> -- 
>>>
>>> http://rochacbruno.com.br
>>>
>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+un...@googlegroups.com .
> For more options, visit *MailScanner ha detectado un intento de fraude en 
> la siguiente página web "groups.google.com". No confíe en esta página web:* 
> *MailScanner 
> ha detectado un intento de fraude en la siguiente p�gina web 
> "groups.google.com". No conf�e en esta p�gina web:* 
> https://groups.google.com/d/optout .
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- 

Re: [web2py] Re: web2py and SEO

2017-06-14 Thread rajjmatthur
Did anyone had any success on inserting metadata on layout or SEO 
( http://www.web2pyslices.com/slice/show/2048/simple-seo) plugins? It 
doesn't seem to work at all.


On Friday, January 3, 2014 at 9:25:14 AM UTC-5, Gael Princivalle wrote:
>
> Hi Bruno.
>
> In a same page where you make translations, how can you manage meta 
> informations for all languages ?
> With a if T.accepted_language you can set different values, but when you 
> give your site to a tool like that :
> http://www.seoutility.com/it/tools/google/sitemap_generator.aspx
> it see only meta informations in default language.
>
> page title (response.meta.title)
> page keywords ( response.meta.keywords)
> page description ( response.meta.description)
>
> How do you manage this argument ?
>
> Thanks.
>
>
> Il giorno venerdì 6 agosto 2010 15:13:58 UTC+2, rochacbruno ha scritto:
>>
>> SEO is basically done through:
>>
>> page title (response.meta.title)
>> page keywords ( response.meta.keywords)
>> page description ( response.meta.description)
>>
>> plus: 
>> the robots.txt file under website root directory, 
>> good practices for creating links and inserting images, 
>> Semantic html markup ( I mean always including "name" , "alt", "title" 
>> for relevant tags), 
>> and also using correctly the most relevant tags (h1,h2,h..., , 
>>  etc )
>>
>> And one of the most important thing: Build a sitemap [1]
>>
>> web2py is ready to do all that, but we need to do it all from the 
>> scratch, what we need now is a helper or a mechanism to make it more user 
>> friendly.As is done by the plugin ALL-IN-ONE-PACK-SEO on wordpress for 
>> example.
>>
>>
>> [1] http://en.wikipedia.org/wiki/Site_map
>>
>>
>>
>>
>>
>> 2010/8/6 mdipierro 
>>
>>> web2py does not care. I do not think there is any difference between
>>> frameworks about this. The issue how you use them.
>>>
>>> web2py provides response.meta that combined with the default layout
>>> allows you to set
>>>
>>> response.meta.keywords
>>> response.meta.description
>>> response.meta.author
>>>
>>> If you have recommendations about specific features that need to be
>>> implemented at the framework level, let us know.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Aug 6, 6:13 am, puercoespin 
>>> wrote:
>>> > Is web2py designed for a good practices about SEO? Are some frameworks
>>> > SEO-friends and others no SEO-friends and, if this is true, are web2py
>>> > SEO-friend?
>>> >
>>> > Thanks
>>>
>>
>>
>>
>> -- 
>>
>> http://rochacbruno.com.br
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] change background color of a form

2017-05-23 Thread rajjmatthur
Doing this below, I can change the button color. How would I change the 
background string or textarea color? Below don't seem to work. Thanks in 
advance


in db.py
db.define_table("contact",
Field("your_name", "string", label='Name', ),
Field("your_email", 
label='Email',requires=IS_EMPTY_OR(IS_EMAIL(error_message='invalid 
email'))),
Field("your_message", "text", label='Message',),
auth.signature)





in index.html
{{form.element('input[type=submit]').update(_class="btn btn-primary")}}
{{form.element('textarea').update(_class="custom")}}

{{=form}}




 .custom {  
 background-color: green;
 }


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can we use a web2py app on Android mobile?

2016-08-01 Thread rajjmatthur
Very interesting topic guys. Wonder how we make a web2py app downloadable 
to google playstore or iphone App Store? Does Kivi or cordova both does 
that?

On Saturday, January 30, 2016 at 11:56:18 AM UTC-5, eric cuver wrote:
>
> You create your application mobile friendly
>
> for kivy
>
> After installation kivy :
>
> you create main.py 
> and you paste this code there are others codes but it's just an example :
>
> import kivy   
>   from kivy.app import App
> from kivy.lang import Builder 
>   from kivy.utils import 
> platform from 
> kivy.uix.widget import Widget 
>  from kivy.clock import Clock 
>from jnius import autoclass
>  from android.runnable import 
> run_on_ui_thread   
>
> WebView = autoclass('android.webkit.WebView') 
>   
> WebViewClient = autoclass('android.webkit.WebViewClient') 
>   
> activity = autoclass('org.renpy.android.PythonActivity').mActivity
>   
> class Wv(Widget): 
>   
> def __init__(self, **kwargs): 
>   
> super(Wv, self).__init__(**kwargs)
>   
> Clock.schedule_once(self.create_webview, 0)   
>   
>
> @run_on_ui_thread 
>   
> def create_webview(self, *args):  
>   
> webview = WebView(activity)   
>   
> webview.getSettings().setJavaScriptEnabled(True)  
>   
> wvc = WebViewClient();
>   
> webview.setWebViewClient(wvc);
>   
> activity.setContentView(webview)  
>   
> webview.loadUrl('http://www.web2py.com ')
> class ServiceApp(App):
>   
> def build(self):  
>   
> return Wv()  
>
> def on_start(self): 
>
>return True
>
>  def on_pause(self): 
>
>  return True
>
>  def on_resume(self): 
>
>  pass 
>
> def on_stop(self): 
>
>pass   
> 
> if __name__ == '__main__':
>   
> ServiceApp().run()
>
>
> on line  webview.loadUrl('http://www.web2py.com ') 
> you put  url from your webapplication
> then you can compile for android for example. there are others methods for 
> windows phone and iphone
> you can read the kivy documentation and kivy google groups or kivy github.
>
> for cordova:
>
> After you install you do that :
>
> # go into your projectcd myapp# create a mobileapp folder for your app
> cordova create mobileapp com.whatever.appname AppNamecd mobileapp# add android
> cordova platform add android# compile the app
> cordova build# now, plug in your testing device, and let's run our test app 
> on it
> cordova run android# if you don't have a device handy you can use an emulator 
> (much slower)## cordova emulate android
> # install plugins for alerts and network information# used to alert the user 
> if they are not connected to the internet
> cordova plugin add 
> https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
> cordova plugin add 
> https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
>
> then you go to then the forlder www/index.html your paste this code
>
> 
>
>   Zoggle
>   
>   
>   document.addEventListener("deviceready", onDeviceReady, false);
>   function onDeviceReady() {
> //navigator.splashscreen.hide();
> if (navigator.network.connection.type == Connection.NONE) {
>   networkError()
> } else {
>   loadApp()
> }
>   }
>
>   function loadApp() {
> navigator.app.loadUrl("http://www.web2py.com";)
>   }
>
>   function networkError() {
> 

[web2py] How to upload a file using SQLFORM.factory

2016-07-31 Thread rajjmatthur
in db.py
db.define_table("profile_picture",
Field('filename','upload',default = None,comment='Enter 
your pic',uploadfolder=os.path.join(request.folder, 
'uploads')),auth.signature)



in default.py
 
form=SQLFORM.factory(Field('filename','upload',uploadfolder=os.path.join(request.folder,
 
'uploads'))).process()

if form.accepted:
db.profile_picture.insert(filename=request.vars.filename?)


form.vars.filename is empty
request.vars doesn't have the file. 

My output. 

form.vars



request.vars


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid input fields size in auto generated Edit/New forms

2016-07-25 Thread rajjmatthur
I have the same question. But for DAL in general. How to limit the string 
or text?

On Monday, July 25, 2016 at 5:00:49 PM UTC-4, icodk wrote:
>
> How can I change the input field size (what is visible to the user) of 
> SQLFORM.grid auto generated Edit/New forms.
> Tried with length=50 but the fields are still about 20 chars long.
> Also:  IS_LENGTH(minsize=5,maxsize=50) had no visible effect. None of the 
> settings limits the number of chars user can type in. Only when submitting 
> the form you get an error message. But this might be the intended  design.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Hide flash message after some elapsed time instead of on click

2016-07-11 Thread rajjmatthur
On that note, how do we customize the flash? For example, lets say we want 
a much larger and brighter flash with css rule (brighter color), or have to 
display as soon as user log in on the center of the screen as an 
advertisement?

On Monday, July 11, 2016 at 4:49:08 AM UTC-4, Massimiliano wrote:
>
> Hi Jim, 
> I’m doing it in this way:
>
> Edit static/web2py.js search for /*helper for flash messages*/
>
> and add this command:
>
> setTimeout(‘jQuery(".flash").fadeOut("slow")',5000);
>
> just after:
>
> if (flash.html()) flash.append('  
> ').slideDown();
>
> Adjust 5000 that stands for 5 secods to your needs.
>
>
> On Thu, Jul 7, 2016 at 6:00 PM, Jim Brouzoulis  > wrote:
>
>> Hi everyone,
>>
>> Can I easily customise the web2py.js file to automatically hide/fade out 
>> the flash message after some given time (like a few seconds) instead of 
>> clicking on it? If so, how? 
>> I have a feeling that the solution is probably not that complicated but 
>> my js-skills aren't very impressive :)
>>
>> Regards
>> // Jim
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Massimiliano
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to edit the menu bar so as to remove profile and name in front of welcome in the dropdown?

2016-06-01 Thread rajjmatthur
Thank you Anthony. See attached. Just want to change the wording of it but 
keep everything same and working the way they are.



On Wednesday, June 1, 2016 at 7:55:19 AM UTC-4, Anthony wrote:
>
> On Wednesday, June 1, 2016 at 2:13:45 AM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> Yes. you are right. Just curious to know where Profile is defined like in 
>> which html file? I can't seem to find that.
>>
>
> Do you want to know where the auth dropdown menu is defined, or where the 
> actual Profile page is defined? Assuming you are talking about the 
> scaffolding application, the menu is created by auth.navbar() and is 
> included in layout.html. All of the Auth actions are handled via the user() 
> function in the default.py controller (and the associated 
> /views/default/user.html view).
>
> Note, it doesn't make sense to change "Profile" to "Register" in the 
> navbar. The way it works now is if the user is not logged in, the navbar 
> includes a link to "Register", and if the user is logged in, the navbar 
> instead includes a link to the "Profile" action (doesn't make sense for a 
> logged in user to register). If you do not want to expose the "profile" 
> action at all, you can instead add it to auth.settings.actions_disabled.
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to edit the menu bar so as to remove profile and name in front of welcome in the dropdown?

2016-06-01 Thread rajjmatthur
Yes. you are right. Just curious to know where Profile is defined like in 
which html file? I can't seem to find that. 

On Sunday, May 22, 2016 at 2:49:01 AM UTC-4, pbreit wrote:
>
> That's the type of thing that it seems like it should be in the app, not 
> the framework?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to edit the menu bar so as to remove profile and name in front of welcome in the dropdown?

2016-05-20 Thread rajjmatthur
I just want to change the name from Profile to  Register. I have to do all 
these or there is another work around?



On Sunday, December 27, 2015 at 2:00:38 AM UTC-5, Massimo Di Pierro wrote:
>
> Edit views/layout.html and remove {{=auth.navbar()}} which is 
> responsible for drawing that part of the page. Then write your own code for 
> it
>
> {{if auth.user:}}
> logout
> {{else:}}
> login
> register
> {{pass}}
>
> add html as needed depending on how you want it to look.
>
> On Saturday, 26 December 2015 13:38:34 UTC-6, RAGHIB R wrote:
>>
>> for example here, I want to remove profile in this pic and name in front 
>> of welcome. how to do this?
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problem with routes

2016-05-14 Thread rajjmatthur
I just looped through the entire array and added those strings with ',' and 
displayed. Works fine. Thank you Anthony.

On Saturday, May 14, 2016 at 2:17:47 PM UTC-4, Anthony wrote:
>
>
>
> On Saturday, May 14, 2016 at 12:06:11 PM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> Yes. in my case with request.args(0) into db.Post is a row object but 
>> since its list:string I see a bracket around. So, question Anthony. How do 
>> we take the html tag element out of row object. There are no examples in 
>> the book about how to do that. We have to live with it?
>>
>
> You don't have to live with anything -- you just have to write some code.
>
> And to be clear, there is no HTML tag in the row object or in the returned 
> value for your field at all. You have created a list:-type field, so 
> naturally the value you get from that field is a list. You cannot simply 
> insert a Python list in an HTML view without doing something to specify how 
> that list should be displayed. By default, the object's __str__ method will 
> be called, which in the case of Python lists produces a comma-separated 
> list of values inside brackets (same as if you display a list in a Python 
> console). If you want something else, you have to write some code to 
> generate the display you want.
>
> By default, list:-type fields do get a default "represent" attribute that 
> converts the list into a string of comma-separated values (with no 
> brackets), but that function is only used in particular contexts where 
> web2py is controlling the display (e.g., forms and the grid). You can also 
> take advantage of the "represent" function by using Rows.render(), but for 
> that, you obviously need a Rows object. That means you cannot do 
> db.mytable(some_id), because that directly returns a Row object, not a Rows 
> object. So, instead you would have to do db(db.mytable.id == 
> some_id).select().render(0).
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-14 Thread rajjmatthur
Yes. in my case with request.args(0) into db.Post is a row object but since 
its list:string I see a bracket around. So, question Anthony. How do we 
take the html tag element out of row object. There are no examples in the 
book about how to do that. We have to live with it?

On Thursday, May 12, 2016 at 9:15:17 AM UTC-4, Anthony wrote:
>
> On Thursday, May 12, 2016 at 9:10:33 AM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> Notice that render() option doesn't always shows up. 
>>
>> my_post = db.Post(request.args(0)). render (represent that field) is not 
>> available even though its 
>>
>> But for example:
>>
>> posts = db().select(db.Post.all). Its also a  
>> and I can do render(). 
>>
>
> .render is a method of the Rows object, not the Row object. Your second 
> example is a Rows object.
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-12 Thread rajjmatthur
Notice that render() option doesn't always shows up. 

my_post = db.Post(request.args(0)). render (represent that field) is not 
available even though its 

But for example:

posts = db().select(db.Post.all). Its also a  
and I can do render(). 

But we still have list string in my_post like you have in posts. render 
option only shows with if I do select()


On Tuesday, May 10, 2016 at 11:03:41 AM UTC-4, rajjm...@gmail.com wrote:
>
> worked! thank you Anthony/Dave.
>
> On Monday, May 9, 2016 at 6:13:29 PM UTC-4, Dave S wrote:
>>
>> On Monday, May 9, 2016 at 1:34:31 PM UTC-7, rajjm...@gmail.com wrote:
>>>
>>> Interesting! 
>>>
>>> So, if I do:
>>>
>>> a = my_table.render()
>>>
>>> I get 
>>>
>>> a is  >
>>>
>>> How do I now access individual elements? like Rows[0], 
>>> Rows[1]..Rows[10].etc? because a[0] doesn't work.
>>>
>>>
>> It appears that you have an iterator.  Fromm the book:
>>
>>
>> f you don't specify an index, you get a generator to iterate over all the 
>>> rows:
>>> for row in rows.render():
>>> print row.myfield
>>
>>
>> > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=render#Rendering-rows-using-represent
>> >
>>
>> /dps
>>
>>
>>
>>  
>>
>>>
>>>
>>> On Monday, May 9, 2016 at 3:53:48 PM UTC-4, Anthony wrote:

 This has nothing to do with the IS_IN_SET validator, which simply does 
 validation in your code (typically, it would also generate an HTML select 
 widget in forms, but not in your code, as you have explicitly specified 
 your own form widget). It also has nothing to do with the field's form 
 widget, as that only controls the display in forms.

 Rather, it is related to how you represent list values in your view 
 code. Keep in mind that "days" is a "list:string" field, so it stores 
 lists. The resulting value of the field in each Row is a Python list. In a 
 view, if you do something like:

 {{=some_python_list}}

 you will get a display like the one you are seeing. If you want an 
 alternative display, it is your responsibility to produce it as you see 
 fit, depending on the nature of your UI.

 In read-only forms and the grid, list:-type fields are displayed as 
 comma-separated lists via their default "represent" attribute. However, if 
 you are just inserting a list value in a view via {{=row.my_list_field}}, 
 the "represent" attribute is not used. In that case, you need to use 
 Rows.render() to generate each Row object, which will automatically apply 
 the "represent" attributes of each field.

 Anthony

 On Monday, May 9, 2016 at 12:06:49 PM UTC-4, rajjm...@gmail.com wrote:
>
> day_str = ('Sun', 'Mon', 'Tues', 'wed')
>
> Field('days', type='list:string',,requires=IS_IN_SET ((day_str), 
> multiple=True),widget=lambda field, value: 
> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
> label=True)),
>
> /view
> {{=my_table.days}}
>
> One example
>
>
> On Monday, May 9, 2016 at 11:35:20 AM UTC-4, Anthony wrote:
>>
>> Please show your code.
>>
>> On Sunday, May 8, 2016 at 7:15:22 PM UTC-4, rajjm...@gmail.com wrote:
>>>
>>> What would be the most efficient way to take out html tag for 
>>> IS_IN_SET (str) which outputs 
>>>
>>> ['my string']
>>>
>>>
>>> Want to display.
>>>
>>>
>>> my string
>>>
>>>
>>> Is re.compile and re.sub are the only options? XML, sanitize =True 
>>> doesn't work. Thanks in advance.
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-10 Thread rajjmatthur
worked! thank you Anthony/Dave.

On Monday, May 9, 2016 at 6:13:29 PM UTC-4, Dave S wrote:
>
> On Monday, May 9, 2016 at 1:34:31 PM UTC-7, rajjm...@gmail.com wrote:
>>
>> Interesting! 
>>
>> So, if I do:
>>
>> a = my_table.render()
>>
>> I get 
>>
>> a is  >
>>
>> How do I now access individual elements? like Rows[0], 
>> Rows[1]..Rows[10].etc? because a[0] doesn't work.
>>
>>
> It appears that you have an iterator.  Fromm the book:
>
>
> f you don't specify an index, you get a generator to iterate over all the 
>> rows:
>> for row in rows.render():
>> print row.myfield
>
>
>  http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=render#Rendering-rows-using-represent
> >
>
> /dps
>
>
>
>  
>
>>
>>
>> On Monday, May 9, 2016 at 3:53:48 PM UTC-4, Anthony wrote:
>>>
>>> This has nothing to do with the IS_IN_SET validator, which simply does 
>>> validation in your code (typically, it would also generate an HTML select 
>>> widget in forms, but not in your code, as you have explicitly specified 
>>> your own form widget). It also has nothing to do with the field's form 
>>> widget, as that only controls the display in forms.
>>>
>>> Rather, it is related to how you represent list values in your view 
>>> code. Keep in mind that "days" is a "list:string" field, so it stores 
>>> lists. The resulting value of the field in each Row is a Python list. In a 
>>> view, if you do something like:
>>>
>>> {{=some_python_list}}
>>>
>>> you will get a display like the one you are seeing. If you want an 
>>> alternative display, it is your responsibility to produce it as you see 
>>> fit, depending on the nature of your UI.
>>>
>>> In read-only forms and the grid, list:-type fields are displayed as 
>>> comma-separated lists via their default "represent" attribute. However, if 
>>> you are just inserting a list value in a view via {{=row.my_list_field}}, 
>>> the "represent" attribute is not used. In that case, you need to use 
>>> Rows.render() to generate each Row object, which will automatically apply 
>>> the "represent" attributes of each field.
>>>
>>> Anthony
>>>
>>> On Monday, May 9, 2016 at 12:06:49 PM UTC-4, rajjm...@gmail.com wrote:

 day_str = ('Sun', 'Mon', 'Tues', 'wed')

 Field('days', type='list:string',,requires=IS_IN_SET ((day_str), 
 multiple=True),widget=lambda field, value: 
 SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
 label=True)),

 /view
 {{=my_table.days}}

 One example


 On Monday, May 9, 2016 at 11:35:20 AM UTC-4, Anthony wrote:
>
> Please show your code.
>
> On Sunday, May 8, 2016 at 7:15:22 PM UTC-4, rajjm...@gmail.com wrote:
>>
>> What would be the most efficient way to take out html tag for 
>> IS_IN_SET (str) which outputs 
>>
>> ['my string']
>>
>>
>> Want to display.
>>
>>
>> my string
>>
>>
>> Is re.compile and re.sub are the only options? XML, sanitize =True 
>> doesn't work. Thanks in advance.
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-09 Thread rajjmatthur
Interesting! 

So, if I do:

a = my_table.render()

I get 

a is  >

How do I now access individual elements? like Rows[0], 
Rows[1]..Rows[10].etc? because a[0] doesn't work.



On Monday, May 9, 2016 at 3:53:48 PM UTC-4, Anthony wrote:
>
> This has nothing to do with the IS_IN_SET validator, which simply does 
> validation in your code (typically, it would also generate an HTML select 
> widget in forms, but not in your code, as you have explicitly specified 
> your own form widget). It also has nothing to do with the field's form 
> widget, as that only controls the display in forms.
>
> Rather, it is related to how you represent list values in your view code. 
> Keep in mind that "days" is a "list:string" field, so it stores lists. The 
> resulting value of the field in each Row is a Python list. In a view, if 
> you do something like:
>
> {{=some_python_list}}
>
> you will get a display like the one you are seeing. If you want an 
> alternative display, it is your responsibility to produce it as you see 
> fit, depending on the nature of your UI.
>
> In read-only forms and the grid, list:-type fields are displayed as 
> comma-separated lists via their default "represent" attribute. However, if 
> you are just inserting a list value in a view via {{=row.my_list_field}}, 
> the "represent" attribute is not used. In that case, you need to use 
> Rows.render() to generate each Row object, which will automatically apply 
> the "represent" attributes of each field.
>
> Anthony
>
> On Monday, May 9, 2016 at 12:06:49 PM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> day_str = ('Sun', 'Mon', 'Tues', 'wed')
>>
>> Field('days', type='list:string',,requires=IS_IN_SET ((day_str), 
>> multiple=True),widget=lambda field, value: 
>> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
>> label=True)),
>>
>> /view
>> {{=my_table.days}}
>>
>> One example
>>
>>
>> On Monday, May 9, 2016 at 11:35:20 AM UTC-4, Anthony wrote:
>>>
>>> Please show your code.
>>>
>>> On Sunday, May 8, 2016 at 7:15:22 PM UTC-4, rajjm...@gmail.com wrote:

 What would be the most efficient way to take out html tag for IS_IN_SET 
 (str) which outputs 

 ['my string']


 Want to display.


 my string


 Is re.compile and re.sub are the only options? XML, sanitize =True 
 doesn't work. Thanks in advance.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-09 Thread rajjmatthur
represent doesn't work.

On Monday, May 9, 2016 at 12:17:23 PM UTC-4, Leonel Câmara wrote:
>
> Add a represent to that field and then render the rows before sending them 
> to the view, the represent can be something like this:
>
> represent=lambda v, row: '' if not v else ', '.join(v)
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to take HTML tag out out of list string, in set

2016-05-09 Thread rajjmatthur
day_str = ('Sun', 'Mon', 'Tues', 'wed')

Field('days', type='list:string',,requires=IS_IN_SET ((day_str), 
multiple=True),widget=lambda field, value: 
SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
label=True)),

/view
{{=my_table.days}}

One example


On Monday, May 9, 2016 at 11:35:20 AM UTC-4, Anthony wrote:
>
> Please show your code.
>
> On Sunday, May 8, 2016 at 7:15:22 PM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> What would be the most efficient way to take out html tag for IS_IN_SET 
>> (str) which outputs 
>>
>> ['my string']
>>
>>
>> Want to display.
>>
>>
>> my string
>>
>>
>> Is re.compile and re.sub are the only options? XML, sanitize =True 
>> doesn't work. Thanks in advance.
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to take HTML tag out out of list string, in set

2016-05-08 Thread rajjmatthur
What would be the most efficient way to take out html tag for IS_IN_SET 
(str) which outputs 

['my string']


Want to display.


my string


Is re.compile and re.sub are the only options?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to update the stored original filename for upload field using smartgrid edit form?

2016-05-06 Thread rajjmatthur
Does this works? Filename still shows None.

On Wednesday, June 4, 2014 at 6:59:05 AM UTC-4, Michael Beller wrote:
>
> I used compute fields and it now works fine.  Unless I did something 
> wrong, the instructions in the book for storing the original filename only 
> work for the initial insert and does not address updating the field that 
> contains the original filename during an update.
>
> Here is my final code (I know there are other threads that discuss how to 
> store file attributes for upload fields):
>
> def contracts_filename(row):
> if request.vars.survey != None and not isinstance(request.vars.survey, 
> str):
> return request.vars.survey.filename
>
> def contracts_filetype(row):
> if request.vars.survey != None and not isinstance(request.vars.survey, 
> str):
> return request.vars.survey.filename.split('.')[-1]
> 
> def contracts_filesize(row):
> if request.vars.survey != None and not isinstance(request.vars.survey, 
> str):
> return request.env.content_length
>
> db.define_table('contracts',
> Field('person', 'reference person'),
> Field('survey_filename', compute=contracts_filename),
> Field('survey_filetype', compute=contracts_filetype),
> Field('survey_filesize', 'integer', compute=
> contracts_filesize),
> Field('survey', 'upload', autodelete=True), # uploadfolder 
> <== would be nice if this supported lambda's!!
> Field('description'),
> auth.signature
> )
>
> and my controller ...
>
> def index():
> grid=SQLFORM.smartgrid(db.person,
>fields=[db.contracts.person, db.contracts.
> survey_filename, db.contracts.survey_filesize,
>db.contracts.survey_filetype, db.
> contracts.survey, db.contracts.description
>]
>)
> return dict(grid=grid)
>
> Two extra items to note:
>
>- I don't think the size stored is exactly correct since it's using 
>content-length but this is close enough for my purposes
>- The compute fields do not display in edit forms by default so you 
>must explicitly list them in the smartgrid (or grid, sqlform) fields 
>argument.
>
>
> On Monday, June 2, 2014 9:03:32 AM UTC-4, Michael Beller wrote:
>>
>> I'm trying to store the original filename, filetype, and filesize for an 
>> upload field using a smartgrid.
>>
>> I can add these fields during the insert (by setting the field defaults) 
>> but not update the fields if you update the uploaded file.  The edit form 
>> does upload the new file but I don't know how to then update the stored 
>> attributes.  The upload field, request.vars.survey, initially contains the 
>> cgi.FieldStorage object during insert (from the new form).  However, the 
>> edit form then contains the string for the new filename in 
>> request.vars.survey unless their is a new file submitted.  But I don't know 
>> how to update the stored file attributes for the form before the smartgrid 
>> processes the updated upload file.
>>
>> db.define_table('person',
>> Field('first_name'),
>> Field('last_name'),
>> auth.signature,
>> format = '%(first_name)s %(last_name)s'
>> )
>>
>> db.define_table('contracts',
>> Field('person', 'reference person'),
>> Field('survey_filename', writable=False),
>> Field('survey_filetype', writable=False),
>> Field('survey_filesize', 'integer', writable=False),
>> Field('survey', 'upload', autodelete=True),
>> Field('description'),
>> auth.signature
>> )
>>
>> def index():
>>
>> if request.vars.survey != None and not type(request.vars.survey) is 
>> str:
>> db.contracts.survey_filename.default = 
>> request.vars.survey.filename
>> db.contracts.survey_filesize.default = request.env.content_length
>> db.contracts.survey_filetype.default = 
>> request.vars.survey.filename.split('.')[-1]
>> 
>> grid=SQLFORM.smartgrid(db.person)
>> return dict(grid=grid)
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to keep a Bootstrap Modal open even after a form submission

2016-04-27 Thread rajjmatthur
Try:


 $(function() { $('#myModal').modal('show'); });



On Wednesday, April 27, 2016 at 11:50:33 AM UTC-4, Ron Chatterjee wrote:
>
> I am having problem keeping the Modal to stay  open an updated after the 
> form submission. Searching on the web all I see is to set the backdrop 
> (css) to static.  So, I changed the css on the link as:  onclick="$('#myModal').modal({'backdrop': 'static'});" class="btn 
> btn-primary">My Modal
>
> But the modal closes after the submission if I use the link. Same as 
> button.
>
>
> db.define_table("Education",
> Field("Title", "string", label='Title', 
> requires=IS_NOT_EMPTY(),default=None),
> Field("filename", "upload", default=None, 
> uploadfolder=os.path.join(request.folder, 'uploads')))
>
>
> def index():
> form = SQLFORM(db.Education).process()
> return dict(form = form)
>
>
> #index.html
>
> {{extend 'layout.html'}}
>
> 
>   Modal Example
>   
>data-target="#myModal">Open Modal
>
> 
>   
>   
> 
> 
>   
>   
> 
>data-dismiss="modal">
>   Modal Header
> 
> 
>   
>   
>   {{=form}}
>   
>   
> 
> 
>data-dismiss="modal">Close
> 
>   
>   
> 
>   
>   
> 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] show uploaded filename in SQLFORM.grid

2016-04-24 Thread rajjmatthur


db.define_table('Files',
Field("filename", "upload",default=None, 
uploadfolder=os.path.join(request.folder, 'uploads')))

grid = SQLFORM.smartgrid(db.Files)


Displays:
List id, and file.

IdFilename
1file

How to show the uploaded filename instead file?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Creating form in the view

2016-04-13 Thread rajjmatthur
Another work around would be to do it this way in the controller probably. 
form=FORM('Your 
name:', INPUT(_name='name'), INPUT(_type='submit')). 

But if I define the form in the book example as shown below, how do I pass 
form.vars back into that controller? Lets say I don't have a database for 
this form. It just simple search form. I will define the form in the view, 
get the associated variables (form.vars) and insert them in the table 
inside the action (controller).   


{{=form.custom.begin}}Name: {{=form.custom.widget.name}}File: 
{{=form.custom.widget.source}}{{=form.custom.submit}}{{=form.custom.end}}

On Wednesday, April 13, 2016 at 8:10:49 AM UTC-4, Anthony wrote:
>
> See 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML.
>  
> Note, by setting session=None, there is no _formkey in the form and 
> therefore no CSRF protection. You can remove the session=None, but in that 
> case you will have to include the _formkey hidden field in the form as 
> well. The easiest way to do that is to end the form with:
>
> {{=form.custom.end}}
>
> Note, the above includes the _formkey and the _formname hidden fields (so 
> no need to explicitly include the _formname field) as well as the closing 
>  tag.
>
> You might also want to have a look at 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms
> .
>
> Anthony
>
> On Wednesday, April 13, 2016 at 6:30:01 AM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> Newby question.
>>
>> def mydef():
>>
>> form = SQLFORM(db.mytable)
>> if form.process.accept():
>>  conditions here
>> return locals()
>>
>> view:
>> {{=form}}
>>
>> What if form is defined in the view first.
>>
>> How to invoke the controller. if in view
>>
>> 
>> first name: 
>> 
>> last name: 
>> 
>> 
>>
>> How to process this form and accept it in the controller. like if 
>> form.process.accept():
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Creating form in the view

2016-04-13 Thread rajjmatthur
Newby question.

def mydef():

form = SQLFORM(db.mytable)
if form.process.accept():
 conditions here
return locals()

view:
{{=form}}

What if form is defined in the view first.

How to invoke the controller. if in view


first name: 

last name: 



How to process this form and accept it in the controller. like if 
form.process.accept():

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: delete on confirmation

2016-04-11 Thread rajjmatthur
If I use the helper function it works. Ran into one issue though.

{{=SPAN(A( IMG(_src=URL('static','images/delete.png')), _href = 
URL('delete',args=id), _title = 'Delete',  _onclick = "javascript:return 
confirm('Are you sure you want to process?')", _class = 'Delete') ) }}


Now, if I want to style the image it doesn't work. For example. 


.Delete {
   width:40px;
   cursor: pointer;
}


How do I style my logo to specific size?




On Sunday, April 10, 2016 at 11:19:48 PM UTC-4, 黄祥 wrote:
>
> please try
> {{=SPAN(A(T('Delete'), _href = URL('delete', args = [id] ), _title = 
> 'Delete', 
>  _onclick = "javascript:return confirm('Are you sure you want to 
> process?')", 
>  _class = 'to-delete') ) }}
>
> best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] delete on confirmation

2016-04-10 Thread rajjmatthur
I have a link where I delete the table entry. 



But I would like to have a confirmation like "are you sure you want to 
delete...?". I believe I need to use javascript. 

Any help from the group? How to get a confirmation window prior to delete?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How many days does it take you to learn django if you know web2py (and only web2py)?

2016-04-10 Thread rajjmatthur
On that note, is it possible to use web2py template language in Django? 
Does anyone know.

On Wednesday, March 16, 2016 at 10:18:59 AM UTC-4, rajjm...@gmail.com wrote:
>
> If you are not comfortable with django ORM you can also use SQLalchemy . 
> Use that in web2py first to verify your model. And then you can copy and 
> replace in django. Here is a way to replace the django ORM with SQLAlchemy. 
>
> http://lethain.com/replacing-django-s-orm-with-sqlalchemy/
>
> You will be in luck when they have a way to use pydal in django. But for 
> now, this may be another option to bridge the gap between two. 
>
>
>
> On Wednesday, March 16, 2016 at 8:15:55 AM UTC-4, Bernard Letourmy wrote:
>>
>> Hello,
>> Took me around 2 months working on a new project from scratch to feel 
>> nearly as comfortable with django as I was in web2py (after having enjoyed 
>> web2py for 2+ years)
>> Although prepare to feel quite lot of pain along the way such
>> As when you keep repeating yourself with declaring and connecting 
>>  routes, controller (sorry view there) and templates till you find your own 
>> way to auto generate the relations
>> Prepare to cry about batteries missing, such as:
>> - default user system with authentication views included, simple default 
>> REST api support etc,
>> -nice and automatically configured appadmin with dal query, g not only 
>> basic CRUD)
>> - a scheduler
>> - having to always find from where  the hell  you need to import that 
>> class  you use every day...
>> - having to find it in a manual splitted in chapters without a nice table 
>> of content and good index  system  that force you to use Google even when 
>> you know it's in the manual.
>>
>> You''ll also miss the power and clean syntax of pydal. You will see when 
>> you will try to do your first join with django orm...
>> But ok once accustomed to the silly __ _id field__gte=x notations using 
>> keywords argument instead of the clean field object and standard Python 
>> Operators of pydal 
>> You will enjoy quite  powerful object oriented interface on your models.
>> With automatic reverse relation generations, very nice way to extend the 
>> default model classes.
>> Basically a lot of choices at all stages either inside the framework for 
>> different ways to do the same thing or out there when it comes to find a 
>> plugin (an app in django) that provides the missing feature.
>> These being both advantages and inconvenience, explaining that it will 
>> take certainly longer to be fully up and running with django than with 
>> web2py
>>
>> Forgot one thing that's really nice with django:
>> the migration system. It's less 'automatic' then web2py's one but more 
>> powerful and reliable in my opinion as it allows forward and backwards 
>> migration and stores its meta data in the DB instead of the filesystem 
>> itself allowing you to easily switch DB backend and migrate them from the 
>> same Dev env for ex.
>> And one thing less nice
>> The core dev community is quite opiniated/ and stuck on the by design 
>> limitations...
>> With the view/template system that force you to learn a new language with 
>> expression being very restricted subset of Python
>> And force to develop yourself most of the basic filter needed.
>> Then quite a lot of won't fix issues or request for feature some 
>> repeatidely asked for 10years
>>
>> But I do quite like django also :)
>>
>> Bon courage for your learning
>> Bernard 
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Not to show submit button using formfactory

2016-04-02 Thread rajjmatthur
Can't seem to find the answer in the forum. A trivial question guys... How 
not to show submit button. 

  form = SQLFORM.factory(Field('search_string',requires=IS_NOT_EMPTY()), 
submit_button= 'Submit')
  form.element(_type='submit').update(_value=None) 

This don't seem to work.

I believe SQL form factory will initiate the submit anyway. So, don't want 
to show the submit button. If I use SQLFORM, submit_button = '' will work 
but not for form factory I believe.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-24 Thread rajjmatthur
This may be little preliminary but what you mean by "Admin user and 
auth_groups" setup and how? I don't recall anything to set up with the 
welcome app. It worked the first time straight out of the box.

On Thursday, March 24, 2016 at 8:56:22 AM UTC-4, Ron Chatterjee wrote:
>
> I am looking at this link:
>
> https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html. Is 
> that widget/plugin that comes with that bootstrap? Michael, you familiar 
> with that?
>
> It has something call direct chat. 
>
> On Thursday, March 24, 2016 at 12:23:08 AM UTC-4, Michael Beller wrote:
>>
>> I plan to! When ready, I'd like to try and apply these styles
>> https://almsaeedstudio.com/themes/AdminLTE/pages/forms/general.html 
>> to the new form.py and perhaps
>> https://almsaeedstudio.com/themes/AdminLTE/pages/tables/data.html
>> to the new grid.py
>>
>> On Wednesday, March 23, 2016 at 10:22:32 PM UTC-4, Massimo Di Pierro 
>> wrote:
>>>
>>> I am linking this from the new examples app. I assume you will be 
>>> maintaining it. for a while. :-)
>>> On Wednesday, 23 March 2016 19:38:22 UTC-5, Michael Beller wrote:

 Are you using 2.14.1 beta?

 I would try to get it running without changes before making changes 
 (unless you have a need to get it running on an old version of web2py).  
 As 
 Massimo pointed out, it's not necessarily backward compatible but other 
 than removing host_names (which I already did in the repo) I don't see why 
 it wouldn't work on an older version (I also had to remove formstyle from 
 appconfig to support an older version).

 I just installed a clean version using 
 git clone https://github.com/mjbeller/web2py-starter.git starter
 into 2.14.1 beta (actually current master) and then accessed
 /initialize/adminuser 
  
 to setup Admin user and auth_groups and everything worked fine.

 I'm still getting an odd error on 2.13.x which I can't figure out but 
 I'm content to move forward with just 2.14.1

 On Wednesday, March 23, 2016 at 8:02:51 PM UTC-4, Ron Chatterjee wrote:
>
> Got it. As always, thank you Massimo. 
>
> I changed in db1.py
>
> auth.define_tables(username=True, signature=True)
>
> to 
> auth.define_tables(username=False, signature=True)
>
> But in  the log in it still ask me for user name. 
>
> Also I get an error when I try to register.
>
> pydal\helpers\classes.py", line 18, in __init__
> return self.__dict__.__init__(*args, **kwargs)
> TypeError: 'NoneType' object is not iterable
>
>
>
> On Wednesday, March 23, 2016 at 7:32:18 PM UTC-4, Massimo Di Pierro 
> wrote:
>>
>> You cannot do that. You have an app created with web2py 2.14.1 beta 
>> and run it with an older version of web2py. myconf.get is not defined.
>> We only offer backward compatibility, not forward compatibility.
>>
>> Massimo
>>
>> On Wednesday, 23 March 2016 18:12:58 UTC-5, Ron Chatterjee wrote:
>>>
>>> I copied the config file from private and changed this to db1.py.
>>>
>>> auth = Auth(db, host_names=myconf.get('host.name'))
>>>
>>> I still don't get the app running. Any suggestions?
>>>
>>> web2py version running: 2.12.3
>>>
>>>
>>>
>>> On Wednesday, March 23, 2016 at 6:36:34 PM UTC-4, Dave S wrote:



 On Wednesday, March 23, 2016 at 3:01:24 PM UTC-7, Literate Aspects 
 wrote:
>
> Hi Rimas,
>
> I thank you for the kind thoughts, but I simply don't have that 
> luxury.  I read and I listen to the video tutorials, IF they matched 
> the 
> current live app, then following the step by step instructions would 
> be 
> straight forward, but the live app does not match the instructions, 
> so at 
> each step, one has to FIGURE out an unknown.
>
>
 The only difference I recognized in the screen shots was that the 
 book had 1 more line in the header comment.  The code lines you showed 
 seemed to match.  But recognize that the code included in the Welcome 
 app 
 (which is the code that gets used if you pressed the "Make new App" 
 button 
 on the Web2Py "console" page) can get changed every release; the book 
 tends 
 not to change as often.

 Some of these changes are simplification, some are taking advantage 
 of new features, and some are corrections.

 Going back to one of your earlier questions:

 def index(): return "Hello from MyApp"

 differs from 

 def index(): return dict(message="Hello from MyApp")

 in a basic Python way ... the first returns a string, the second 
 

Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread rajjmatthur
Is there a dashboard version of the starter app we can use?

On Wednesday, March 23, 2016 at 6:51:42 AM UTC-4, Ron Chatterjee wrote:
>
> you calling me a dog? lol. jk. Get the point. Thanks
>
> On Wednesday, March 23, 2016 at 6:33:27 AM UTC-4, Nico de Groot wrote:
>>
>> Haven't tried yet, but you need to configure a little. From the preview 
>> site:
>>
>> IMPORTANT NOTES:
>> Starter App is currently maintained on web2py current master branch
>> appconfig.ini is not included in the git repo (it's excluded by 
>> .gitignore) so you'll need to copy the file if you clone rather than 
>> download the repo
>> when you first install on localhost, you can access /initialize/adminuser 
>> to create initial admin user and auth_groups
>> models includes some sample tables for Dogs, Persons, and Dog Owners 
>> which you can easily delete
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How many days does it take you to learn django if you know web2py (and only web2py)?

2016-03-19 Thread rajjmatthur
If you are not comfortable with django ORM you can also use SQLalchemy . 
Use that in web2py first to verify your model. And then you can copy and 
replace in django. Here is a way to replace the django ORM with SQLAlchemy. 

http://lethain.com/replacing-django-s-orm-with-sqlalchemy/

You will be in luck when they have a way to use pydal in django. But for 
now, this may be another option to bridge the gap between two. 



On Wednesday, March 16, 2016 at 8:15:55 AM UTC-4, Bernard Letourmy wrote:
>
> Hello,
> Took me around 2 months working on a new project from scratch to feel 
> nearly as comfortable with django as I was in web2py (after having enjoyed 
> web2py for 2+ years)
> Although prepare to feel quite lot of pain along the way such
> As when you keep repeating yourself with declaring and connecting  routes, 
> controller (sorry view there) and templates till you find your own way to 
> auto generate the relations
> Prepare to cry about batteries missing, such as:
> - default user system with authentication views included, simple default 
> REST api support etc,
> -nice and automatically configured appadmin with dal query, g not only 
> basic CRUD)
> - a scheduler
> - having to always find from where  the hell  you need to import that 
> class  you use every day...
> - having to find it in a manual splitted in chapters without a nice table 
> of content and good index  system  that force you to use Google even when 
> you know it's in the manual.
>
> You''ll also miss the power and clean syntax of pydal. You will see when 
> you will try to do your first join with django orm...
> But ok once accustomed to the silly __ _id field__gte=x notations using 
> keywords argument instead of the clean field object and standard Python 
> Operators of pydal 
> You will enjoy quite  powerful object oriented interface on your models.
> With automatic reverse relation generations, very nice way to extend the 
> default model classes.
> Basically a lot of choices at all stages either inside the framework for 
> different ways to do the same thing or out there when it comes to find a 
> plugin (an app in django) that provides the missing feature.
> These being both advantages and inconvenience, explaining that it will 
> take certainly longer to be fully up and running with django than with 
> web2py
>
> Forgot one thing that's really nice with django:
> the migration system. It's less 'automatic' then web2py's one but more 
> powerful and reliable in my opinion as it allows forward and backwards 
> migration and stores its meta data in the DB instead of the filesystem 
> itself allowing you to easily switch DB backend and migrate them from the 
> same Dev env for ex.
> And one thing less nice
> The core dev community is quite opiniated/ and stuck on the by design 
> limitations...
> With the view/template system that force you to learn a new language with 
> expression being very restricted subset of Python
> And force to develop yourself most of the basic filter needed.
> Then quite a lot of won't fix issues or request for feature some 
> repeatidely asked for 10years
>
> But I do quite like django also :)
>
> Bon courage for your learning
> Bernard 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Smartgrid search bar without dropdown search

2016-03-10 Thread rajjmatthur

Is there a way to show the smartgrid search bar without showing the 
dropdown search box? I find the dropdown search can be confusing. Like the 
 grid with search and clear button but want to exclude the drop down menu 
that comes in below with  =,<,>, +And, Or...etc.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Amazon like slider

2016-03-09 Thread rajjmatthur
Trying to create amazon like slider for images/docs. Does anyone know of 
any jquery plugin for web2py that allows to do that?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: charts on web2py

2016-02-23 Thread rajjmatthur
Junior, do you have an example of bar chart using this?

On Friday, February 19, 2016 at 11:18:10 AM UTC-5, Junior Phanter wrote:
>
> This is the advantagem of the highchart over Google Charts. You can use 
> him in local server (offline).
>
> Happy in help.
> Sorry my bad englhis. ;)
>
> 2016-02-19 11:21 GMT-03:00 Ron Chatterjee  >:
>
>> For a moment I thought they are downloading directly from the page.  I 
>> didn't notice. Thank you. 
>>
>> On Thursday, February 18, 2016 at 10:22:57 PM UTC-5, Junior Phanter wrote:
>>>
>>> Download the developer's site the highcharts.js and exporting.js file 
>>> and place the js folder of the your application. (I put in Attached w2p 
>>> example)
>>>
>>> replace YOUR_APP by the name of the your aplication (e.g. chart)
>>>
>>> >> type="text/javascript">>> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>>
>>>
>>> you can do
>>>
>>>
>>> >> type="text/javascript">>> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>>
>>> see changes:
>>>
>>>
>>>
>>> ​
>>>
>>> Attached is w2p example
>>>
>>>
>>>
>>> 2016-02-18 22:40 GMT-03:00 Ron Chatterjee :
>>>

 I stumbled into this post and I also got a blank screen. Attached is my 
 w2p. This is a same replication of the example you posted. Am I missing 
 something?



 On Wednesday, February 17, 2016 at 8:27:15 AM UTC-5, Carlos Cesar 
 Caballero wrote:

> Highcharts is very good. I am using right now c3.js (http://c3js.org/) 
> a good MIT licence option.
>
> Greetings.
>
> El 16/02/16 a las 12:54, Junior Phanter escribió:
>
> Use highcharts
> http://www.highcharts.com
>
> Example:
>
> *ON CONTROLLER*
>
> def chart():
>
> dados_chart="[{name: 'Batata', y: 12},{name: 'Tomate', y: 
> 8},{name: 'Mamão', y: 12}]" #Change this dynamically
>
> dados_map={}
> dados_map["dados"]=dados_chart
>
> chart="""
> 
> Highcharts.setOptions({
> lang:{
> downloadJPEG: "Download em imagem JPG",
> downloadPDF: "Download em documento PDF",
> downloadPNG: "Download em imagem PNG",
> downloadSVG: "Download em vetor SVG",
> loading: "Lendo...",
> noData: "Sem dados para mostrar",
> printChart: "Imprimir Gráfico",
> }
> });
>
> // Build the chart
> $('#chart').highcharts({
> chart: {
> plotBackgroundColor: null,
> plotBorderWidth: null,
> plotShadow: false,
> type: 'pie'
> },
> title: {
> text: 'Meu Gráfico'
> },
> tooltip: {
> pointFormat: '{series.name}: 
> {point.percentage:.1f}%%'
> },
> plotOptions: {
> pie: {
> allowPointSelect: true,
> cursor: 'pointer',
> dataLabels: {
> enabled: false
> },
> showInLegend: true
> }
> },
> credits:{enabled:false},
> series: [{
> name: 'Vendar por porcentagem',
> colorByPoint: true,
> data: %(dados)s
> }]
> });
> 
>
> """ %dados_map
> return dict(chart=XML(chart))
>
> *ON VIEW*
>
> {{extend 'layout.html'}}
>  type="text/javascript">
>  type="text/javascript">
> 
> 
> {{=chart}}
>
> 2016-02-15 12:52 GMT-03:00 :
>
>> I used google charts using a simple bar chart since I couldn't find a 
>> workable example on the slice using pygal etc. But google chart seems 
>> little slow in loading on the browser and I believe it may be due to 
>> loading the js file from the remote site. Does anyone have the same 
>> experience? If so, how did they resolve it. I tried to load the js file 
>> locally but was unable to make that to work. 
>>
>>   
>>
>> On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote: 
>>>
>>> thanks!
>>>
>>>
>>> 2016-01-22 1:10 GMT-02:00 Junior Phanter :
>>>
 Example using just google chart api, without google-charts-plug-in

 on controller

 def chart():
 title="My Chart"
 data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5], 
 ["watermelon", 0.5]]') #convert list in string and string in XML
 return dict(title=title, data=data)

 on view (chart.html)

 {{extend 'layout.html'}}

[web2py] Re: response.title doesn't work

2016-02-20 Thread rajjmatthur
Older version, I can just put response.title = A(IMG(_src=URL('static', 
'images/my_logo.png'))) in menu.py and it worked on every pages. Thank you 
Anthony

On Saturday, February 20, 2016 at 4:06:09 PM UTC-5, Anthony wrote:
>
> If you are using the default layout.html that comes with the scaffolding 
> app, note that response.title is not used to display anything on the page 
> but is used in the  section to set the page title (which is 
> displayed, for example, in the browser tab, as well as in bookmarks).
>
> Anyway, if you want to include something somewhere in the page, you must 
> put it in the view somewhere:
>
> {{=response.title}}
>
> Anthony
>
> On Saturday, February 20, 2016 at 1:59:28 PM UTC-5, rajjm...@gmail.com 
>  wrote:
>>
>> Wondering why this don't work in the newest version of web2py (bt3? is 
>> the cause)?
>>
>> response.title = A(IMG(_src=URL('static', 'images/my_logo.png')))
>> response.subtitle = 'Find the blogs you search for'
>>
>> Any work around so it puts a nice heading on the top of the page with key 
>> words inserted
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] response.title doesn't work

2016-02-20 Thread rajjmatthur
Wondering why this don't work in the newest version of web2py (bt3? is the 
cause)?

response.title = A(IMG(_src=URL('static', 'images/my_logo.png')))
response.subtitle = 'Find the blogs you search for'

Any work around so it puts a nice heading on the top of the page with key 
words inserted


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: star or favorite an event or list

2016-02-17 Thread rajjmatthur
I understand what you are saying. Just modify that star j-script to one and 
work out the algorithm to save the post. Yes it does. Thank you.



On Tuesday, February 16, 2016 at 10:28:06 PM UTC-5, Dave S wrote:
>
> On Tuesday, February 16, 2016 at 1:32:29 PM UTC-8, rajjm...@gmail.com 
> wrote:
>>
>> Anyway ever did a star or favorite on something that is saved by 
>> reference user to display later. Similar to craiglist or this google group 
>> even (like attached)
>>
>>
>>
> Does this post help?
> 
>
> /dps
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: charts on web2py

2016-02-16 Thread rajjmatthur
I got a blank screen. lol

On Tuesday, February 16, 2016 at 12:54:53 PM UTC-5, Junior Phanter wrote:
>
> Use highcharts
> http://www.highcharts.com
>
> Example:
>
> *ON CONTROLLER*
>
> def chart():
>
> dados_chart="[{name: 'Batata', y: 12},{name: 'Tomate', y: 8},{name: 
> 'Mamão', y: 12}]" #Change this dynamically
>
> dados_map={}
> dados_map["dados"]=dados_chart
>
> chart="""
> 
> Highcharts.setOptions({
> lang:{
> downloadJPEG: "Download em imagem JPG",
> downloadPDF: "Download em documento PDF",
> downloadPNG: "Download em imagem PNG",
> downloadSVG: "Download em vetor SVG",
> loading: "Lendo...",
> noData: "Sem dados para mostrar",
> printChart: "Imprimir Gráfico",
> }
> });
>
> // Build the chart
> $('#chart').highcharts({
> chart: {
> plotBackgroundColor: null,
> plotBorderWidth: null,
> plotShadow: false,
> type: 'pie'
> },
> title: {
> text: 'Meu Gráfico'
> },
> tooltip: {
> pointFormat: '{series.name}: {point.percentage:.1f}%%'
> },
> plotOptions: {
> pie: {
> allowPointSelect: true,
> cursor: 'pointer',
> dataLabels: {
> enabled: false
> },
> showInLegend: true
> }
> },
> credits:{enabled:false},
> series: [{
> name: 'Vendar por porcentagem',
> colorByPoint: true,
> data: %(dados)s
> }]
> });
> 
>
> """ %dados_map
> return dict(chart=XML(chart))
>
> *ON VIEW*
>
> {{extend 'layout.html'}}
>  type="text/javascript">
>  type="text/javascript">
> 
> 
> {{=chart}}
>
> 2016-02-15 12:52 GMT-03:00 :
>
>> I used google charts using a simple bar chart since I couldn't find a 
>> workable example on the slice using pygal etc. But google chart seems 
>> little slow in loading on the browser and I believe it may be due to 
>> loading the js file from the remote site. Does anyone have the same 
>> experience? If so, how did they resolve it. I tried to load the js file 
>> locally but was unable to make that to work.
>>
>>  
>>
>> On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote:
>>>
>>> thanks!
>>>
>>>
>>> 2016-01-22 1:10 GMT-02:00 Junior Phanter :
>>>
 Example using just google chart api, without google-charts-plug-in

 on controller

 def chart():
 title="My Chart"
 data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5], 
 ["watermelon", 0.5]]') #convert list in string and string in XML
 return dict(title=title, data=data)

 on view (chart.html)

 {{extend 'layout.html'}}

 

 https://www.gstatic.com/charts/loader.js";>

 
   google.charts.load('current', {'packages':['corechart']});
   google.charts.setOnLoadCallback(drawChart);
   function drawChart() {

 var data = google.visualization.arrayToDataTable({{=data}});

 var options = {
   title: '{{=title}}'
 };

 var chart = new 
 google.visualization.PieChart(document.getElementById('my_chart'));

 chart.draw(data, options);
   }
 


 2016-01-21 18:01 GMT-03:00 Diego Tostes :

> i am trying to use google chart plugin, but the example at 
> http://www.web2pyslices.com/slice/show/1721/google-charts-plugin, it 
> is not so clear to me.
>
> anybody can show me a example with a controller and a view?
>
> i need a simple line chart.
>
> rgds
>
> diego
>
> 2016-01-21 17:36 GMT-02:00 Diego Tostes :
>
>> thanks for all!
>>
>>
>> 2016-01-21 14:17 GMT-02:00 Alex :
>>
>>> my favorite chart library:
>>> https://www.amcharts.com/
>>> very beautiful, easy to use, good documentation and friendly license 
>>> (allows usage of free version even for commercial websites).
>>>
>>> Alex
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, 
>>> send an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> -- 

[web2py] Re: show_if logical operators

2016-02-16 Thread rajjmatthur
stumble upon this post.  For some reason, this don't work:

*model:*

db.define_table('mytable',
Field('name', type='list:string',requires=IS_IN_SET 
(['red', 'blue','yellow']),widget=lambda field, value: 
SQLFORM.widgets.checkboxes.widget(field, value, 
_style='bootstrap3_inline_factory', label=True)),
Field("roles", "text")

*default:*
db.mytable.roles.show_if = (db.mytable.name.belongs(['red']))

or even:

db.mytable.roles.show_if = (db.mytable.name =='red')



On Tuesday, June 16, 2015 at 7:52:30 AM UTC-4, kecajk...@gmail.com wrote:
>
> Works! Thanks. 
> Is it also possible for SQLFORM.factory? 
>
> On Wednesday, 10 June 2015 16:06:47 UTC+2, Anthony wrote:
>>
>> Try:
>>
>> db.table1.order.show_if = db.table1.colour.belongs(['red', 'blue'])
>>
>> Anthony
>>
>> On Tuesday, June 2, 2015 at 6:09:20 AM UTC-4, kecajk...@gmail.com wrote:
>>>
>>> Hi, 
>>>
>>> I'm using show_if to hide a filed of my form under certain conditions.
>>> Per web2py guide, show_if uses simple query, but it doesn't work for 
>>> logical oprators like "and" "or".
>>> In below example i would like to display field "order" just when colour 
>>> is set to "blue" or "red".
>>>
>>> db.define_table('table1', Field('colour', 
>>> requires=IS_IN_SET(['blue','red','yellow'])), Field('order'))
>>>
>>> ## That works fine
>>> db.table1.order.show_if = (db.table1.colour=='red')
>>>
>>> #that doesn't work returning error " 'Query' object has no attribute 
>>> 'tablename'"
>>> db.table1.order.show_if = (db.table1.colour=='red') | 
>>> (db.table1.colour=='blue')
>>>
>>> form=SQLFORM(db.table1)
>>>
>>>
>>> Any ideas?
>>>
>>> Also is it possible to use show_if with SQLFORM.factory ? I don't need 
>>> database for that form, but i want to use show_if.
>>>
>>> Thanks.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: charts on web2py

2016-02-15 Thread rajjmatthur
I used google charts using a simple bar chart since I couldn't find a 
workable example on the slice using pygal etc. But google chart seems 
little slow in loading on the browser and I believe it may be due to 
loading the js file from the remote site. Does anyone have the same 
experience? If so, how did they resolve it. I tried to load the js file 
locally but was unable to make that to work.

 

On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote:
>
> thanks!
>
>
> 2016-01-22 1:10 GMT-02:00 Junior Phanter  >:
>
>> Example using just google chart api, without google-charts-plug-in
>>
>> on controller
>>
>> def chart():
>> title="My Chart"
>> data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5], 
>> ["watermelon", 0.5]]') #convert list in string and string in XML
>> return dict(title=title, data=data)
>>
>> on view (chart.html)
>>
>> {{extend 'layout.html'}}
>>
>> 
>>
>> https://www.gstatic.com/charts/loader.js";>
>>
>> 
>>   google.charts.load('current', {'packages':['corechart']});
>>   google.charts.setOnLoadCallback(drawChart);
>>   function drawChart() {
>>
>> var data = google.visualization.arrayToDataTable({{=data}});
>>
>> var options = {
>>   title: '{{=title}}'
>> };
>>
>> var chart = new 
>> google.visualization.PieChart(document.getElementById('my_chart'));
>>
>> chart.draw(data, options);
>>   }
>> 
>>
>>
>> 2016-01-21 18:01 GMT-03:00 Diego Tostes > >:
>>
>>> i am trying to use google chart plugin, but the example at 
>>> http://www.web2pyslices.com/slice/show/1721/google-charts-plugin, it is 
>>> not so clear to me.
>>>
>>> anybody can show me a example with a controller and a view?
>>>
>>> i need a simple line chart.
>>>
>>> rgds
>>>
>>> diego
>>>
>>> 2016-01-21 17:36 GMT-02:00 Diego Tostes >> >:
>>>
 thanks for all!


 2016-01-21 14:17 GMT-02:00 Alex :

> my favorite chart library:
> https://www.amcharts.com/
> very beautiful, easy to use, good documentation and friendly license 
> (allows usage of free version even for commercial websites).
>
> Alex
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google 
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>


>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] background color of block sidebar

2016-02-10 Thread rajjmatthur
playing with blocks. 

I have 

{{block right_sidebar}}

{{end}}

I would like to set the background color different in the sidebar area 
comparing my main page. Any help from the community?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.