Re: error extending base template

2022-10-11 Thread Chukwudi Onwusa
Give space in the html template tag I mean {% extends 'base.html' %} But if the base is nested inside a directory inside the template directory pls name the '../base.html' according. Thanks Hope it will be help. On Mon, Oct 10, 2022, 16:11 Namanya Daniel wrote: > hello, someone help me out. am n

Re: error extending base template

2022-10-10 Thread ASAMOAH EMMANUEL
Make sure the template directory is located in the app directory or if it is in a different directory, ensure the location is specified at the template section in the settings.py file On Mon, Oct 10, 2022 at 3:11 PM Namanya Daniel wrote: > hello, someone help me out. am new to django and i face

error extending base template

2022-10-10 Thread Namanya Daniel
hello, someone help me out. am new to django and i face an issue with templates extending base.html i have created a base.html template which is basically a skeleton for other templates, they are all in templates/another directory but when i use {%extends 'base.html'%} I get this error... than

Re: Base Template per User

2021-05-24 Thread Kelvin Sajere
hese saved properties to dynamically alter the UI. On Mon, May 24, 2021 at 10:05 PM sebasti...@gmail.com < sebastian.ju...@gmail.com> wrote: > Hello, > > i want that every user from website can upload a base html file that are > then used on every views as base template.

Base Template per User

2021-05-24 Thread sebasti...@gmail.com
Hello, i want that every user from website can upload a base html file that are then used on every views as base template. Every User have then his own layout... Have anyone experience with such a thing? Regards -- You received this message because you are subscribed to the Google Groups

Re: Wrapping basic static HTML page in sites base template. How to?

2017-10-16 Thread Thiago Luiz Parolin
Hi, Look at the flatpages docs. https://docs.djangoproject.com/en/2.0/ref/contrib/flatpages/ 2017-10-16 9:06 GMT-02:00 Bernd Wechner : > Curious and I admit lazy question as I don't even know where to look or > how for such a general idea. But there it is, I'd like to be able to write > a stat

Wrapping basic static HTML page in sites base template. How to?

2017-10-16 Thread Bernd Wechner
Curious and I admit lazy question as I don't even know where to look or how for such a general idea. But there it is, I'd like to be able to write a static HTML file (like say about.html) and render that inside of the sites style and basic template. So I have base.html for example, which conta

two question: one for a little similarity page use base template, one for mutiple type user.

2017-05-18 Thread Man Single
, enterpriseuser, enterprise_child_user, admin. Second: There are two user background manager page, one for staff to manage order, enterprise. one for normaluser to manage themself order. So there are two url path: /staff_bg/ /user_bg/ But they are use the same base template, the only different is the

Re: Dynamic Base Template

2014-07-18 Thread Alexandre Matos
Thank you! An assignment tag solved my issue perfectly! Em quinta-feira, 17 de julho de 2014 11h59min26s UTC-3, cmawe...@gmail.com escreveu: > > You could make a custom assignment_tag like: {% get_datasets_for_user user > as dataset %} > > > https://docs.djangoproject.com/en/dev/howto/custom-te

Re: Dynamic Base Template

2014-07-17 Thread cmawebsite
You could make a custom assignment_tag like: {% get_datasets_for_user user as dataset %} https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#assignment-tags -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Dynamic Base Template

2014-07-17 Thread Alexandre Matos
l template, which gets from its view context a list of objects from the database to build a dynamic list. This template is then used as the base template for a couple of others. So, my views which render the templates that extend the index must also have my list on their context in order to

Re: What's the best way to display user information in the base template?

2011-11-15 Thread Ivo Brodien
. This way you don’t have to check yourself, if a user is logged in or not. Good luck and fun in learning django. [1] https://docs.djangoproject.com/en/dev/intro/tutorial01/ On Nov 15, 2011, at 15:45 , Levi Campbell wrote: > I'm trying to create a base template that would display user-

What's the best way to display user information in the base template?

2011-11-15 Thread Levi Campbell
I'm trying to create a base template that would display user-specific information such as an avatar and the number of unread messages a user has, what's the best way to do this? I know by reading the documentation that I can check if a user is logged in, which is a start, but doesn'

Re: Change CSS file in base template depending on browser

2011-01-18 Thread mongoose
Thanks guys. Just saw this in the admin contrib pages too:D win! On Jan 18, 7:36 pm, Dave Sayer wrote: > +1 for conditional comments. They're what all the cool kids are using these > days. > On 18 Jan 2011 15:00, "Michel Thadeu Sabchuk" wrote: > > > Hi, > > >> I have 2 css files. One specificall

Re: Change CSS file in base template depending on browser

2011-01-18 Thread Dave Sayer
+1 for conditional comments. They're what all the cool kids are using these days. On 18 Jan 2011 15:00, "Michel Thadeu Sabchuk" wrote: > Hi, > >> I have 2 css files. One specifically for IE because it's so horrible. >> I'd like to load either or css files depending on the browser. > > Why don't yo

Change CSS file in base template depending on browser

2011-01-18 Thread mongoose
Hi there, I have 2 css files. One specifically for IE because it's so horrible. I'd like to load either or css files depending on the browser. I know I have to use agent = request.META['HTTP_USER_AGENT'] I looked at this http://djangosnippets.org/snippets/77/ but it seems complex. All I

Re: Change CSS file in base template depending on browser

2011-01-18 Thread Michel Thadeu Sabchuk
Hi, > I have 2 css files. One specifically for IE because it's so horrible. > I'd like to load either or css files depending on the browser. Why don't you use conditional comments? http://www.quirksmode.org/css/condcom.html Best regards, -- Michel Sabchuk -- You received this message because

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 18:00, natebeacham wrote: > Or, if you don't want to over complicate things... Heh. yes, well. :-) Though doing it on the server does mean it stays working for people who disable javascript. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
wow works like a dream :) perfect time saver bit of script thanks :) On Jul 15, 6:00 pm, natebeacham wrote: > Or, if you don't want to over complicate things... > > $(function() { >     $('#nav li a').each(function() { >         if ($(this).attr('href') == window.location.pathname) { >          

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
I'm just going to go with nav blocks for the time being and find something dynamic later... I was looking at Jquery json cookies but seems a lot of effort for a small menu very interesting about context variables, I'll look into this ;) Thanks On Jul 15, 5:15 pm, David De La Harpe Golden wrote:

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread natebeacham
Or, if you don't want to over complicate things... $(function() { $('#nav li a').each(function() { if ($(this).attr('href') == window.location.pathname) { $(this).addClass('active'); } }); }); On Jul 15, 12:15 pm, David De La Harpe Golden wrote: > On 15/07/10

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 16:31, justin jools wrote: > I thought I had solved but I haven't. > [...] > using seperate block nav for evey page seems like a lot of > duplication... Well, you could also pass through a context variable to the template from each of your view functions telling what item in your navba

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
I thought I had solved but I haven't. Re: That means a whole different page is requested by the browser. I get your point, you are saying when clicking a link even though the script and navigation are in base.html it is still loading a new instance of base.html and therefore can't keep state for jq

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
Solved it!!! really stupid! I knew it would be something like this. I removed class="active" on home, now it works. Seems django was resetting to default base.html settings. It doesn't do this in straight HTML. So now I'll have to set the home active onload dynamically. hope this tip helps someon

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 15:19, justin jools wrote: > > $(document).ready(function() { > $('#nav li a').click(function() { > $('.active').removeClass('active'); > $(this).addClass(

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
http://www.djangoproject.com/";>Django Hosted by https://servqc.net/";>ServQc. On Jul 15, 3:11 pm, justin jools wrote: > the paths are correct, as I have tested the jquery click functi

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
the paths are correct, as I have tested the jquery click function with alert () I do have child templates and blocks but I took all this out to see why the jquery was being overriden/reset/disabled by django. It finds the jquery no problem but always resets to the default base template, and

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
same except for > > {{ MEDIA_URL }} which is correct. > > FWIW, we use a jquery load line in our base template and it works fine > (pretty disastrous for us if it didn't). > > You're 100% sure the pathss correct (like when you "view source" the > rendered p

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 13:40, justin jools wrote: > 2. base.html with jquery nav, exactly the same except for > {{ MEDIA_URL }} which is correct. > FWIW, we use a jquery load line in our base template and it works fine (pretty disastrous for us if it didn't). You're 100% sure the p

Re: Base template doesnt get the context

2010-04-20 Thread Thales
wrote: > the base template should have access to the context. you are doing > something wrong. sorry thats not helpful but i do what you are trying > to do all the time. > > simplify the template. > > you sure its not categories_list or object_list or even category_list > instead

Re: Base template doesnt get the context

2010-04-20 Thread Adam Patterson
the base template should have access to the context. you are doing something wrong. sorry thats not helpful but i do what you are trying to do all the time. simplify the template. you sure its not categories_list or object_list or even category_list instead of categories. On Tue, Apr 20, 2010

Re: Base template doesnt get the context

2010-04-20 Thread Thales
The other templates doesnt override the categories block... Its just like: {% extends "base.html" %} {% block content %} some content here {% endblock %} I mean, the base template should be receiving the context? Or do I have to find another solution? I could put a include on the bas

Re: Base template doesnt get the context

2010-04-19 Thread Adam Patterson
gt; {% endblock %} > > {% block conteudo %} > {% endblock %} > > > > In the other template files I just extend the base template. But the > base content dont get the categories by context. If I put this code in > the final template file everything works fine. But I dont think

Base template doesnt get the context

2010-04-19 Thread Thales
{% for categorie in categories %} {{ categorie.title }} {% endfor %} {% endblock %} {% block conteudo %} {% endblock %} In the other template files I just extend the base template. But the base content dont get the categories by context. If I put this code in the final template file everything

Re: content template loads at bottom of base template instead of top

2010-03-20 Thread timdude
Thanks Bruno, > > First question : does it always happen on the sames pages, or do you > have a same page sometimes OK and sometimes not ? > Second question : does it happen with all browsers or only with a > specific one ? When it happens, it can be on any browser, I've seen it on 6 different on

Re: content template loads at bottom of base template instead of top

2010-03-19 Thread bruno desthuilliers
site, reloading pages, whatever, and couldn't see anything wrong here (using Chrome). > I'll paste my base template, and a content template and a view at > dpaste: > > http://dpaste.com/173541/   view Looks like your doing some things the hard way here... I don't have tim

Re: content template loads at bottom of base template instead of top

2010-03-18 Thread timdude
OK, dare I state the obvious, I am pretty green at this. Thanks for helping out. I'll try and be more specific: My site is sitting at http://staging.bluecaravan.net . The 'glitch' happens fairly frequently (over 50%) and on random pages through the site. I'll paste my

Re: content template loads at bottom of base template instead of top

2010-03-18 Thread Atamert Ölçgen
On Thursday 18 March 2010 11:17:03 bruno desthuilliers wrote: > Yes, indeed. Quite obviously, the frobnulator module whizzed, probably > because of a missing bar going foo. > > > Uh ? Expected a more helpful answer ? Well, what about providing > enough informations then ?-) Providing what would

Re: content template loads at bottom of base template instead of top

2010-03-18 Thread bruno desthuilliers
On Mar 18, 6:44 am, timdude wrote: > Hiya all, > > My lovely django app is letting me down (or I'm letting it down). I am > using a base template with a content template extending this base. > Half of the time and on random pages, the content template loads at > the

content template loads at bottom of base template instead of top

2010-03-17 Thread timdude
Hiya all, My lovely django app is letting me down (or I'm letting it down). I am using a base template with a content template extending this base. Half of the time and on random pages, the content template loads at the bottom of the page/base template. Anyone know what's going on? C

how to add new message prompt in base template?

2009-12-05 Thread lzhshen
Hi, I adopt django-messages as one of my site's application. Does anyone know how to add a new message prompt in base template? I mean how I can get one application's data in base template. Does this make sense? Thanks in advance! -- You received this message because you are

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
t;> >> {% block content %} >> my content goes here... >> >> {% for form in forms %} >> {{ form.as_p }} >> {% endfor %} >> >> {% endblock %} >> >> >> The idea is that the 'base.html' template will *alwa

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
t make sure it extends base: >> {# mytemplate.html #} >> {% extends "base.html" %} >> >> {% block content %} >> my content goes here... >> >> {% for form in forms %} >> {{ form.as_p }} >> {% endfor %} >> >>

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
and render it. That means that all you > ever have to do is make sure that the context variable "media" > contains the cumulative media of what you want to include. Note, > though, that when you want to use this "extends" approach, you become > required to work in t

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
de. Note, though, that when you want to use this "extends" approach, you become required to work in those blocks. that's why I put a "content" block in the base template, and override it in the extended one. Stuff outside of blocks in mytemplate.html won't get displayed

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
gt;> >> >> >>> You know what, this is absolutely too much BS. Why would one bother to use >>> the media declaration stuff at all if there is no mechanism to properly >>> consume it (a built in template tag for instance). >> >>> I think

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
is absolutely too much BS.  Why would one bother to use > > the media declaration stuff at all if there is no mechanism to properly > > consume it (a built in template tag for instance). > > > I think I will just hardcode them in the head in the base template.  They > > sel

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
absolutely too much BS. Why would one bother to use >> the media declaration stuff at all if there is no mechanism to properly >> consume it (a built in template tag for instance). >> >> I think I will just hardcode them in the head in the base template. They >> s

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
ance). > > I think I will just hardcode them in the head in the base template.  They > seldom change and browser caching being what it is having them never change > is just fine. > > After three weeks of seriously trying to get traction with django, my > conclusion is it has all

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
You know what, this is absolutely too much BS. Why would one bother to use the media declaration stuff at all if there is no mechanism to properly consume it (a built in template tag for instance). I think I will just hardcode them in the head in the base template. They seldom change and

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
The idea is along the lines of what you initially guessed. The admin accomplishes the non-duplicate effect in django/django/ contrib/admin/options.py, starting at line 770. It loops over the forms and combines the existing media with the media on each form object. It ends up using a series of ob

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
What about de-duping? If two forms want the same js file, will it get included twice? It seems like this is the kind of thing that the framework should handle and the current "solution" is kind of half baked. -Todd On Nov 23, 2009, at 2:40 PM, Mark (Nosrednakram) wrote: > > Hello, > > I have

Re: Designing base template - how to include media properly?

2009-11-23 Thread Mark (Nosrednakram)
Hello, I have something like the following in my generic genericform.html. I think this is what you're looking for if not hope you find a better answer. The extramedia block is back in my base.html template and my form template extends it. I'm not sure if it's in the admin base.html but you can

Designing base template - how to include media properly?

2009-11-23 Thread Todd Blanchard
I've read this: http://docs.djangoproject.com/en/dev/topics/forms/media/ Nifty. Now, how exactly do I make sure that the media urls get spewed properly into the head section of the page? This is apparently omitted everywhere I've looked. The admin template seems to pull it off properly but

Re: Variable Base Template

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 3:19 PM, pingwin wrote: > > Hi, > > This is frustrating and against a true MVC methodology. I want to have > something like this for the designer in the template. > > {% if user.is_authenticated %} > {% extends "auth_base.html" %} > {% else %} > {% extends "base.html" %}

Variable Base Template

2009-06-08 Thread pingwin
Hi, This is frustrating and against a true MVC methodology. I want to have something like this for the designer in the template. {% if user.is_authenticated %} {% extends "auth_base.html" %} {% else %} {% extends "base.html" %} {% endif %} However this obviously fails. I do not think it mak

Re: 'base' template

2009-05-10 Thread Daniel Roseman
On May 10, 1:14 am, lisa holper wrote: > No, sorry there is a misunderstanding. I did not use Apache, but just copied > the html files in my directory of my homepage. So, this does not work? Do I > need to use Apache? > thanks again, Lisa > Again, you need to read the deployment documentation, a

Re: 'base' template

2009-05-09 Thread lisa holper
Fri, May 8, 2009 at 5:57 AM, Eric Abrahamsen wrote: >> >>> >>> >>> On May 8, 2009, at 4:35 PM, lisa holper wrote: >>> >>> Hi, >>> >>> I created a websit

Re: 'base' template

2009-05-09 Thread ricardoandrademendo...@gmail.com
t.com/en/dev/intro/tutorial01/#intro- > > tutorial01 > > > Eric > > >> Thanks, Lisa > > >> On Fri, May 8, 2009 at 5:57 AM, Eric Abrahamsen   > >> wrote: > > >> On May 8, 2009, at 4:35 PM, lisa holper wrote: > > >>> Hi, > >

Re: 'base' template

2009-05-09 Thread Eric Abrahamsen
; On May 8, 2009, at 4:35 PM, lisa holper wrote: >> >>> Hi, >>> >>> I created a website with django. >>> My problem: When I insert all .html pages in my directory, I can >>> see the website

Re: 'base' template

2009-05-08 Thread lisa holper
:35 PM, lisa holper wrote: >> >> Hi, >> >> I created a website with django. >> My problem: When I insert all .html pages in my directory, I can see the >> website but without using the 'base' template. >> >> >> Do you have

Re: 'base' template

2009-05-08 Thread Eric Abrahamsen
olper wrote: > >> Hi, >> >> I created a website with django. >> My problem: When I insert all .html pages in my directory, I can >> see the website but without using the 'base' template. > > Do you have {% extends 'base.html' %} at the top of all

Re: 'base' template

2009-05-08 Thread lisa holper
e: > > Hi, > > I created a website with django. > My problem: When I insert all .html pages in my directory, I can see the > website but without using the 'base' template. > > > Do you have {% extends 'base.html' %} at the top of all your templa

Re: 'base' template

2009-05-08 Thread Eric Abrahamsen
On May 8, 2009, at 4:35 PM, lisa holper wrote: > Hi, > > I created a website with django. > My problem: When I insert all .html pages in my directory, I can see > the website but without using the 'base' template. Do you have {% extends 'base.html' %} at t

'base' template

2009-05-08 Thread lisa holper
Hi, I created a website with django. My problem: When I insert all .html pages in my directory, I can see the website but without using the 'base' template. I would be glad for your help. Lisa --~--~-~--~~~---~--~~ You received this message becau

Flatpages and base template translations

2008-07-02 Thread shadfc
l for the menus and such work great. However, when I do the exact same thing with a flatpage, nothing gets translated in the base template. The introduction.html and flatpages/default.html are nearly the same, except that my page_title and content blocks are actual content in introduction.html an

Re: base template and views

2008-06-26 Thread Eric Abrahamsen
Probably what you want is to make a custom template tag that does the proper query-to-html business, and then stick that tag in your base template. Might want to look into caching the result, if it doesn't change often... http://www.djangoproject.com/documentation/templates_python/#wr

Re: base template and views

2008-06-26 Thread Peter Rowell
> Anyone know what I really ought to be doing? What you want is a default context. Look at http://www.djangoproject.com/documentation/templates_python/#playing-with-context-objects Also see http://www.djangoproject.com/documentation/settings/#template-context-processors. Pretty much all of our

base template and views

2008-06-26 Thread moonsand
I have a design issue where i want to have a standard base template display a list of database entries with a count for the most popular entries. If I am using this as the base template this means that I need to pass the list and the calculated count from any view which calls any template which

Re: passing form to base template

2008-04-29 Thread skunkwerk
should do the trick, thanks On Apr 28, 7:49 pm, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 9:33 AM, skunkwerk <[EMAIL PROTECTED]> wrote: > >  I've got two forms included in my base template, from which a few > >  othe

Re: passing form to base template

2008-04-28 Thread Ronny Haryanto
On Tue, Apr 29, 2008 at 9:33 AM, skunkwerk <[EMAIL PROTECTED]> wrote: > I've got two forms included in my base template, from which a few > others inherit. Currently I'm passing a newly-constructed form to > each of the inherited templates in the functions using >

passing form to base template

2008-04-28 Thread skunkwerk
I've got two forms included in my base template, from which a few others inherit. Currently I'm passing a newly-constructed form to each of the inherited templates in the functions using render_to_response, like so: return render_to_response('contact.html', {'form'

Re: Displaying a variable in my base template

2008-03-26 Thread Brandon Taylor
Thanks! On Mar 25, 10:24 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If it is going to be in every page I would just use the now > tag(http://www.djangoproject.com/documentation/templates/#now) in > the base.html > > On Mar 25, 9:56 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hel

Re: Displaying a variable in my base template

2008-03-25 Thread [EMAIL PROTECTED]
If it is going to be in every page I would just use the now tag( http://www.djangoproject.com/documentation/templates/#now ) in the base.html On Mar 25, 9:56 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hello everyone, > > Still fairly new to Django, but I'm loving it! > > I have a base html t

Displaying a variable in my base template

2008-03-25 Thread Brandon Taylor
Hello everyone, Still fairly new to Django, but I'm loving it! I have a base html template that I would like to display the current year in. Where should I put the action that retrieves the current year if I would like the value to appear on every page? Thank you, Brandon --~--~-~--~---

Re: Authentication not applied in base template

2008-02-21 Thread quizkiwi
That worked great for the base template. But how do I pass database values to a view in an app? I have a a view that should have all the records available for a template so that I can loop through each record and display on the screen. I cannot figure out how to give the template access to the

Re: Authentication not applied in base template

2008-02-20 Thread quizkiwi
That is the second time RequestContext has come back to bite me, I guess I did not understand it the first time. Thanks! On Feb 20, 6:53 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Feb 20, 2008 at 5:18 PM, quizkiwi <[EMAIL PROTECTED]> wrote: > > Is there some difference in authenti

Re: Authentication not applied in base template

2008-02-20 Thread James Bennett
On Wed, Feb 20, 2008 at 5:18 PM, quizkiwi <[EMAIL PROTECTED]> wrote: > Is there some difference in authentication between the app and the > main site? http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext -- "Bureaucrat Conrad, you are technically co

Authentication not applied in base template

2008-02-20 Thread quizkiwi
I have a base template that checks whether a user is authenticated or not: If so: display "Hello Username, Logout" If not: display "Login" It works great until I click a link which will bring me into one of the apps that I have setup. The app extends the base template, and o

Re: {% load %} tag in a base template can't be inherited?

2008-02-06 Thread Adam Stein
On Wed, 2008-02-06 at 13:02 -0800, koenb wrote: > BTW, you can add tags to builtins if you need them all the time. > > eg. if you need i18n all over: > > from django.template import add_to_builtins > add_to_builtins('django.templatetags.i18n') Thanks for the info. Where would I put this? --

Re: {% load %} tag in a base template can't be inherited?

2008-02-06 Thread koenb
BTW, you can add tags to builtins if you need them all the time. eg. if you need i18n all over: from django.template import add_to_builtins add_to_builtins('django.templatetags.i18n') Koen On 6 feb, 20:59, Adam Stein <[EMAIL PROTECTED]> wrote: > On Wed, 2008-02-06 at 11:31 -0800, Daniel Rosema

Re: {% load %} tag in a base template can't be inherited?

2008-02-06 Thread Adam Stein
On Wed, 2008-02-06 at 11:31 -0800, Daniel Roseman wrote: > >From the same documentation page you quote above (http:// > www.djangoproject.com/documentation/templates/): > > When you load a custom tag or filter library, the tags/filters are > only made available to the current template -- not any

Re: {% load %} tag in a base template can't be inherited?

2008-02-06 Thread Daniel Roseman
On 6 Feb, 19:03, Adam Stein <[EMAIL PROTECTED]> wrote: > Running Django v0.96. > > Want to check to see if this behavior is normal. I have a base template > that uses {% load %}. I have another template that extends the base > template. The {% load %} tag doesn

{% load %} tag in a base template can't be inherited?

2008-02-06 Thread Adam Stein
Running Django v0.96. Want to check to see if this behavior is normal. I have a base template that uses {% load %}. I have another template that extends the base template. The {% load %} tag doesn't seem to carry into the extended template. In other words, it looks like I have to use {%

Re: Calling a method from the base template

2008-01-07 Thread Malcolm Tredinnick
On Mon, 2008-01-07 at 20:28 -0600, Michael Hipp wrote: [...] > Is it really necessary to complicate every 'view' method by appending > 'context_instance=RequestContext(request)' to the render_to_response > call? This seems totally boilerplate and a violation of DRY. Write your own shortcut fun

Re: Calling a method from the base template

2008-01-07 Thread Michael Hipp
Peter Rowell wrote: >> There is a mechanism available >> for that -- context processors -- but people don't want to use it >> because they want *something else* that happens for every template. > > Malcolm's absolutely correct: context processors (I mis-typed when I > said content processors) is

Re: Calling a method from the base template

2008-01-06 Thread Peter Rowell
> There is a mechanism available > for that -- context processors -- but people don't want to use it > because they want *something else* that happens for every template. Malcolm's absolutely correct: context processors (I mis-typed when I said content processors) is exactly what you want here. T

Re: Calling a method from the base template

2008-01-06 Thread Kenneth Gonsalves
On 06-Jan-08, at 11:01 PM, Michael Hipp wrote: > Attempting to do a method call {% views.get_stuff %} just results > in a 'bad > tag' error. > > Doing it like a variable {{ views.get_stuff }} just seems to be > ignored. make a templatetag -- regards kg http://lawgon.livejournal.com http:

Re: Calling a method from the base template

2008-01-06 Thread Malcolm Tredinnick
On Sun, 2008-01-06 at 16:12 -0600, Michael Hipp wrote: > Peter Rowell wrote: [...] > > I recommend rethinking how data is passed into and used in your > > templates. Consider creating your own content processor. Or maybe some > > custom template tags and/or filters. See > > http://www.djangoproj

Re: Calling a method from the base template

2008-01-06 Thread Michael Hipp
Peter Rowell wrote: > It > would probably be better (for any number of reasons) if you put all of > these types of routines in a utils.py module and import/pass that. > E.g. > > import utils > return render_to_response('now.html', RequestContext(request, { > 'utils': utils, >

Re: Calling a method from the base template

2008-01-06 Thread Peter Rowell
> Attempting to do a method call {% views.get_stuff %} just results in a 'bad > tag' error. Right, because there is no tag with the name 'views.get_stuff'. > Doing it like a variable {{ views.get_stuff }} just seems to be ignored. Not ignored, but it probably fails which the template engine tre

Calling a method from the base template

2008-01-06 Thread Michael Hipp
This is probably really simple, but I'm not seeing it. I have my base.html and sub.html templates. The method that services the sub template does it's job fine. But in the base template I have a piece of content that is independent of the sub template. I have a get_stuff() method i

Re: issue with ifequal in a base template

2007-06-05 Thread Sven Broeckling
> > {% for catetory in categorylist %} > If this is a cut-and-paste of your template, here's your error. Learn to > spell "category". :-) Oh how blind was that. Of course that was the problem, thanks a lot :) After fixing that i got an "always false" instead of "always true". The debug line wi

Re: issue with ifequal in a base template

2007-06-05 Thread Malcolm Tredinnick
On Tue, 2007-06-05 at 11:45 +0200, Sven Broeckling wrote: > Hi everyone, > > i use django for a small fun website, and it's really fun to create > applications with it. Now i'm stuck with a behaviour i can't > comprehend. > > I have a category list in

issue with ifequal in a base template

2007-06-05 Thread Sven Broeckling
Hi everyone, i use django for a small fun website, and it's really fun to create applications with it. Now i'm stuck with a behaviour i can't comprehend. I have a category list in my base template : --[snip]-- {%

Re: can't get LANGUAGES to work in the base template

2006-10-08 Thread Baurzhan Ismagulov
On Sun, Oct 08, 2006 at 06:27:38PM +0400, Ivan Sagalaev wrote: > If I correctly suspect that we speak the same language then I can > recommend my blog post about it: > http://softwaremaniacs.org/blog/2006/01/12/context-processors/ This is great, it describes first the use case rather than the f

Re: can't get LANGUAGES to work in the base template

2006-10-08 Thread Baurzhan Ismagulov
Hello Ivan, On Sun, Oct 08, 2006 at 05:54:27PM +0400, Ivan Sagalaev wrote: > All the extra information (such as {{ user }} or {{ LANGUAGES }}) is > passed to templates by a RequestContext that processes a number of > context processors defined in TEMPLATE_CONTEXT_PROCESSORS in settings. > > I

Re: can't get LANGUAGES to work in the base template

2006-10-08 Thread Ivan Sagalaev
Baurzhan Ismagulov wrote: > I'm using django 0.96 r3709. I have base.html, page1.html, and > page2.html templates. The latter two extend the former one. base.html > creates a box with all supported LANGUAGES. This works as > expected in page1, but not in page2. page1 is a verdjn templatepage > (r

can't get LANGUAGES to work in the base template

2006-10-08 Thread Baurzhan Ismagulov
Hello all, I'm using django 0.96 r3709. I have base.html, page1.html, and page2.html templates. The latter two extend the former one. base.html creates a box with all supported LANGUAGES. This works as expected in page1, but not in page2. page1 is a verdjn templatepage (rendered with HttpRespons

Re: User object available in base template

2006-10-04 Thread Patrick J. Anderson
t will show up in your templates. > > c= RequestContext(request, { ... }) > > Don > > > > > > Thanks, guys! I guess to create a user info box and make it available in all the templates, I'd create a template tag and load it in the base template, right?

  1   2   >