Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
11bb4f25
Commit
11bb4f25
authored
Aug 24, 2015
by
Daniel W Bond
Committed by
Mark Stenglein
Apr 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created and registered BidFlag object
parent
e8136a25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
bookshare/trades/admin.py
bookshare/trades/admin.py
+2
-1
bookshare/trades/models.py
bookshare/trades/models.py
+28
-2
No files found.
bookshare/trades/admin.py
View file @
11bb4f25
# 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
)
bookshare/trades/models.py
View file @
11bb4f25
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment