Hello, i have a model called FEATURE, where a "PRODUCT" charfield(50)
existed. Yesterday I created a PRODUCT model and updated FEATURE model
to use that foreign key.

However, when a form to view the FEATURE data is called through a
template, an error on line 27 occurs:

Caught an exception while rendering: 'Product' object has no attribute
'serializable_value'

************************************
TEMPLATE
************************************
17       <form method="post" action=".">
18      <table width="90%" border="0">
19      <tr bgcolor=#E6E6E6>
20      <th width="100%" align="center" colspan="2"><font color="#000000"
size="3">Feature Details</font></th>
21      </tr>
22      </table>
23
24      <table width="90%" border="0">
25      <td width="20%"></td>
26      <td width="80%"></td>
27      {% for field in form %}
28      {% if field.errors %}
29      <tr><td align="left", colspan="2">{{ field.errors }}</td></tr>
30      {% endif %}
31      <tr>
32      <td align="left">{{ field.label_tag }}{% if field.field.required %}
*{% endif %}</td>
33      <td align="left">{{ field }}</td>
34      </tr>
35      {% if field.help_text %}
36      <tr><td></td><td align="left"><p class="hormHelp">
{{ field.help_text }}</p></td></tr>
37      {% endif %}


************************************
PRODUCT MODEL
************************************
class Product(MyBaseModel):

    name  = models.CharField("Product Name", max_length = 50)
    release  = models.CharField("Release", max_length = 10)
    date1      = models.DateField("Date1")
    date2      = models.DateField("Date2")
    date3      = models.DateField("Date3")
    date4      = models.DateField("Date4")
    def __unicode__(self):
        return self.name

    class Meta:
        db_table = 'ProductTable'
        verbose_name = "Product"
        verbose_name_plural = "Products"

************************************
FEATURE MODEL
************************************
class Feature(MyBaseModel):
(...)
    product      = models.ForeignKey(Product, verbose_name="Product")
(...)


    def __unicode__(self):
        return str(self.featureId)

    class Meta:
        db_table = 'FeatureTable'

        verbose_name = "Feature"
        verbose_name_plural = "Features"
        unique_together = [("fId", "pf", "intC", "db", "product")]

Thanks,
Thiago

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

Reply via email to