I'm going to go out and make a random guess that when you say "use a view
inside another view" with respect to the code you posted, you want all
calls to index() or list() to render the base view. In that case just use
return. i.e.
def index(request):
return base(request)
Yours,
Abraham V.
I don't understand what you are trying to do.
base(request) create a response for the browser using j and a to
render base.html.
If you want to have access to j and a in both index.html and
list.html, try this:
def base(request):
j = Job.objects.all()
a = Ab.objects.all()
return
More Explain Please
On Thursday, June 16, 2016 at 3:13:38 AM UTC+4:30, Gergely Polonkai wrote:
>
> Just like this. Unless you have a specific use case you forgot to share in
> your mail.
>
> Views are mere functions that get called with a request az a parameter.
> You shouldn’t treat them as
Just like this. Unless you have a specific use case you forgot to share in
your mail.
Views are mere functions that get called with a request az a parameter. You
shouldn’t treat them as special/holy/uncallable.
Best,
Gergely
On Jun 15, 2016 19:56, "hossein" wrote:
> def
def base(request):
j=Job.objects.all()
a=Ab.objects.all()
return render(request,'base.html',{'j':j, 'a':a})
def index(request):
base(request)
x=X.objects.all()
return render(request, 'index.html',{'x':x})
def list(request):
base(request)
z=Z.objects.all()
5 matches
Mail list logo