Re: django-cas-consumer template question

2011-04-30 Thread Alex Kamedov
Your user must be registered on service with django-cas-provider. Insead of django-cas-consumer i recomend to use django-cas [1] [1] http://code.google.com/p/django-cas/ On Fri, Apr 29, 2011 at 8:48 PM, Stodge wrote: > Of course! Thanks - I have the template working, now I need to get the > log

Re: django-cas-consumer template question

2011-04-29 Thread Stodge
Of course! Thanks - I have the template working, now I need to get the login functionality working for the consumer. On Apr 29, 9:35 am, Alex Kamedov wrote: > Your user must be redirected from django-cas-consumer login view to > django-cas-provider > login. Login form is shown on service with d

Re: django-cas-consumer template question

2011-04-29 Thread Alex Kamedov
Your user must be redirected from django-cas-consumer login view to django-cas-provider login. Login form is shown on service with django-cas-provider. On Fri, Apr 29, 2011 at 7:30 PM, Stodge wrote: > django-cas-consumer -- Alex Kamedov skype: kamedovwww: kamedov.ru -- You received th

django-cas-consumer template question

2011-04-29 Thread Stodge
I installed django-cas-provider and django-cas-consumer. I configured the consumer to use the CAS service offered by the provider and I added a base.html template for the consumer. Is this base template supposed to contain the login form? Or is the login form supposed to be available on teh provide

Re: Template Question

2009-07-13 Thread CrabbyPete
Smartif is great, I don't get why it's not a standard part of django templates. On Jun 17, 5:02 pm, Steve Howell wrote: > Another option is to install the snippet below, which supports "in": > > http://www.djangosnippets.org/snippets/1350/ > > On Jun 17, 1:53 pm, Ben Davis wrote: > > > > > Nope

Re: Template Question

2009-06-17 Thread Steve Howell
Another option is to install the snippet below, which supports "in": http://www.djangosnippets.org/snippets/1350/ On Jun 17, 1:53 pm, Ben Davis wrote: > Nope, you'll need to set a variable in your view.  You can also try creating > your own filter such that {% if friend|is_in_group %}  would wo

Re: Template Question

2009-06-17 Thread Ben Davis
Nope, you'll need to set a variable in your view. You can also try creating your own filter such that {% if friend|is_in_group %} would work (it's pretty easy to do, just check out the docs for custom template filters) On Tue, Jun 16, 2009 at 2:40 PM, CrabbyPete wrote: > > Is there a way do so

Template Question

2009-06-16 Thread CrabbyPete
Is there a way do something like this with the template system {% if friend in group.members.all %} or simply {% friend in group.members.all %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Django Template Question

2009-04-06 Thread Briel
If you are trying to construct a "base" template for several views you could also use the {% if %} tags, and only show the relevant parts of the page. For example, if you wanted to display a table, but the number om columns would vary, this would enable you to only display the needed columns. On

Re: Django Template Question

2009-04-06 Thread Daniel Roseman
On Apr 6, 6:38 am, codingJoe wrote: > Up front, I'm not the most elegant coder, so please forgive. > >   I have a page that is produced using django templates.   I used the > templates to do the header and footer, but now I'm down into the body > of the page.   Using the data from my template, I

Django Template Question

2009-04-05 Thread codingJoe
Up front, I'm not the most elegant coder, so please forgive. I have a page that is produced using django templates. I used the templates to do the header and footer, but now I'm down into the body of the page. Using the data from my template, I am able to fill the first cell. Is is possibl

Re: Template Question

2008-09-04 Thread unklbeemer
I am using Basic Blog from the Django-Basic-Apps released by Nathan Borror if that helps. On Sep 4, 9:44 am, unklbeemer <[EMAIL PROTECTED]> wrote: > I am wanting to show all blog entries written by certain authors..how > would I go about doing this in my templates. > > In my Blog model I have an

Template Question

2008-09-04 Thread unklbeemer
I am wanting to show all blog entries written by certain authors..how would I go about doing this in my templates. In my Blog model I have an author variable. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Template Question - What if...

2008-02-12 Thread Peter
Cool, thanks for the tip. I took your latter suggestion and below is a rewrite of the django.template.loader.get_template method. The only additional requirement is the FS_DIR constant that I import from my settings file (which I was already using in settings.py to clean up my TEMPLATE_DIR path

Re: Template Question - What if...

2008-02-11 Thread Malcolm Tredinnick
On Mon, 2008-02-11 at 16:55 -0800, Peter wrote: > I have a bunch of widgets that I access dynamically and they render > their own parts of a page. I would like to give these widgets the > ability to use templates. Furthermore, these are not installed apps, > so I do not have access to the > "dj

Template Question - What if...

2008-02-11 Thread Peter
I have a bunch of widgets that I access dynamically and they render their own parts of a page. I would like to give these widgets the ability to use templates. Furthermore, these are not installed apps, so I do not have access to the "django.template.loaders.app_directories.load_template_source"

Re: Stupid template question

2007-12-15 Thread rskm1
On Dec 14, 1:03 am, Steve Freitas <[EMAIL PROTECTED]> wrote: > Only, it doesn't work. It seems like . lookups > require the argument to be a literal, not a variable. Grindizer addresses your specific problem of enumerating key/value pairs in a template (piece of cake!), but if you still wanted to

Re: Stupid template question

2007-12-14 Thread Grindizer
have you take a look at the django documentation ? http://www.djangoproject.com/documentation/templates/#for Because we can see this :) {% for key, value in data.items %} {{ key }}: {{ value }} {% endfor %} On 14 déc, 08:03, Steve Freitas <[EMAIL PROTECTED]> wrote: > I have a dictionary, an

Re: Stupid template question

2007-12-14 Thread etng
It seems that you've made a typo. change {{myDict.key}} to {{myDict.keys}} On Dec 14, 2007 3:03 PM, Steve Freitas <[EMAIL PROTECTED]> wrote: > > I have a dictionary, and I'd like to iterate over the keys, using the > keys to look up the result, like: > > {% for key in myDict %} > The key is {{key

Stupid template question

2007-12-13 Thread Steve Freitas
I have a dictionary, and I'd like to iterate over the keys, using the keys to look up the result, like: {% for key in myDict %} The key is {{key}} and the value is {{myDict.key}}. {% endfor %} Only, it doesn't work. It seems like . lookups require the argument to be a literal, not a variable. I'

Re: template question

2007-11-02 Thread RajeshD
On Nov 1, 9:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have this code in my view, for example: > > a=['a','b','c'] # a list of row labels > b=[1,2,3] # a list of col label > c=tab # an array (list of list) with len(a) rows and len(b) cols. If c[i, j] previously had a value of x,

Re: template question

2007-11-02 Thread [EMAIL PROTECTED]
Nobody can help me ? On 1 nov, 14:56, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have this code in my view, for example: > > a=['a','b','c'] # a list of row labels > b=[1,2,3] # a list of col label > c=tab # an array (list of list) with len(a) rows and len(b) cols. > return render_to_resp

template question

2007-11-01 Thread [EMAIL PROTECTED]
I have this code in my view, for example: a=['a','b','c'] # a list of row labels b=[1,2,3] # a list of col label c=tab # an array (list of list) with len(a) rows and len(b) cols. return render_to_response('template.html',{'a':a,'b':b,'c':c}) then on the template side, it's easy to print c {% for

template question

2007-11-01 Thread [EMAIL PROTECTED]
I have this code in my view, for example: a=['a','b','c'] # a list of row labels b=[1,2,3] # a list of col label c=tab # an array (list of list) with len(a) rows and len(b) cols. return render_to_response('template.html',{'a':a,'b':b,'c':c}) then on the template side, it's easy to print c {% for

Re: Many to many in template question

2007-06-08 Thread [EMAIL PROTECTED]
Thanks Russell. I'll go re-read them (again). One of these days they'll actually sink into my thick skull. On Jun 7, 7:09 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 6/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Figured it out. Template wanted (for whatever reason)

Re: Many to many in template question

2007-06-07 Thread Russell Keith-Magee
On 6/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Figured it out. Template wanted (for whatever reason) > {% for foo in bar.foos.all %} instead of {% for foo in > bar.foos_set.all %} This would all be a lot clearer if you would read the DB-api docs. The related-objects section explains

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
Figured it out. Template wanted (for whatever reason) {% for foo in bar.foos.all %} instead of {% for foo in bar.foos_set.all %} On Jun 7, 12:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm just getting more and more stumped. > > I went ahead and created a custom view for Foo, so that

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
I'm just getting more and more stumped. I went ahead and created a custom view for Foo, so that's taken care of, but Bar (which should be easy) isn't working either. I have: class Bar(models.Model): name= models.CharField(maxlength=100) foos = models.ManyToManyField(Foo, filter_i

Re: Many to many in template question

2007-06-07 Thread Russell Keith-Magee
On 6/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > That's what I thought, too, but I can't seem to access it. Maybe I > need to just write a custom view for this page. Based on what you've said so far, you shouldn't need to write a new view. You just need to reference the m2m data correc

Re: Many to many in template question

2007-06-07 Thread [EMAIL PROTECTED]
That's what I thought, too, but I can't seem to access it. Maybe I need to just write a custom view for this page. On Jun 6, 4:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This doesn't exactly answer your question (because I'm a huge noob > still), but M2M relationships work in both >

Re: Many to many in template question

2007-06-06 Thread [EMAIL PROTECTED]
This doesn't exactly answer your question (because I'm a huge noob still), but M2M relationships work in both directions: http://www.djangoproject.com/documentation/db-api/#many-to-many-relationships I think to access it in the template, you'd just need to pass the information from your view? O

Many to many in template question

2007-06-06 Thread [EMAIL PROTECTED]
I know I'm making this harder than it has to be, but the logic is just escaping me. I've got two models, say "Foo" and "Bar" "Bar" establishes a manyToManyField relationship with "Foo": foos = models.ManyToManyField(Foo, filter_interface=models.HORIZONTAL, null=True, blank=True) I'm using a ge

Re: Template question

2007-06-03 Thread sansmojo
You could set an extra context variable in each view that tells whether to display the div. The variable is accessible from the parent template. base.html: {% if show_inset %} {% block inset %}{% endblock %} {% endif %} You could also use a template tag for the whole chunk, but this s

Re: Template question

2007-06-02 Thread Eugene Morozov
On 2 июн, 17:37, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-06-02 at 06:07 -0700, Eugene Morozov wrote: > > Hello, > > I have a question which might be trivial to answer, but I didn't found > > answer by scanning the docs. > > In my base template I have defined inset block: > >

Re: Template question

2007-06-02 Thread Malcolm Tredinnick
On Sat, 2007-06-02 at 06:07 -0700, Eugene Morozov wrote: > Hello, > I have a question which might be trivial to answer, but I didn't found > answer by scanning the docs. > In my base template I have defined inset block: > > {% block inset %}{% endblock %} > > I want to remove

Template question

2007-06-02 Thread Eugene Morozov
Hello, I have a question which might be trivial to answer, but I didn't found answer by scanning the docs. In my base template I have defined inset block: {% block inset %}{% endblock %} I want to remove tags if derived template doesn't fill in the inset block. Of course I c

Template question - Can you conditionally inherit from other templates?

2007-02-14 Thread Joseph Heck
I looked through the documentation, and tried a few experiments - it looks like you can't - but I wanted to make sure I wasn't doing something wrong: We tried to do something like: {% if {{trigger_variable}} %} {% block foo %} {% endblock foo %} {% else %} {% block altfoo %} {% endblo

Re: Template Question (for loop)

2006-07-28 Thread [EMAIL PROTECTED]
Well, you beat me to it, but I was going to say that a cutsom manager is probably the way I'd do this. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Template Question (for loop)

2006-07-28 Thread timster
That's not a bad solution. I just came up with a solution I'm very happy with. I created a custom manager that only returns visible objects. This way I can just do categories = Category.objects.all() and category.forum_set.all() in my template and it will only display visible objects. It works g

Re: Template Question (for loop)

2006-07-28 Thread [EMAIL PROTECTED]
Could create a list and loop through that, e.g. cat_list = Category.objects.filter(visible=True) list = [] for c in cat_list: list.append({"cat":c, "forums":c.forum_set.filter(visible=True, category__visible=True}) Then: {% for x in list %} {{ c.cat.name }} {% if c.forums %} {% for forum in

Re: Template Question (for loop)

2006-07-28 Thread timster
Yuck. I don't want to do it that way. It couples the display logic with the template. If I ever need to change the criteria that determines when to display forums/categories, I will need to change it in two places (view and template). --~--~-~--~~~---~--~~ You rec

Re: Template Question (for loop)

2006-07-28 Thread Javier Rivera
timster escribió: > {% for category in categories %} > {{ category.name }} > {% if category.forum_set.count %} > {% for forum in category.forum_set.all %} > {{ forum.name }} > {% endfor %} > {% else %} > no forums in this category > {% endif %} >

Template Question (for loop)

2006-07-28 Thread timster
To start off, I have two models: class Category(models.Model): name = models.CharField(maxlength=50) visible = models.BooleanField(default=True) class Forum(models.Model): category = models.ForeignKey(Category) name = models.CharField(maxlength=50) visible = models.BooleanFie

Re: Template question

2006-03-12 Thread Rob Slotboom
Thank you, I'll have a look. --~--~-~--~~~---~--~~ 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 [EM

Re: Template question

2006-03-12 Thread Rob Slotboom
Hi Malcolm, {{forloop.counter|add:offset}} works fine. Thanks, Rob --~--~-~--~~~---~--~~ 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 unsubs

Re: another template question

2006-03-10 Thread Russell Keith-Magee
On 3/11/06, Glenn Tenney <[EMAIL PROTECTED]> wrote: > > In my templates, I'd like to be able to (for example): > Given an "object_list" of rateable things, I'd like to > then get the "Rating" valules for the current user. > I'm trying to figure out a good way to do this. > > I don't see any way in

another template question

2006-03-10 Thread Glenn Tenney
In my first Django app I've got the following "rough" model (not real code, but enough to show what I mean): class Rateable some stuff common to all "Rateable" objects class Rating who = ForeignKey(User) what = ForeignKey(Rateable) values = ... class People(Rateab

Re: Template question

2006-03-10 Thread limodou
On 3/10/06, Rob Slotboom <[EMAIL PROTECTED]> wrote: > > Is it possible to add some initial value to a forloop.counter? > > This would be handy when using limit and offset. > > More general, is is possible to use template vars as values for > calculations: > {{ var1 }} + {{ var 2 }} > I'v develop

Re: Template question

2006-03-10 Thread Malcolm Tredinnick
On Fri, 2006-03-10 at 02:41 -0800, Rob Slotboom wrote: > Is it possible to add some initial value to a forloop.counter? > > This would be handy when using limit and offset. > > More general, is is possible to use template vars as values for > calculations: > {{ var1 }} + {{ var 2 }} The first t

Template question

2006-03-10 Thread Rob Slotboom
Is it possible to add some initial value to a forloop.counter? This would be handy when using limit and offset. More general, is is possible to use template vars as values for calculations: {{ var1 }} + {{ var 2 }} --~--~-~--~~~---~--~~ You received this message

Template Question

2005-10-12 Thread Armin
Hi, Once users log into my site, every page there on should have 'Welcome User_name' on the top right corner with the option for them to logout. I don't want to supply the user info. on every view. Can my template check to session for user_id and see if the user is logged in, and I could perhaps

Re: How do I do this? (Template Question)

2005-09-19 Thread Milton Waddams
perfect, thanks! On 9/20/05, Boffbowsh <[EMAIL PROTECTED]> wrote: > > I have this exact scenario in my project: > > {% if > forloop.counter0|divisibleby:"3" %}{% endif %} > >

Re: How do I do this? (Template Question)

2005-09-19 Thread Boffbowsh
I have this exact scenario in my project: {% if forloop.counter0|divisibleby:"3" %}{% endif %}

Re: How do I do this? (Template Question)

2005-09-19 Thread Kenneth Gonsalves
On Monday 19 Sep 2005 3:17 pm, Milton Waddams wrote: > I've probably missed this somewhere though can't seem to workout how > to do this. > > I want to have a list of products listed in a 3 column table with the > number of rows growing to cover all the items. use a for loop -- regards kg http:

How do I do this? (Template Question)

2005-09-19 Thread Milton Waddams
I've probably missed this somewhere though can't seem to workout how to do this. I want to have a list of products listed in a 3 column table with the number of rows growing to cover all the items. eg. product 1 product 2 product 3 product 4 product 5