Commit 11bb4f25 authored by Daniel W Bond's avatar Daniel W Bond Committed by Mark Stenglein
Browse files

created and registered BidFlag object

parent e8136a25
# core django imports
from django.contrib import admin
# imports from your apps
from .models import Bid, Listing, Flag, Rating
from .models import Bid, Listing, Flag, BidFlag, Rating
@admin.register(Bid)
......@@ -22,4 +22,5 @@ class ListingAdmin(admin.ModelAdmin):
# expand this later
admin.site.register(Flag)
admin.site.register(BidFlag)
admin.site.register(Rating)
......@@ -163,14 +163,14 @@ class Flag(TimeStampedModel):
OBSCENE = 'Obscene'
SPAM = 'Spam'
COPYRIGHT = 'Copyright Violation'
ILLEGAL = 'Otherwise Illegal'
ILLEGAL = 'Otherwise Problematic'
FLAGGING_REASON_CHOICES = (
(WRONG_PRODUCT_TYPE, 'Not a Textbook'),
(OBSCENE, 'Obscene'),
(SPAM, 'Spam'),
(COPYRIGHT, 'Copyright Violation'),
(ILLEGAL, 'Otherwise Illegal'),
(ILLEGAL, 'Otherwise Problematic'),
)
flagger = models.ForeignKey(Student)
......@@ -189,6 +189,32 @@ class Flag(TimeStampedModel):
ordering = ['listing', 'created']
class BidFlag(TimeStampedModel):
OBSCENE = 'Obscene'
SPAM = 'Spam'
ILLEGAL = 'Otherwise Problematic'
FLAGGING_REASON_CHOICES = (
(OBSCENE, 'Obscene'),
(SPAM, 'Spam'),
(ILLEGAL, 'Otherwise Problematic'),
)
flagger = models.ForeignKey(Student)
bid = models.ForeignKey(Bid)
slug = RandomSlugField(length=6)
def __unicode__(self):
return "%s's %s for %s" % (self.flagger.user.username,
self.bid.listing.title,
self.reason)
class Meta:
ordering = ['bid', 'created']
class Rating(TimeStampedModel):
ONE_STAR = '1'
......
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