Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robert
Commoning Engine
Commits
e9679b74
Commit
e9679b74
authored
Jun 14, 2020
by
Robert
Browse files
Add basic activities
parent
70a5f9bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
commoning/admin.py
View file @
e9679b74
from
django.contrib
import
admin
from
commoning.models
import
Need
from
commoning.models
import
Activity
,
Need
admin
.
site
.
register
(
Activity
)
admin
.
site
.
register
(
Need
)
commoning/migrations/0003_activity.py
0 → 100644
View file @
e9679b74
# Generated by Django 2.2.13 on 2020-06-14 17:12
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'commoning'
,
'0002_auto_20200614_1520'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Activity'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'creation_time'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'activity_pattern_url'
,
models
.
URLField
()),
(
'need'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'commoning.Need'
)),
],
),
]
commoning/models.py
View file @
e9679b74
from
django.db
import
models
class
Activity
(
models
.
Model
):
creation_time
=
models
.
DateTimeField
(
auto_now_add
=
True
)
activity_pattern_url
=
models
.
URLField
()
need
=
models
.
OneToOneField
(
'commoning.Need'
,
on_delete
=
models
.
CASCADE
)
class
Need
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
200
)
description
=
models
.
TextField
()
...
...
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