realpython / book2-exercises

Book 2 -- Exercises for the book
168 stars 203 forks source link

About AddTaskForm() class in forms.py at project folder of flasktaskr-02/book2-exercises #21

Closed ni8mr closed 9 years ago

ni8mr commented 9 years ago

Hello, I am not able to understand the process of defining 'task_id' like this-

task_id = IntegerField('Priority')

My question is why we are using 'Priority' within IntegerField().

I have my own explanation that we are going to use that in 'priority' so that we can prioritize tasks using the task_id. But i am not sure here.

I couldn't find any 'help tag' here or else it would been 'help' issue. I am following your Real Python books part 2 now. I couldn't find any forums for such kind of questions either.

mjhea0 commented 9 years ago

Hi - You can define the field name as a string -> https://wtforms.readthedocs.org/en/latest/fields.html#the-field-base-class

However, I think this may be a typo, as the task_id, should not have a name of Priority. Which chapter is this in? Thanks!

ni8mr commented 9 years ago

Hello, it was in Chapter 9, Page no-144.

About my question, if it is a typo than it will satisfy my query. (What should we use in IntegerField() than?)

mjhea0 commented 9 years ago

Yes, it's a typo. Just leave the field blank.

ni8mr commented 9 years ago

Ok, thank you very much :) . I love your book, it is helping me to understand the core concept of web programming.

I am closing the issue now.

ni8mr commented 9 years ago

Ohh, one more question, should i make a pull request to your repo?

(it will add a contribution to my profile :) )

mjhea0 commented 9 years ago

Thanks!

Go ahead and leave this open. Need to remember to update the course. :)

ni8mr commented 9 years ago

OK. :)