On Mar 26, 2016, at 8:04 AM, jorrit...@gmail.com wrote:
>
> I believe Django lets you access the pk field of a table (which is created
> automatically unless you define it explicitly on your model) in multiple
> ways: self.pk, self.id, and self._id. Someone correct me if I’m
> wrong.
You can’t
This is awesome, and I appreciate the time you spent writing it. Besides
just answering the question I had, this also helped me make some new
connections around OOO topics.
Also, I do not intend to use the question id as a numbering system - I was
just trying to access the id for its own sake
>
> In trying to update my templates after I successfully finished part 3 of
> the tutorial, I found that I could write something like
> You're looking at the results of question {{ question.id }}: "{{
> question.question_text }}"
> and get: You're looking at the results of question 1: "What's up?"
Cool, I can try those to see how it works. Thank you.
On Saturday, March 26, 2016 at 7:04:13 AM UTC-7, jorr...@gmail.com wrote:
>
> I believe Django lets you access the pk field of a table (which is created
> automatically unless you define it explicitly on your model) in multiple
> ways: self.
I believe Django lets you access the pk field of a table (which is created
automatically unless you define it explicitly on your model) in multiple ways:
self.pk, self.id, and self._id. Someone correct me if I'm wrong.
--
You received this message because you are subscribed to the Google Groups
Hello,
In trying to update my templates after I successfully finished part 3 of
the tutorial, I found that I could write something like
You're looking at the results of question {{ question.id }}: "{{
question.question_text }}"
and get: You're looking at the results of question 1: "What's up?"
6 matches
Mail list logo