I get a TypeError at Post from the admin interface and I suspect this
is connected to my key definition, but couldn't find documentation on
this.

Any ideas?

Error message:
TypeError at /admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
coercing to Unicode: need string or buffer, VraagComponentModel found
Request Method: POST
Request URL:    
http://127.0.0.1:8000/admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
Exception Type: TypeError
Exception Value:        coercing to Unicode: need string or buffer,
VraagComponentModel found

Variables:

Variable        Value
componentAfstand1       u'1'
_save   u'Opslaan'
componentAfstand3       u'2'
componentAfstand2       u'1'
componentModel  u'1'
componentInhoud1        u'a'
componentInhoud2        u'b'
componentInhoud3        u'c'
componentInhoud4        u'd'

Definition:
class VraagComponentModel(models.Model):
        naamKlant = models.ForeignKey(Klant, verbose_name = 'Firmanaam
van de klant')
        componentGroepNummer = models.IntegerField(verbose_name =
'Nummer van componentgroep')
        componentGroepOmschrijving = models.CharField(max_length=30,
verbose_name = 'Omschrijving van componentgroep' )
        componentTypeNummer = models.IntegerField(verbose_name =
'Nummer van componenttype')             # Componenten met nummer 0 gelden voor
hele klant; 1 t/m n zijn zoekopdrachten
        componentTypeOmschrijving = models.CharField(max_length=30,
verbose_name = 'Omschrijving van componenttype' )
        componentInsluiting = models.BooleanField(default = 'True',
verbose_name = 'Uitsluiten')    # insluiten (T) of uitsluiten (F) van
deze component

        def __unicode__(self):
                return u'%s %s %s %s %s' % (self.naamKlant,
self.componentGroepNummer, self.componentGroepOmschrijving,
self.componentTypeNummer, self.componentTypeOmschrijving)

        class Meta:
                ordering =
['naamKlant','componentGroepNummer','componentTypeNummer']
                unique_together = ("naamKlant",
"componentGroepNummer","componentTypeNummer")
                verbose_name_plural = "vraagcomponentenmodel"

class VraagComponentInhoud(models.Model):
        componentModel = models.ForeignKey(VraagComponentModel)
        componentInhoud1 = models.TextField(verbose_name = 'Eerste
onderdeel')
        componentAfstand1 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 1e en 2e onderdeel')
        componentInhoud2 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Tweede onderdeel')
        componentAfstand2 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 2e en 3e onderdeel')
        componentInhoud3 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Derde onderdeel')
        componentAfstand3 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 3e en 4e onderdeel')
        componentInhoud4 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Vierde onderdeel')

        def __unicode__(self):
                return self.componentModel

        class Meta:
                verbose_name_plural = "vraagcomponenteninhoud"


In SQLite:
sqlite> .indices LeadDeviceSysteem_vraagcomponentmodel
LeadDeviceSysteem_vraagcomponentmodel_naamKlant_id
sqlite_autoindex_LeadDeviceSysteem_vraagcomponentmodel_1

Regards,
Bob

-- 
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