Commit b677357a authored by Daniel W Bond's avatar Daniel W Bond

housekeeping and comments

parent cdaeda1e
......@@ -40,6 +40,8 @@ class Listing(TimeStampedModel):
(AC_NOT_INCLUDED, 'Access Code NOT Included'),
)
# django automatically creates an index for all ForeignKey fields
# e.g. no need for 'db_index = True' on relational fields
poster = models.ForeignKey(Student)
title = models.CharField(max_length=200)
......@@ -68,6 +70,7 @@ class Listing(TimeStampedModel):
default='listing_photos/default_listing_photo.jpg')
# these remaining fields are for internal usage, not for users
# possibly should be indexed-- used commonly on .exclude() or .filter()
exchanged = models.BooleanField(default=False)
cancelled = models.BooleanField(default=False)
......
......@@ -21,7 +21,7 @@ urlpatterns = patterns('',
url(r'^listing/(?P<slug>[\w-]+)/delete/$',
DeleteListing.as_view(), name='delete_listing'),
url(r'^listing/(?P<listing_slug>[\w-]+)/bid/(?P<slug>[\w-]+)/$',
url(r'^listing/(?P<listing_slug>[\w-]+)/bid/(?P<slug>[\w-]+)/edit/$',
EditBid.as_view(), name='edit_bid'),
url(r'^listing/(?P<slug>[\w-]+)/flag/$',
......
......@@ -315,8 +315,6 @@ class EditBid(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
fields = ['price', 'text', ]
success_url = '/'
def get_success_url(self):
return reverse('detail_listing',
kwargs={'slug': self.object.listing.slug})
......@@ -349,7 +347,6 @@ class EditListing(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
fields = ['title', 'author', 'isbn', 'year', 'edition', 'condition',
'access_code', 'description', 'price', 'photo', ]
template_suffix_name = '_edit'
def get_context_data(self, **kwargs):
context = super(EditListing, self).get_context_data(**kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment