Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BeHub-web
Project
Project
Details
Activity
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
Dominik Rosiek
BeHub-web
Commits
b235eda7
Commit
b235eda7
authored
Nov 21, 2015
by
Rafal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add model, serializer
parent
eed14a6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
models.py
BeHub/Hub/models.py
+6
-5
serializers.py
BeHub/Hub/serializers.py
+9
-1
No files found.
BeHub/Hub/models.py
View file @
b235eda7
...
...
@@ -3,12 +3,13 @@ from django.db import models
# Create your models here.
class
Project
(
models
.
Model
):
link_url
=
models
.
CharField
(
max_length
=
2000
)
description
=
models
.
CharField
(
max_length
=
300
,
null
=
True
)
class
Beacon
(
models
.
Model
):
uuid
=
models
.
CharField
(
max_length
=
300
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
300
)
project
=
models
.
OneToOneField
(
Project
)
description
=
models
.
CharField
(
max_length
=
300
,
null
=
True
)
class
Project
(
models
.
Model
):
link_url
=
models
.
CharField
(
max_length
=
2000
)
project
=
models
.
OneToOneField
(
'Project'
)
description
=
models
.
CharField
(
max_length
=
300
,
null
=
True
)
BeHub/Hub/serializers.py
View file @
b235eda7
__author__
=
'Rafal'
from
rest_framework
import
serializers
from
models
import
Beacon
class
BeaconSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
model
=
Beacon
fields
=
(
'id'
,
'url'
,
'title'
,
'source_url'
,
'content'
,
'image'
,
'activities'
)
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