Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
KIF
AKPlanning
Commits
bfe14eca
Commit
bfe14eca
authored
5 years ago
by
Nadja Geisler
Browse files
Options
Downloads
Patches
Plain Diff
create and register AK models
create AK Types create AK Tracks create AK Tags create AK Requirements create AKs
parent
4b172473
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKModel/admin.py
+8
-1
8 additions, 1 deletion
AKModel/admin.py
AKModel/models.py
+89
-0
89 additions, 0 deletions
AKModel/models.py
with
97 additions
and
1 deletion
AKModel/admin.py
+
8
−
1
View file @
bfe14eca
...
...
@@ -2,7 +2,14 @@
from
django.contrib
import
admin
from
AKModel.models
import
Event
,
AKOwner
from
AKModel.models
import
Event
,
AKOwner
,
AKType
,
AKTrack
,
AKTag
,
AKRequirement
,
AK
admin
.
site
.
register
(
Event
)
admin
.
site
.
register
(
AKOwner
)
admin
.
site
.
register
(
AKType
)
admin
.
site
.
register
(
AKTrack
)
admin
.
site
.
register
(
AKTag
)
admin
.
site
.
register
(
AKRequirement
)
admin
.
site
.
register
(
AK
)
This diff is collapsed.
Click to expand it.
AKModel/models.py
+
89
−
0
View file @
bfe14eca
...
...
@@ -28,3 +28,92 @@ class AKOwner(models.Model):
verbose_name_plural
=
'
AK Owners
'
ordering
=
[
'
name
'
]
unique_together
=
[[
'
name
'
,
'
institution
'
]]
class
AKType
(
models
.
Model
):
"""
An AKType describes the characteristics of an AK, e.g. content vs. recreational.
"""
name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
'
Name
'
,
help_text
=
'
Name of the AK Type
'
)
color
=
models
.
CharField
(
max_length
=
7
,
blank
=
True
,
verbose_name
=
'
Color
'
,
help_text
=
'
Color to display this type in
'
)
# TODO model availability
class
Meta
:
verbose_name
=
'
AK Type
'
verbose_name_plural
=
'
AK Types
'
ordering
=
[
'
name
'
]
class
AKTrack
(
models
.
Model
):
"""
An AKTrack describes a set of semantically related AKs.
"""
name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
'
Name
'
,
help_text
=
'
Name of the AK Track
'
)
color
=
models
.
CharField
(
max_length
=
7
,
blank
=
True
,
verbose_name
=
'
Color
'
,
help_text
=
'
Color to display this track in
'
)
class
Meta
:
verbose_name
=
'
AK Track
'
verbose_name_plural
=
'
AK Tracks
'
ordering
=
[
'
name
'
]
class
AKTag
(
models
.
Model
):
"""
An AKTag is a keyword given to an AK by (one of) its owner(s).
"""
name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
'
Name
'
,
help_text
=
'
Name of the AK Tag
'
)
class
Meta
:
verbose_name
=
'
AK Tag
'
verbose_name_plural
=
'
AK Tags
'
ordering
=
[
'
name
'
]
class
AKRequirement
(
models
.
Model
):
"""
An AKRequirement describes something needed to hold an AK, e.g. infrastructure.
"""
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
'
Name
'
,
help_text
=
'
Name of the AK Requirement
'
)
event
=
models
.
ForeignKey
(
to
=
Event
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Event
'
,
help_text
=
'
Matching event
'
)
class
Meta
:
verbose_name
=
'
AK Requirement
'
verbose_name_plural
=
'
AK Requirements
'
ordering
=
[
'
name
'
]
class
AK
(
models
.
Model
):
"""
An AK is a slot-based activity to be scheduled during an event.
"""
name
=
models
.
CharField
(
max_length
=
256
,
unique
=
True
,
verbose_name
=
'
Name
'
,
help_text
=
'
Name of the AK
'
)
short_name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
blank
=
True
,
verbose_name
=
'
Short Name
'
,
help_text
=
'
Name displayed in schedule
'
)
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
'
Description
'
,
help_text
=
'
Description of the AK
'
)
owners
=
models
.
ManyToManyField
(
to
=
AKOwner
,
verbose_name
=
'
Owners
'
,
help_text
=
'
Those organizing the AK
'
)
# TODO generate automatically
link
=
models
.
URLField
(
blank
=
True
,
verbose_name
=
'
Web Link
'
,
help_text
=
'
Link to wiki page
'
)
type
=
models
.
ForeignKey
(
to
=
AKType
,
on_delete
=
models
.
PROTECT
,
verbose_name
=
'
Type
'
,
help_text
=
'
Type of the AK
'
)
tags
=
models
.
ManyToManyField
(
to
=
AKTag
,
blank
=
True
,
verbose_name
=
'
Tags
'
,
help_text
=
'
Tags provided by AK owners
'
)
track
=
models
.
ForeignKey
(
to
=
AKTrack
,
on_delete
=
models
.
SET_NULL
,
null
=
True
,
verbose_name
=
'
Track
'
,
help_text
=
'
Track the AK belongs to.
'
)
reso
=
models
.
BooleanField
(
verbose_name
=
'
Resolution Intention
'
,
default
=
False
,
help_text
=
'
Intends to submit a reso
'
)
requirements
=
models
.
ManyToManyField
(
to
=
AKRequirement
,
blank
=
True
,
verbose_name
=
'
Requirements
'
,
help_text
=
"
AK
'
s Requirements
"
)
conflicts
=
models
.
ManyToManyField
(
to
=
'
AK
'
,
blank
=
True
,
related_name
=
'
conflict
'
,
verbose_name
=
'
Conflicting AKs
'
,
help_text
=
'
AKs that conflict and thus must not take place at the same time
'
)
prerequisites
=
models
.
ManyToManyField
(
to
=
'
AK
'
,
blank
=
True
,
verbose_name
=
'
Prerequisite AKs
'
,
help_text
=
'
AKs that should precede this AK in the schedule
'
)
# TODO model availability
notes
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
'
Internal Notes
'
,
help_text
=
'
Notes to organizers
'
)
interest
=
models
.
IntegerField
(
default
=-
1
,
verbose_name
=
'
Interest
'
,
help_text
=
'
Expected number of people to attend
'
)
event
=
models
.
ForeignKey
(
to
=
Event
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Event
'
,
help_text
=
'
Matching event
'
)
class
Meta
:
verbose_name
=
'
AK
'
verbose_name_plural
=
'
AKs
'
This diff is collapsed.
Click to expand it.
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