[web2py] Re: web2py star rating

2016-02-07 Thread Ron Chatterjee
Yes. Thank you Massimo

On Sunday, February 7, 2016 at 12:38:35 AM UTC-5, Massimo Di Pierro wrote:
>
> It does not get inserted because this:
>
> def index():
> form = SQLFORM(db.song)
> return dict(form = form)
>
> should be
>
> def index():
> form = SQLFORM(db.song).process()
> return dict(form = form)
>
> ;-)
>
> the problem is not in the JS. Also the rating field should be an integer 
> else you can run into issues.
>
> On Thursday, 4 February 2016 21:54:14 UTC-6, Ron Chatterjee wrote:
>>
>> Since I am getting an response I am guessing it doesn't work! lol.
>>
>>
>>
>> On Wednesday, January 27, 2016 at 6:42:23 PM UTC-5, Ron Chatterjee wrote:
>>>
>>> *I have the model defined as :*
>>>
>>> db.define_table('song',
>>> Field('title'),
>>> Field('rating'))
>>>
>>> Note*: rating is in the field.
>>>
>>> *controller as:*
>>>
>>> def index():
>>> form = SQLFORM(db.song)
>>> return dict(form = form)
>>>
>>>
>>> *View as you mentioned:*
>>>
>>> {{=form}}
>>>
>>> 
>>> jQuery('input.rating,input[name*="rating"]').each(function(){  
>>> var span = jQuery('>> class="rate0">◎>> class="rate2">☆>> class="rate4">☆'); 
>>> var self = jQuery(this).hide().after(span); 
>>> var fill_stars = function() { 
>>> var k = parseInt(self.val()) || 0; 
>>> for(var i=1; i<6; i++) 
>>> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
>>> }; 
>>> for(var k=0; k<6; k++) (function(k){ 
>>> span.find('.rate'+k).mouseover(function(){ 
>>> for(var i=1; i<6; i++) 
>>> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
>>> }).click(function(){self.val(k);fill_stars();}); 
>>> })(k); 
>>> span.mouseout(fill_stars); 
>>> fill_stars(); 
>>> });
>>> 
>>> 
>>>
>>>
>>> Results I get is attached but values are not stored in the database. Are 
>>> you sure it work at your end like I have it? Just curious.
>>>
>>>
>>>

-- 
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: web2py star rating

2016-02-06 Thread Massimo Di Pierro
It does not get inserted because this:

def index():
form = SQLFORM(db.song)
return dict(form = form)

should be

def index():
form = SQLFORM(db.song).process()
return dict(form = form)

;-)

the problem is not in the JS. Also the rating field should be an integer 
else you can run into issues.

On Thursday, 4 February 2016 21:54:14 UTC-6, Ron Chatterjee wrote:
>
> Since I am getting an response I am guessing it doesn't work! lol.
>
>
>
> On Wednesday, January 27, 2016 at 6:42:23 PM UTC-5, Ron Chatterjee wrote:
>>
>> *I have the model defined as :*
>>
>> db.define_table('song',
>> Field('title'),
>> Field('rating'))
>>
>> Note*: rating is in the field.
>>
>> *controller as:*
>>
>> def index():
>> form = SQLFORM(db.song)
>> return dict(form = form)
>>
>>
>> *View as you mentioned:*
>>
>> {{=form}}
>>
>> 
>> jQuery('input.rating,input[name*="rating"]').each(function(){  
>> var span = jQuery('> class="rate0">◎> class="rate2">☆> class="rate4">☆'); 
>> var self = jQuery(this).hide().after(span); 
>> var fill_stars = function() { 
>> var k = parseInt(self.val()) || 0; 
>> for(var i=1; i<6; i++) 
>> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
>> }; 
>> for(var k=0; k<6; k++) (function(k){ 
>> span.find('.rate'+k).mouseover(function(){ 
>> for(var i=1; i<6; i++) 
>> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
>> }).click(function(){self.val(k);fill_stars();}); 
>> })(k); 
>> span.mouseout(fill_stars); 
>> fill_stars(); 
>> });
>> 
>> 
>>
>>
>> Results I get is attached but values are not stored in the database. Are 
>> you sure it work at your end like I have it? Just curious.
>>
>>
>>

-- 
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: web2py star rating

2016-02-04 Thread Ron Chatterjee
Since I am getting an response I am guessing it doesn't work! lol.



On Wednesday, January 27, 2016 at 6:42:23 PM UTC-5, Ron Chatterjee wrote:
>
> *I have the model defined as :*
>
> db.define_table('song',
> Field('title'),
> Field('rating'))
>
> Note*: rating is in the field.
>
> *controller as:*
>
> def index():
> form = SQLFORM(db.song)
> return dict(form = form)
>
>
> *View as you mentioned:*
>
> {{=form}}
>
> 
> jQuery('input.rating,input[name*="rating"]').each(function(){  
> var span = jQuery(' class="rate0">◎ class="rate2">☆ class="rate4">☆'); 
> var self = jQuery(this).hide().after(span); 
> var fill_stars = function() { 
> var k = parseInt(self.val()) || 0; 
> for(var i=1; i<6; i++) 
> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
> }; 
> for(var k=0; k<6; k++) (function(k){ 
> span.find('.rate'+k).mouseover(function(){ 
> for(var i=1; i<6; i++) 
> span.find('.rate'+i).html((i<=k)?'★':'☆'); 
> }).click(function(){self.val(k);fill_stars();}); 
> })(k); 
> span.mouseout(fill_stars); 
> fill_stars(); 
> });
> 
> 
>
>
> Results I get is attached but values are not stored in the database. Are 
> you sure it work at your end like I have it? Just curious.
>
>
>

-- 
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: web2py star rating

2016-01-27 Thread Ron Chatterjee
No but I found a work around. I know this is probably not the best way to 
do this but here is a way to do this without any javascript. 


#Without styling gives the value numerically
db.define_table('my_table',
Field('name', 'string', requires=[IS_NOT_EMPTY()]),
Field('Rating', widget=SQLFORM.widgets.radio.widget, 
requires=IS_IN_SET({1 : '☆', 2 : '☆☆', 3 : '☆☆☆', 4: '', 5: '☆'})))

#with styling gives the value horizontally but a string output I believe.
db.define_table('my_table',
Field('name', 'string', requires=[IS_NOT_EMPTY()]),
Field('Rating', requires=IS_IN_SET ({1 : '☆', 2 : '☆☆', 3 : 
'☆☆☆', 4: '', 5: '☆'}, multiple=True),
  widget=lambda field, value: 
SQLFORM.widgets.radio.widget(field, value, style='divs', label=True, 
_class="horizontal")))


In my controller I have:
def index():
form = SQLFORM(db.my_table)
if form.process().accepted:
response.flash = 'record inserted'
return dict(form=form,Ratings = form.vars.Rating)


View:
{{extend 'layout.html'}}
{{=form}}
{{=Ratings}}


  .web2py_radiowidget.horizontal {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;

}

.web2py_radiowidget.horizontal > div {
margin-right: 3px;
display: inline-block;
color: Green;
}






On Wednesday, January 27, 2016 at 6:13:10 PM UTC-5, Massimo Di Pierro wrote:
>
> did you put the script at the bottom of your html? If not, it gets 
> executed before the HTML exists and you have to wrap it in a 
> jQuery(function(){... });
>
> On Tuesday, 26 January 2016 13:31:06 UTC-6, Ron Chatterjee wrote:
>>
>> I probably need to invoke that jQuery routine in my controllers. My table 
>> is this:
>>
>>
>> db.define_table('song',
>> Field('title'),
>> Field('rating', 'integer', requires=IS_IN_SET(range(0, 6))),)
>>
>> Any example anyone can point me to get this jQuery to work.
>>
>>
>> On Tuesday, January 26, 2016 at 12:51:04 PM UTC-5, Massimo Di Pierro 
>> wrote:
>>>
>>> What you mean does not work I use this all the time:
>>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>>
>>> None of your fields contains "rating". you have to change the names of 
>>> the selector in the code 'input.rating,input[name*="rating"]' to make 
>>> it work with your fields.
>>>
>>> On Monday, 25 January 2016 12:14:13 UTC-6, Ron Chatterjee wrote:

 Since the star rating widget doesn't work, how we get this js to work 
 for example if my database is:

 db.define_table('song',
 Field('title'),
 Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
 Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))), 

 Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
 6))),)






 On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:
>
> simple and effective, if you don't care about graphic niceties. Also, 
> another example of "pre-minified" code ;-P 
> But I don't think this should go in web2py's core.
>
> On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>>
>> Errata. You have to download it as "star.rating.js" into static/js 
>> and then include it as
>>
>> 
>>
>>
>> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>>>
>>> I have been very unsatisfied with existing star rating plugins. 
>>> First, they are too complex. Second, they required dedicated 
>>> fonts/images 
>>> while all the necessary symbols are already in unicode. So I made this:
>>>
>>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>>
>>> Just add this code at the bottom of your views:
>>>
>>> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>>>
>>> and all the fields with a name containing "rating" or input fields 
>>> having a class "rating" will be represented by a star 1-5 widget. 
>>> Perhaps we should make this default in web2py?
>>>
>>> Massimo
>>>  
>>>
>>

-- 
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: web2py star rating

2016-01-27 Thread Massimo Di Pierro
did you put the script at the bottom of your html? If not, it gets executed 
before the HTML exists and you have to wrap it in a jQuery(function(){... 
});

On Tuesday, 26 January 2016 13:31:06 UTC-6, Ron Chatterjee wrote:
>
> I probably need to invoke that jQuery routine in my controllers. My table 
> is this:
>
>
> db.define_table('song',
> Field('title'),
> Field('rating', 'integer', requires=IS_IN_SET(range(0, 6))),)
>
> Any example anyone can point me to get this jQuery to work.
>
>
> On Tuesday, January 26, 2016 at 12:51:04 PM UTC-5, Massimo Di Pierro wrote:
>>
>> What you mean does not work I use this all the time:
>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>
>> None of your fields contains "rating". you have to change the names of 
>> the selector in the code 'input.rating,input[name*="rating"]' to make it 
>> work with your fields.
>>
>> On Monday, 25 January 2016 12:14:13 UTC-6, Ron Chatterjee wrote:
>>>
>>> Since the star rating widget doesn't work, how we get this js to work 
>>> for example if my database is:
>>>
>>> db.define_table('song',
>>> Field('title'),
>>> Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
>>> Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))), 
>>>
>>> Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
>>> 6))),)
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:

 simple and effective, if you don't care about graphic niceties. Also, 
 another example of "pre-minified" code ;-P 
 But I don't think this should go in web2py's core.

 On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>
> Errata. You have to download it as "star.rating.js" into static/js and 
> then include it as
>
> 
>
>
> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>>
>> I have been very unsatisfied with existing star rating plugins. 
>> First, they are too complex. Second, they required dedicated 
>> fonts/images 
>> while all the necessary symbols are already in unicode. So I made this:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>
>> Just add this code at the bottom of your views:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>>
>> and all the fields with a name containing "rating" or input fields 
>> having a class "rating" will be represented by a star 1-5 widget. 
>> Perhaps we should make this default in web2py?
>>
>> Massimo
>>  
>>
>

-- 
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: web2py star rating

2016-01-27 Thread Ron Chatterjee
Doesn't it also can be worked as a radio button with Boolean if we know the 
value of that? And then apply the css rule for the display?

On Tuesday, January 26, 2016 at 2:31:06 PM UTC-5, Ron Chatterjee wrote:
>
> I probably need to invoke that jQuery routine in my controllers. My table 
> is this:
>
>
> db.define_table('song',
> Field('title'),
> Field('rating', 'integer', requires=IS_IN_SET(range(0, 6))),)
>
> Any example anyone can point me to get this jQuery to work.
>
>
> On Tuesday, January 26, 2016 at 12:51:04 PM UTC-5, Massimo Di Pierro wrote:
>>
>> What you mean does not work I use this all the time:
>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>
>> None of your fields contains "rating". you have to change the names of 
>> the selector in the code 'input.rating,input[name*="rating"]' to make it 
>> work with your fields.
>>
>> On Monday, 25 January 2016 12:14:13 UTC-6, Ron Chatterjee wrote:
>>>
>>> Since the star rating widget doesn't work, how we get this js to work 
>>> for example if my database is:
>>>
>>> db.define_table('song',
>>> Field('title'),
>>> Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
>>> Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))), 
>>>
>>> Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
>>> 6))),)
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:

 simple and effective, if you don't care about graphic niceties. Also, 
 another example of "pre-minified" code ;-P 
 But I don't think this should go in web2py's core.

 On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>
> Errata. You have to download it as "star.rating.js" into static/js and 
> then include it as
>
> 
>
>
> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>>
>> I have been very unsatisfied with existing star rating plugins. 
>> First, they are too complex. Second, they required dedicated 
>> fonts/images 
>> while all the necessary symbols are already in unicode. So I made this:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>
>> Just add this code at the bottom of your views:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>>
>> and all the fields with a name containing "rating" or input fields 
>> having a class "rating" will be represented by a star 1-5 widget. 
>> Perhaps we should make this default in web2py?
>>
>> Massimo
>>  
>>
>

-- 
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: web2py star rating

2016-01-26 Thread Ron Chatterjee
I probably need to invoke that jQuery routine in my controllers. My table 
is this:


db.define_table('song',
Field('title'),
Field('rating', 'integer', requires=IS_IN_SET(range(0, 6))),)

Any example in the book you can point me to so I can invoke that logic?


On Tuesday, January 26, 2016 at 12:51:04 PM UTC-5, Massimo Di Pierro wrote:
>
> What you mean does not work I use this all the time:
> https://gist.github.com/mdipierro/f221957e002baa014c9a
>
> None of your fields contains "rating". you have to change the names of the 
> selector in the code 'input.rating,input[name*="rating"]' to make it work 
> with your fields.
>
> On Monday, 25 January 2016 12:14:13 UTC-6, Ron Chatterjee wrote:
>>
>> Since the star rating widget doesn't work, how we get this js to work for 
>> example if my database is:
>>
>> db.define_table('song',
>> Field('title'),
>> Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
>> Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))),   
>>  
>> Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
>> 6))),)
>>
>>
>>
>>
>>
>>
>> On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:
>>>
>>> simple and effective, if you don't care about graphic niceties. Also, 
>>> another example of "pre-minified" code ;-P 
>>> But I don't think this should go in web2py's core.
>>>
>>> On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:

 Errata. You have to download it as "star.rating.js" into static/js and 
 then include it as

 


 On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>
> I have been very unsatisfied with existing star rating plugins. First, 
> they are too complex. Second, they required dedicated fonts/images while 
> all the necessary symbols are already in unicode. So I made this:
>
> https://gist.github.com/mdipierro/f221957e002baa014c9a
>
> Just add this code at the bottom of your views:
>
> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>
> and all the fields with a name containing "rating" or input fields 
> having a class "rating" will be represented by a star 1-5 widget. 
> Perhaps we should make this default in web2py?
>
> Massimo
>  
>


-- 
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: web2py star rating

2016-01-26 Thread Massimo Di Pierro
What you mean does not work I use this all the time:
https://gist.github.com/mdipierro/f221957e002baa014c9a

None of your fields contains "rating". you have to change the names of the 
selector in the code 'input.rating,input[name*="rating"]' to make it work 
with your fields.

On Monday, 25 January 2016 12:14:13 UTC-6, Ron Chatterjee wrote:
>
> Since the star rating widget doesn't work, how we get this js to work for 
> example if my database is:
>
> db.define_table('song',
> Field('title'),
> Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
> Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))),   
>  
> Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
> 6))),)
>
>
>
>
>
>
> On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:
>>
>> simple and effective, if you don't care about graphic niceties. Also, 
>> another example of "pre-minified" code ;-P 
>> But I don't think this should go in web2py's core.
>>
>> On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>>>
>>> Errata. You have to download it as "star.rating.js" into static/js and 
>>> then include it as
>>>
>>> 
>>>
>>>
>>> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:

 I have been very unsatisfied with existing star rating plugins. First, 
 they are too complex. Second, they required dedicated fonts/images while 
 all the necessary symbols are already in unicode. So I made this:

 https://gist.github.com/mdipierro/f221957e002baa014c9a

 Just add this code at the bottom of your views:

 https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>

 and all the fields with a name containing "rating" or input fields 
 having a class "rating" will be represented by a star 1-5 widget. 
 Perhaps we should make this default in web2py?

 Massimo
  

>>>

-- 
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: web2py star rating

2016-01-25 Thread Ron Chatterjee
Since the star rating widget doesn't work, how we get this js to work for 
example if my database is:

db.define_table('song',
Field('title'),
Field('voice_quality', 'integer',requires=IS_IN_SET(range(0, 6))),
Field('highs_and_lows', 'integer',requires=IS_IN_SET(range(0, 6))), 
   
Field('depth_and_sentiment', 'integer',requires=IS_IN_SET(range(0, 
6))),)






On Sunday, November 23, 2014 at 2:05:07 PM UTC-5, Niphlod wrote:
>
> simple and effective, if you don't care about graphic niceties. Also, 
> another example of "pre-minified" code ;-P 
> But I don't think this should go in web2py's core.
>
> On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>>
>> Errata. You have to download it as "star.rating.js" into static/js and 
>> then include it as
>>
>> 
>>
>>
>> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>>>
>>> I have been very unsatisfied with existing star rating plugins. First, 
>>> they are too complex. Second, they required dedicated fonts/images while 
>>> all the necessary symbols are already in unicode. So I made this:
>>>
>>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>>
>>> Just add this code at the bottom of your views:
>>>
>>> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>>>
>>> and all the fields with a name containing "rating" or input fields 
>>> having a class "rating" will be represented by a star 1-5 widget. 
>>> Perhaps we should make this default in web2py?
>>>
>>> Massimo
>>>  
>>>
>>

-- 
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: web2py star rating

2014-11-23 Thread Niphlod
simple and effective, if you don't care about graphic niceties. Also, 
another example of "pre-minified" code ;-P 
But I don't think this should go in web2py's core.

On Sunday, November 23, 2014 7:23:07 PM UTC+1, Massimo Di Pierro wrote:
>
> Errata. You have to download it as "star.rating.js" into static/js and 
> then include it as
>
> 
>
>
> On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>>
>> I have been very unsatisfied with existing star rating plugins. First, 
>> they are too complex. Second, they required dedicated fonts/images while 
>> all the necessary symbols are already in unicode. So I made this:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a
>>
>> Just add this code at the bottom of your views:
>>
>> https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>
>>
>> and all the fields with a name containing "rating" or input fields having 
>> a class "rating" will be represented by a star 1-5 widget. 
>> Perhaps we should make this default in web2py?
>>
>> Massimo
>>  
>>
>

-- 
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: web2py star rating

2014-11-23 Thread Massimo Di Pierro
Errata. You have to download it as "star.rating.js" into static/js and then 
include it as




On Sunday, 23 November 2014 12:02:44 UTC-6, Massimo Di Pierro wrote:
>
> I have been very unsatisfied with existing star rating plugins. First, 
> they are too complex. Second, they required dedicated fonts/images while 
> all the necessary symbols are already in unicode. So I made this:
>
> https://gist.github.com/mdipierro/f221957e002baa014c9a
>
> Just add this code at the bottom of your views:
>
> https://gist.github.com/mdipierro/f221957e002baa014c9a.js
> ">
>
> and all the fields with a name containing "rating" or input fields having 
> a class "rating" will be represented by a star 1-5 widget. 
> Perhaps we should make this default in web2py?
>
> Massimo
>  
>

-- 
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] web2py star rating

2014-11-23 Thread Massimo Di Pierro
I have been very unsatisfied with existing star rating plugins. First, they 
are too complex. Second, they required dedicated fonts/images while all the 
necessary symbols are already in unicode. So I made this:

https://gist.github.com/mdipierro/f221957e002baa014c9a

Just add this code at the bottom of your views:

https://gist.github.com/mdipierro/f221957e002baa014c9a.js";>

and all the fields with a name containing "rating" or input fields having a 
class "rating" will be represented by a star 1-5 widget. 
Perhaps we should make this default in web2py?

Massimo
 

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

2013-02-09 Thread Michael Gheith
Hello rochacbruno,

I loaded this application on two different machines/environments, and the 
information in the form is not being saved to the database song table.  I 
tried this as both a logged in user, and not logged in user.

I began to trouble shoot, and modified the form from:
def index():
form = SQLFORM(db.song)
return dict(form = form)

to the following:
def index():
form = SQLFORM(db.song)
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill out the form'
return dict(form = form)

It looks like the star rating value is not being sent from the form 
unfortunately because I get 'form has errors', 'value not allowed'.  Any 
ideas?


Best,
Michael Gheith

On Friday, February 8, 2013 5:33:24 PM UTC-6, rochacbruno wrote:
>
>
> https://github.com/mdipierro/web2py-recipes-source/blob/master/apps/04_advanced_forms/web2py.app.star_rating.w2p?raw=true
>
> On Fri, Feb 8, 2013 at 8:52 PM, Michael Gheith 
> > wrote:
>
>> Hello web2py community :)
>>
>> I'm trying to implement a simple star rating for my site.  I followed the 
>> steps in the web2py Application Development Cookbook, but it is not working 
>> unfortunately; I select 2 stars for example, but it's not being saved to 
>> the database.
>>
>> I have taken a look at the star rating widget in plugin_wiki, and could 
>> not get that to work either!
>>
>> Can any of you provide me with a .w2p of something that works?
>>
>>
>> Hope to hear from any of you soon, thanks in advance!
>> Michael Joseph Gheith
>>
>> -- 
>>  
>> --- 
>> 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/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Star Rating

2013-02-08 Thread Bruno Rocha
https://github.com/mdipierro/web2py-recipes-source/blob/master/apps/04_advanced_forms/web2py.app.star_rating.w2p?raw=true

On Fri, Feb 8, 2013 at 8:52 PM, Michael Gheith  wrote:

> Hello web2py community :)
>
> I'm trying to implement a simple star rating for my site.  I followed the
> steps in the web2py Application Development Cookbook, but it is not working
> unfortunately; I select 2 stars for example, but it's not being saved to
> the database.
>
> I have taken a look at the star rating widget in plugin_wiki, and could
> not get that to work either!
>
> Can any of you provide me with a .w2p of something that works?
>
>
> Hope to hear from any of you soon, thanks in advance!
> Michael Joseph Gheith
>
> --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Star Rating

2013-02-08 Thread Michael Gheith
Hello web2py community :)

I'm trying to implement a simple star rating for my site.  I followed the 
steps in the web2py Application Development Cookbook, but it is not working 
unfortunately; I select 2 stars for example, but it's not being saved to 
the database.

I have taken a look at the star rating widget in plugin_wiki, and could not 
get that to work either!

Can any of you provide me with a .w2p of something that works?


Hope to hear from any of you soon, thanks in advance!
Michael Joseph Gheith

-- 

--- 
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/groups/opt_out.