List Info

Thread: Get_FIELD_url issues




Get_FIELD_url issues
user name
2007-05-31 16:01:14
Awright. I just know I'm missing something stupid here. 

I have a model for file attachments that are uploaded. In
one of my
templates, I'd like to display a URL whence the attachment
could be
recalled. So I've put in {{ a.get_bugfile_url }} in the
template, but
the output HTML looks like <a
href="">Title</a>. I can't retrieve the
URL. However, if I test this in the shell, calling
a.get_bugfile_url(),
I get exactly the URL I'm expecting. Interestingly,
get_bugfile_filename
also doesn't work in the template, but does in the shell.

Anyone tell me what stupid thing I'm missing? I'm using the
most current
SVN version of django (trunk).
Thanks,
J

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Get_FIELD_url issues
country flaguser name
United States
2007-05-31 17:22:47
When you are in the shell you might be accessing the models
field and
when you are in the template you are accessing the form
field.  You
might just want to pass the url of the attachment in through
the view.

On May 31, 4:01 pm, "John Goodleaf"
<John.Goodl...gilead.com> wrote:
> Awright. I just know I'm missing something stupid
here.
>
> I have a model for file attachments that are uploaded.
In one of my
> templates, I'd like to display a URL whence the
attachment could be
> recalled. So I've put in {{ a.get_bugfile_url }} in the
template, but
> the output HTML looks like <a
href="">Title</a>. I can't retrieve the
> URL. However, if I test this in the shell, calling
a.get_bugfile_url(),
> I get exactly the URL I'm expecting. Interestingly,
get_bugfile_filename
> also doesn't work in the template, but does in the
shell.
>
> Anyone tell me what stupid thing I'm missing? I'm using
the most current
> SVN version of django (trunk).
> Thanks,
> J


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )