Wham! That is what I was looking for.
From a class-based-view virgin to a wise head:
**you have been so helpful**
thank you
On 4/17/20 1:08 PM, Dylan Reinhold wrote:
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super().g
Tim you want to use get_context_data to add more data into your context for
the template
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super().get_context_data(**kwargs)
# You your stuff
context['my_pk'] =
OK. I am abandoning all pretext at self-sufficiency here. I have
researched this for days, reviewed the links below and I still cannot
resolve this issue.
Maybe someone besides Gavin has an idea of how to capture the pattern
between angle brackets in a url conf into a class-based view.
I am
On 4/15/20 7:24 PM, Gavin Wiener wrote:
Hey Tim
Hello Gavin: Thank you for your prompt reply.
The bigger question is, what are you trying to achieve?
I gotta know. I'm a retired programmer with 19 years doing CGI. Wrote
and implemented my own framework. First in C, than C++ then rebol, the
Hey Tim
The bigger question is, what are you trying to achieve?
With the DetailView, fetching the object with the primary key is already
handled for you, as you've seen the object will already be available in the
template.
This website is very useful to know which functions are implemented in
using django.VERSION (2, 1, 5, 'final', 0) with
python 3.7.2 on ubuntu 16.04
Given the URL pattern below:
path('', ArticleDetailView.as_view(), name='article_detail'),
And the view as below:
class ArticleDetailView(DetailView):
model = Article
template_name = 'article_detail.html'
6 matches
Mail list logo