Hi Justin,
I'm relatively new to django and while using the django simple friend app i
have bumped into the same issue as you.
I do not know how to tie back the views to templates so the results are
visually appreciated.
would you be able to help me out?
I want to see a template or page say
I think I've resolved some of my problems:
I was wondering how to list friend request but now I think I have to
use Django-Notifications to pick up the signals, would this be right?
complete models:
class FriendshipRequest(models.Model):
from_user = models.ForeignKey(User,
related_name="inv
I now have a different overriding problem with this simple-friends
app:
url patterns are simple:
urlpatterns = patterns('friends.views',
url(r'^$',
'friend_list',
name='friends_home'),
url(r'^list/(?P\w+)/$',
'friend_list',
name='friend_list'),
url(r'^a
On Mon, Mar 28, 2011 at 12:14 PM, mike171562 wrote:
> Maybe you could use the ifequal tag in your template, not sure what
> your trying to do , but in your view you could do a friend =
> Friends.objects.all() and in your template,
>
> {% ifequal friend.isfriend True %}
> do something here
> {%endi
Maybe you could use the ifequal tag in your template, not sure what
your trying to do , but in your view you could do a friend =
Friends.objects.all() and in your template,
{% ifequal friend.isfriend True %}
do something here
{%endifequal%}
{% ifequal friend.is_invited %}
something else
{%endifeq
need some help setting up templates for friends list:
how do I iterate a list of invited friends and are friends? I have
tried:
{% for friends in Friendship.objects.are_friends %}
target_user: {{ friends.target_user}}
current_user:{{ friends.current_user}}
are_frien
need some help setting up templates for friends list:
how do I iterate a list of invited friends and are friends? I have
tried:
{% for friends in Friendship.objects.are_friends %}
target_user: {{ friends.target_user}}
current_user:{{ friends.current_user}}
are_frien
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"
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) {
>
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:
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
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
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
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
On 15/07/10 15:19, justin jools wrote:
>
> $(document).ready(function() {
> $('#nav li a').click(function() {
> $('.active').removeClass('active');
> $(this).addClass(
tried putting the nav function in the child template made no
difference.
I have another button jquery script which is working fine, so maybe it
is my script but when I test in straight in html it works... bizarre
complete script:
http://www.w3.org/
TR/html4/strict.dtd">
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 doesn't
Hi thanks for your reply
the links are correct because the css works fine...
I do have blocks andchild templates but I took all this out to figure
out why the jquery nav function was being reset/disabled...
I tested alert('hello') function with
$(document).ready(function() {
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 pathss correct (like when
On May 27, 3:10 pm, Pirate Pete wrote:
> hello again,
>
> i am trying to get a single entry from my db and then annotate the
> count and rating to it like we established above
>
> however it doesn't seem to be returning anything:
> videos =
> Video.objects.get(id=vid_id).annotate(rating_count=Coun
hello again,
i am trying to get a single entry from my db and then annotate the
count and rating to it like we established above
however it doesn't seem to be returning anything:
videos =
Video.objects.get(id=vid_id).annotate(rating_count=Count('rating'),
rating_avg=Avg('rating__rating'))
i even
On May 25, 10:30 am, Pirate Pete wrote:
> sorry for this one last question,
>
> do you have any idea how i would go about rounding these values and
> converting them from numbers to *'s ?
>
> i tried using the round() function on the annotation however it kept
> giving me a type error "a float is
sorry for this one last question,
do you have any idea how i would go about rounding these values and
converting them from numbers to *'s ?
i tried using the round() function on the annotation however it kept
giving me a type error "a float is required."
cheers
On May 25, 7:10 pm, Daniel Rosem
You sir have saved me many a headache, i can't honestly thank you
enough
All the best!
On May 25, 7:10 pm, Daniel Roseman wrote:
> On May 25, 9:52 am, Pirate Pete wrote:
>
> > Thank you very very much for your reply.
>
> > There is still a few things i need to grasp.
>
> > Firstly, why did you
On May 25, 9:52 am, Pirate Pete wrote:
> Thank you very very much for your reply.
>
> There is still a few things i need to grasp.
>
> Firstly, why did you do this :
> annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rat
> ing'))
> as opposed to annotate(rating_count=Count(
Thank you very very much for your reply.
There is still a few things i need to grasp.
Firstly, why did you do this :
annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rating'))
as opposed to annotate(rating_count=Count('rating'),
rating_avg=Avg('rating__rating'))
Secondly,
On May 25, 6:09 am, Pirate Pete wrote:
> I have been trying to get some kind of kind response from django for a
> few days now and it has been very unkind to me :P
>
> basically i need to create a page that has a video title (link) and an
> average rating with the amount of people that rated it in
I have been trying to get some kind of kind response from django for a
few days now and it has been very unkind to me :P
basically i need to create a page that has a video title (link) and an
average rating with the amount of people that rated it in brackets.
so it will look like ... Awesom video
Excellent, thanks for the useful info
On Jan 15, 3:00 pm, Daniel Roseman wrote:
> On Jan 15, 1:47 pm, grimmus wrote:
>
>
>
> > Hi,
>
> > I have a view that gets the latest videos:
>
> > videos = Video.objects.filter(category=category,active=1).order_by
> > ('-hit_count')
>
> > In my template
On Jan 15, 1:47 pm, grimmus wrote:
> Hi,
>
> I have a view that gets the latest videos:
>
> videos = Video.objects.filter(category=category,active=1).order_by
> ('-hit_count')
>
> In my template i would like the first result to appear in the primary
> block and the other results to appear in t
Hi,
I have a view that gets the latest videos:
videos = Video.objects.filter(category=category,active=1).order_by
('-hit_count')
In my template i would like the first result to appear in the primary
block and the other results to appear in the secondary block
{% block primary %}
SHOW FI
On May 1, 9:47 am, Alex Gaynor wrote:
> On Thu, Apr 30, 2009 at 7:45 PM, AlexK wrote:
>
> > Hi all,
>
> > I would just like some comments about something particular in my
> > template. I'm concerned there may be a better way of doing what I am
> > doing. You will see why when you look at my code
On Thu, Apr 30, 2009 at 7:45 PM, AlexK wrote:
>
> Hi all,
>
> I would just like some comments about something particular in my
> template. I'm concerned there may be a better way of doing what I am
> doing. You will see why when you look at my code.
>
> http://dpaste.com/39858/
>
> I am mainly co
Hi all,
I would just like some comments about something particular in my
template. I'm concerned there may be a better way of doing what I am
doing. You will see why when you look at my code.
http://dpaste.com/39858/
I am mainly concerned with lines 3 to 7. Ignore that I should use a
variable f
Think I may have just figured it out
comment.content_object.get_absolute_url works for me.
On Sep 22, 2:37 pm, Delta20 <[EMAIL PROTECTED]> wrote:
> I have the exact same question. I also tried using
> "object.get_content_object.get_absolute_url" but that didn't work
> either.
>
> On Sep 22, 5:2
I have the exact same question. I also tried using
"object.get_content_object.get_absolute_url" but that didn't work
either.
On Sep 22, 5:25 pm, macgregor <[EMAIL PROTECTED]> wrote:
> I have the new Comments app installed and working and want to modify
> django/contrib/comments/templates/comment
I have the new Comments app installed and working and want to modify
django/contrib/comments/templates/comments/posted.html to include a
link to the content object that a comment gets added to.
For example: If someone posts a comment on a blog entry, the comment
gets added and then the user is re
Is there anybody out there using mptt?
'full_tree_model' tags and filters are working correctly, but i was
unable to use a 'drilldown_tree_for_node'.
Does anybody have a working example or detailed instructions?
tia,
Charlie.
--
"s minden mestert kinevettem, ki nem nevetett önmagán."
GPG publ
it *should* be in the view anyway??? it's logic...
but it should be possible? Something like this would work...
although.. it's hideously innefficient.
{% for row in data %}
{% for key,val in row.items %}
{% for field in fields %}
{% ifequal field key %}
{{ key }}: {{ val }}
{% endifequal %}
{% e
I'm not sure there's a way to do this purely in the template language.
You can munge the data in the view instead. This line creates a new
filtered_data list that has only the data you want to display:
filtered_data = [ dict([ (k,d[k]) for k in fields ]) for d in data ]
--Ned.
http://nedbatc
I'm trying to do something with a template that I thought would be very
simple but I've not yet found a way to make it work at all.
from django.template import Template, Context
fields = ("f1", "f3")
data = [
{"f1": "Foo", "f2": "Skip ","f3": "Bar"},
{"f1": "Cat", "f2": "Ignore","f3":
41 matches
Mail list logo