Sunday, January 28, 2018

num2words - help

Hello :)

It's my first post in here.

I've made simple model and simple app.

I want to use num2words library and I want to see my "cash" i words.

I don't know how to do it/

Can you help me ???

Please edit code for me.


-------------------------------------------
models.py

class Payment(models.Model):
    name = models.CharField(max_length=20)
    cash = models.IntegerField()

    def __str__(self):
        return self.name
------------------------------------------------
views.py

class PaymentListView(ListView):
    model = Payment

---------------------------------------------
template.html

{% for payment in payment_list %}
            <p>{{ payment.name }}: {{ payment.cash }}</p>
{% endfor %}

-----------------------------------------------
forms.py

class PaymentForm(forms.ModelForm):

    class Meta:
        model = Payment
        fields = ('name','cash')


THANK YOU VERY MUCH
Ariel

--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cb776a3e-f89e-4244-bcd5-6839d053e80e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment