coucou
coucou

Reputation: 633

Django python, differences between self.request and '%s' % self.request

I'm getting parameters through GET or POST.

On the book I'm reading, there's

Word = '%s' % self.request.POST['word']

I wonder whether there's a specific reason for that. I mean why not like this just simply?

Word = self.request.POST['word']

Upvotes: 0

Views: 62

Answers (2)

youDaily
youDaily

Reputation: 1384

I think there is no difference between the two line.

Upvotes: 0

Andrey Shipilov
Andrey Shipilov

Reputation: 2014

Throw away this book, if it tells you to capitalize first letter of the variables and not to use:

self.request.POST.get('word', '')

Upvotes: 1

Related Questions