Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Academe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nathan Kibanoff
Academe
Commits
2f2f54e4
Commit
2f2f54e4
authored
Nov 16, 2017
by
Gab De Jesus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved course model from reviews to prof.models
parent
7147e9cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
models.py
profs/models.py
+8
-1
admin.py
reviews/admin.py
+1
-2
models.py
reviews/models.py
+1
-6
No files found.
profs/models.py
View file @
2f2f54e4
...
@@ -6,4 +6,11 @@ class Prof(models.Model):
...
@@ -6,4 +6,11 @@ class Prof(models.Model):
last_name
=
models
.
CharField
(
max_length
=
20
,
unique
=
False
)
last_name
=
models
.
CharField
(
max_length
=
20
,
unique
=
False
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
first_name
+
self
.
last_name
return
self
.
first_name
+
" "
+
self
.
last_name
\ No newline at end of file
class
Course
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
prof
=
models
.
ManyToManyField
(
Prof
)
def
__str__
(
self
):
return
self
.
name
+
" "
+
self
.
prof
reviews/admin.py
View file @
2f2f54e4
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
.models
import
Course
,
Review
from
.models
import
Review
admin
.
site
.
register
(
Course
)
admin
.
site
.
register
(
Review
)
admin
.
site
.
register
(
Review
)
\ No newline at end of file
reviews/models.py
View file @
2f2f54e4
...
@@ -6,11 +6,6 @@ from django.contrib.auth.models import User
...
@@ -6,11 +6,6 @@ from django.contrib.auth.models import User
from
profs.models
import
Prof
from
profs.models
import
Prof
# Create your models here.
# Create your models here.
class
Course
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
15
,
unique
=
True
)
description
=
models
.
CharField
(
max_length
=
100
)
class
Review
(
models
.
Model
):
class
Review
(
models
.
Model
):
message
=
models
.
TextField
(
max_length
=
4000
)
message
=
models
.
TextField
(
max_length
=
4000
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
...
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