Changes between Initial Version and Version 1 of Ticket #10544


Ignore:
Timestamp:
03/19/2009 03:53:55 AM (10 years ago)
Author:
Malcolm Tredinnick
Comment:

This looks like a problem in your code, rather than Django. Please post some details to the mailing list to get help with this.

I'll note that the error is reporting a problem about the Publisher model, which is not going to be used by AuthorForm at all. So you should start out by checking you are debugging the right problem.

(fixed description)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10544

    • Property Status changed from new to closed
    • Property Resolution changed from to invalid
  • Ticket #10544 – Description

    initial v1  
     1{{{
     2#!python
    13#models.py
    24
    35class Publisher(models.Model):
    4 
    56    name = models.CharField(max_length=30)
    6 
    77    address = models.CharField(max_length=50)
    8 
    98    city = models.CharField(max_length=60)
    10 
    119    state_province = models.CharField(max_length=30)
    12 
    1310    country = models.CharField(max_length=50)
    14 
    1511    website = models.URLField()
    1612
    1713    def __unicode__(self):
    18 
    1914        return self.name
    2015
    2116    class Meta:
    22 
    2317        ordering = ["name"]
    2418
    25 
    2619class Author(models.Model):
    27 
    2820    first_name = models.CharField(max_length=30)
    29 
    3021    last_name = models.CharField(max_length=40)
    31 
    3222    email = models.EmailField(blank=True, verbose_name='e-mail')
    33 
    3423    objects = models.Manager()
    35 
    3624    sel_objects=AuthorManager()
    3725   
    3826    def __unicode__(self):
    39 
    4027        return self.first_name+' '+ self.last_name
    4128
    42 
    4329class Book(models.Model):
    44 
    4530    title = models.CharField(max_length=100)
    46 
    4731    authors = models.ManyToManyField(Author)
    48 
    4932    publisher = models.ForeignKey(Publisher)
    50 
    5133    publication_date = models.DateField(blank=True, null=True)
    52 
    5334    num_pages = models.IntegerField(blank=True, null=True)
    54 
    5535    objects = models.Manager()
    56 
    5736    bookobjects = BookManager()
    58 
    5937    wong = WongAuthor()
    6038
    61 
    6239class BookForm(ModelForm):
    63 
    6440    class Meta:
    65 
    6641        model = Book
    67 
    6842
    6943#view.py
     
    7953        form = AuthorForm(instance=a)
    8054    return render_to_response('author_form.html', {'form': form})
     55}}}
    8156
    82 
    83 # error
    84 
    85 
     57Produces this error
     58{{{
    8659Page not found (404)
    8760Request Method:         POST
     
    9164
    9265You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
     66}}}
Back to Top