Re: votes/score
Érico,
it is not really clear to me what you are trying to accomplish. That HTML in MYVALUES is a try to show that line in the dropdown? And why is "{{form|safe}}" there?Leo
Leonardo Giordani
Author of The Digital CatMy profile on About.me - My GitHub page - My Coderwall profile
2013/11/14 Érico Oliveira <ericolvr@gmail.com>
Hy, i'm learning django.--My idea is to give marks / votes for a selected job.Works but not as I would.class Job(models.Model): title= models.CharField(max_length=20) slug = models.SlugField(max_length=40, blank=True) def __unicode__(self): return self.title
class Vote(models.Model): job = models.ForeignKey(Job) score = models.IntegerField(blank=True, default=0)
my forms.pyMYVALUES = ((5, u'<i class="fa fa-heart fa-2x"></i><span>5 </span>'), # don't work {{ form|safe }}(5, five'),(3, u'three'),(2, u'two'),(1, u'one'),)class FormVote(forms.ModelForm):class Meta:model = Votescore = forms.ChoiceField(choices=MYVALUES, widget=forms.RadioSelect())As I did all the html / css. I would not return the form that way.
I tried a different approach, trying to pass the values of the vote through a link using jquery, but I can not mount the garvar to view the value of voting.
It would be a mess trying to return an HTML inside FormVote, something like:
Help?
thanks in advance.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/736728d8-dc12-41aa-b223-7c8bed0a2cf4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEhE%2BOnEAsC_HKNHpHd9-%2BTbfbo0MogSN0R%3DztN_N2DC73W2fA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home