Re: ajax loading html
On Sat, Jul 14, 2012 at 2:11 PM, ledzgio <giorgiomarciano@gmail.com> wrote:
> If I use the TemplateViews method, should I have to set anything on the
> views.py? and how can I point that file from template?
the TemplateView is a view, it's already been written for you, so you
can use it without adding anything new. If you want to add some custom
behavior to it, you can subclass it, or skip it completely and make a
new view, either out of mixin classes, or function-based (though that
method's being deprecated in the future). That you'd usually do in
your views.py file (bearing in mind that it's not mandatory that it's
called that, it's just a convention), but for this case (at least as
far as you've described it) I don't think you need any specific
behavior.
And how can you point what file from which template?
That being said: My real recommendation would be go do the tutorial
and understand the concepts. Then go read about Class-based views, and
understand all that on a conceptual level, as well.
I.. don't mean to sound harsh, but all your questions and the place
they seem to point to give out a feeling that you're not really
understanding django and it's underlying concepts, it'll be very hard
for you to ask the right questions unless you figure it out first, and
even harder for us to answer them.
A template is just some text that can be mixed with some programming
structures (loops, ifs, and other template tags and filters) and
variables. The HTML you actually send the client could be (and usually
is) built from a mixture of a number of different templates, so you
should get yourself rid of that concept of "HTML page" = "template
file" you seem to be carrying.
At this point, I think the best thing you could do is be a little more
explicit, tell us what you're trying to do, possibly paste some models
and urls files
--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home