Rajesh,
I was missing the ".all" attribute in my previous attempts.
Thanks,
Rodrigo
On Jan 3, 7:17 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
>
> > {% block content %}
> > {{articulo}}
> >
> > identificadores:{{articulo.identificadores}}
> >
> > {% endblock %}
>
Hi,
>
> {% block content %}
> {{articulo}}
>
> identificadores:{{articulo.identificadores}}
>
> {% endblock %}
Since you can have many identificadores, you need to do something like
this in your template:
{% for ix in articulo.identificadores.all %}
{{ ix.identificador }}
Fixed it, in the class definition:
@property
def ids(self):
return ' - '.join([a['identificador'] for a in
self.identificadores.values()])
On Jan 3, 6:36 pm, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote:
> I forgot to show the identificadores class:
>
> ---
> class Identificador(mo
I forgot to show the identificadores class:
---
class Identificador(models.Model):
identificador = models.CharField(max_length=200,unique=True)
def __unicode__ (self):
return self.identificador
class Admin:
pass
class Meta:
verbose_name_plural = "identif
Hi,
I am trying to render the contents of a ManyToManyField in a template.
However, when viewing the page, instead of the contents, it shows:
""
I understand why this is happening, sort of, but haven't been able to
fix it.
The field is called "identificadores", deifned in the class "Articulo"
as
5 matches
Mail list logo