Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
kszkepzes
old
kszkepzes-backend
Commits
d6fdc0e7
Commit
d6fdc0e7
authored
6 years ago
by
Barnabás Czémán
Browse files
Options
Downloads
Patches
Plain Diff
Modify homework models & fix some settings
parent
5aac9233
No related branches found
No related tags found
No related merge requests found
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/homework/serializers.py
+5
-4
5 additions, 4 deletions
src/homework/serializers.py
src/kszkepzes/settings/base.py
+3
-0
3 additions, 0 deletions
src/kszkepzes/settings/base.py
src/kszkepzes/urls.py
+5
-1
5 additions, 1 deletion
src/kszkepzes/urls.py
with
13 additions
and
5 deletions
src/homework/serializers.py
+
5
−
4
View file @
d6fdc0e7
...
@@ -10,18 +10,19 @@ class TaskSerializer(serializers.ModelSerializer):
...
@@ -10,18 +10,19 @@ class TaskSerializer(serializers.ModelSerializer):
class
Meta
:
class
Meta
:
model
=
models
.
Task
model
=
models
.
Task
read_only_fields
=
(
'
created_by
'
,
'
date
'
)
read_only_fields
=
(
'
created_by
'
,
'
created_at
'
,
'
updated_at
'
)
fields
=
'
__all__
'
fields
=
'
__all__
'
class
SolutionSerializer
(
serializers
.
ModelSerializer
):
class
SolutionSerializer
(
serializers
.
ModelSerializer
):
date
=
serializers
.
DateTimeField
(
read_only
=
True
)
created_at
=
serializers
.
DateTimeField
(
read_only
=
True
)
updated_at
=
serializers
.
DateTimeField
(
read_only
=
True
)
created_by
=
serializers
.
HiddenField
(
default
=
CurrentUserProfileDefault
())
created_by
=
serializers
.
HiddenField
(
default
=
CurrentUserProfileDefault
())
class
Meta
:
class
Meta
:
model
=
models
.
Solution
model
=
models
.
Solution
read_only_fields
=
(
'
created_by
'
,
'
date
'
'
ready
'
)
read_only_fields
=
(
'
created_by
'
,
'
created_at
'
,
'
updated_at
'
,
'
ready
'
)
fields
=
(
'
task
'
,
'
date
'
,
'
accepted
'
,
'
files
'
,
'
created_by
'
)
fields
=
(
'
task
'
,
'
created_at
'
,
'
updated_at
'
,
'
accepted
'
,
'
files
'
,
'
created_by
'
)
def
validate
(
self
,
data
):
def
validate
(
self
,
data
):
if
timezone
.
now
()
>
data
[
'
task
'
].
deadline
:
if
timezone
.
now
()
>
data
[
'
task
'
].
deadline
:
...
...
This diff is collapsed.
Click to expand it.
src/kszkepzes/settings/base.py
+
3
−
0
View file @
d6fdc0e7
...
@@ -153,3 +153,6 @@ USE_TZ = True
...
@@ -153,3 +153,6 @@ USE_TZ = True
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL
=
'
/django-static/
'
STATIC_URL
=
'
/django-static/
'
MEDIA_ROOT
=
os
.
getenv
(
'
MEDIA_ROOT
'
,
'
/tmp
'
)
MEDIA_URL
=
'
/media/
'
This diff is collapsed.
Click to expand it.
src/kszkepzes/urls.py
+
5
−
1
View file @
d6fdc0e7
from
django.conf.urls
import
url
,
include
from
django.conf.urls
import
url
,
include
from
django.conf.urls.static
import
static
from
django.conf
import
settings
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.contrib.auth
import
views
as
auth_views
from
django.contrib.auth
import
views
as
auth_views
...
@@ -9,6 +11,8 @@ urlpatterns = [
...
@@ -9,6 +11,8 @@ urlpatterns = [
url
(
r
'
^api/v1/
'
,
include
(
'
stats.urls
'
)),
url
(
r
'
^api/v1/
'
,
include
(
'
stats.urls
'
)),
url
(
r
'
^api/v1/
'
,
include
(
'
account.urls
'
)),
url
(
r
'
^api/v1/
'
,
include
(
'
account.urls
'
)),
url
(
r
'
^api/v1/
'
,
include
(
'
news.urls
'
)),
url
(
r
'
^api/v1/
'
,
include
(
'
news.urls
'
)),
url
(
r
'
^api/v1/logout/$
'
,
auth_views
.
LogoutView
.
as_view
(),
name
=
'
logout
'
),
url
(
r
'
^api/v1/logout/$
'
,
auth_views
.
LogoutView
.
as_view
(),
name
=
'
logout
'
),
]
]
if
settings
.
DEBUG
:
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment