Hello, first of all big "Thank You" to Django developers!

Sorry for connecting to this thread, but I seem to have a similar problem ?

My model is as follows:

// model start
from django.core import meta

class Customer(meta.Model):
  name = meta.CharField(maxlength=20, blank=False)
  last = meta.CharField(maxlength=30, blank=False)
  addres = meta.TextField(blank=False)
  email = meta.EmailField(blank=False)
  pn = meta.CharField(maxlength=20, blank=False)
  date_connected = meta.DateField()
  payment = meta.IntegerField(blank=False, maxlength=3)
  company_name = meta.CharField(maxlength=30, blank=False)
  np = meta.CharField(maxlength=20, unique=True, blank=False)
  note = meta.TextField()

  def __repr__(self):
    return self.name

  class META:
    admin = meta.Admin()


class Pause(meta.Model):
  cust = meta.ForeignKey(Customer)
  when_stared = meta.DateField()
  when_ended = meta.DateField()

  def __repr__(self):
          return self.cust

  class META:
    admin = meta.Admin()
// model end

I'm getting errors when adding a new Pause record. (using sqlite3 as db backend)

Error on web page (and runserver output is ending with:
"TemplateSyntaxError: Caught an exception while rendering.")

Am I doing something wrong ?

Thanks,

Robert

On 2/11/06, Andu <[EMAIL PROTECTED]> wrote:
>
> Removing to_field makes it work ok. I will investigate it more and file
> a ticket if appropiate.
> I also solved the template exception by making TEMPLATE_DEBUG=False. It
> came up that the error was the fact that __repr__ returned an int, not
> a string.
>
> Andu
>
>


--
Robert

Reply via email to