Changes between Initial Version and Version 1 of Ticket #10544
- Timestamp:
- Mar 19, 2009, 3:53:55 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10544
- Property Resolution → invalid
- Property Status new → closed
-
Ticket #10544 – Description
initial v1 1 {{{ 2 #!python 1 3 #models.py 2 4 3 5 class Publisher(models.Model): 4 5 6 name = models.CharField(max_length=30) 6 7 7 address = models.CharField(max_length=50) 8 9 8 city = models.CharField(max_length=60) 10 11 9 state_province = models.CharField(max_length=30) 12 13 10 country = models.CharField(max_length=50) 14 15 11 website = models.URLField() 16 12 17 13 def __unicode__(self): 18 19 14 return self.name 20 15 21 16 class Meta: 22 23 17 ordering = ["name"] 24 18 25 26 19 class Author(models.Model): 27 28 20 first_name = models.CharField(max_length=30) 29 30 21 last_name = models.CharField(max_length=40) 31 32 22 email = models.EmailField(blank=True, verbose_name='e-mail') 33 34 23 objects = models.Manager() 35 36 24 sel_objects=AuthorManager() 37 25 38 26 def __unicode__(self): 39 40 27 return self.first_name+' '+ self.last_name 41 28 42 43 29 class Book(models.Model): 44 45 30 title = models.CharField(max_length=100) 46 47 31 authors = models.ManyToManyField(Author) 48 49 32 publisher = models.ForeignKey(Publisher) 50 51 33 publication_date = models.DateField(blank=True, null=True) 52 53 34 num_pages = models.IntegerField(blank=True, null=True) 54 55 35 objects = models.Manager() 56 57 36 bookobjects = BookManager() 58 59 37 wong = WongAuthor() 60 38 61 62 39 class BookForm(ModelForm): 63 64 40 class Meta: 65 66 41 model = Book 67 68 42 69 43 #view.py … … 79 53 form = AuthorForm(instance=a) 80 54 return render_to_response('author_form.html', {'form': form}) 55 }}} 81 56 82 83 # error 84 85 57 Produces this error 58 {{{ 86 59 Page not found (404) 87 60 Request Method: POST … … 91 64 92 65 You'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 }}}