Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
ba30cdb6
Verified
Commit
ba30cdb6
authored
Apr 27, 2020
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Install django-reversion and register models
parent
19ec3de7
No related branches found
No related tags found
No related merge requests found
Pipeline
#1744
failed
Apr 27, 2020
Stage: test
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/core/models.py
+19
-0
19 additions, 0 deletions
aleksis/core/models.py
aleksis/core/settings.py
+1
-0
1 addition, 0 deletions
aleksis/core/settings.py
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
with
21 additions
and
0 deletions
aleksis/core/models.py
+
19
−
0
View file @
ba30cdb6
...
@@ -14,6 +14,7 @@ from django.utils.translation import gettext_lazy as _
...
@@ -14,6 +14,7 @@ from django.utils.translation import gettext_lazy as _
from
image_cropping
import
ImageCropField
,
ImageRatioField
from
image_cropping
import
ImageCropField
,
ImageRatioField
from
phonenumber_field.modelfields
import
PhoneNumberField
from
phonenumber_field.modelfields
import
PhoneNumberField
from
polymorphic.models
import
PolymorphicModel
from
polymorphic.models
import
PolymorphicModel
import
reversion
from
.mixins
import
ExtensibleModel
,
PureDjangoModel
from
.mixins
import
ExtensibleModel
,
PureDjangoModel
from
.tasks
import
send_notification
from
.tasks
import
send_notification
...
@@ -23,6 +24,7 @@ from .util.model_helpers import ICONS
...
@@ -23,6 +24,7 @@ from .util.model_helpers import ICONS
from
constance
import
config
from
constance
import
config
@reversion.register
()
class
School
(
ExtensibleModel
):
class
School
(
ExtensibleModel
):
"""
A school that will have many other objects linked to it.
"""
A school that will have many other objects linked to it.
AlekSIS has multi-tenant support by linking all objects to a school,
AlekSIS has multi-tenant support by linking all objects to a school,
...
@@ -54,6 +56,7 @@ class School(ExtensibleModel):
...
@@ -54,6 +56,7 @@ class School(ExtensibleModel):
verbose_name_plural
=
_
(
"
Schools
"
)
verbose_name_plural
=
_
(
"
Schools
"
)
@reversion.register
()
class
SchoolTerm
(
ExtensibleModel
):
class
SchoolTerm
(
ExtensibleModel
):
"""
Information about a term (limited time frame) that data can
"""
Information about a term (limited time frame) that data can
be linked to.
be linked to.
...
@@ -86,6 +89,7 @@ class SchoolTerm(ExtensibleModel):
...
@@ -86,6 +89,7 @@ class SchoolTerm(ExtensibleModel):
verbose_name_plural
=
_
(
"
School terms
"
)
verbose_name_plural
=
_
(
"
School terms
"
)
@reversion.register
()
class
Person
(
ExtensibleModel
):
class
Person
(
ExtensibleModel
):
"""
A model describing any person related to a school, including, but not
"""
A model describing any person related to a school, including, but not
limited to, students, teachers and guardians (parents).
limited to, students, teachers and guardians (parents).
...
@@ -246,6 +250,7 @@ class Person(ExtensibleModel):
...
@@ -246,6 +250,7 @@ class Person(ExtensibleModel):
self
.
primary_group
=
self
.
member_of
.
filter
(
name__regex
=
pattern
).
first
()
self
.
primary_group
=
self
.
member_of
.
filter
(
name__regex
=
pattern
).
first
()
@reversion.register
()
class
Group
(
ExtensibleModel
):
class
Group
(
ExtensibleModel
):
"""
Any kind of group of persons in a school, including, but not limited
"""
Any kind of group of persons in a school, including, but not limited
classes, clubs, and the like.
classes, clubs, and the like.
...
@@ -303,6 +308,7 @@ class Group(ExtensibleModel):
...
@@ -303,6 +308,7 @@ class Group(ExtensibleModel):
dj_group
.
save
()
dj_group
.
save
()
@reversion.register
()
class
Activity
(
ExtensibleModel
):
class
Activity
(
ExtensibleModel
):
user
=
models
.
ForeignKey
(
"
Person
"
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
activities
"
)
user
=
models
.
ForeignKey
(
"
Person
"
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
activities
"
)
...
@@ -319,6 +325,7 @@ class Activity(ExtensibleModel):
...
@@ -319,6 +325,7 @@ class Activity(ExtensibleModel):
verbose_name_plural
=
_
(
"
Activities
"
)
verbose_name_plural
=
_
(
"
Activities
"
)
@reversion.register
()
class
Notification
(
ExtensibleModel
):
class
Notification
(
ExtensibleModel
):
sender
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
"
Sender
"
))
sender
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
"
Sender
"
))
recipient
=
models
.
ForeignKey
(
"
Person
"
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
notifications
"
)
recipient
=
models
.
ForeignKey
(
"
Person
"
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
notifications
"
)
...
@@ -398,7 +405,12 @@ class AnnouncementQuerySet(models.QuerySet):
...
@@ -398,7 +405,12 @@ class AnnouncementQuerySet(models.QuerySet):
return
announcements_for_person
return
announcements_for_person
class
Meta
:
verbose_name
=
_
(
"
Announcement Queryset
"
)
verbose_name_plural
=
_
(
"
Announcements Querysets
"
)
@reversion.register
()
class
Announcement
(
ExtensibleModel
):
class
Announcement
(
ExtensibleModel
):
objects
=
models
.
Manager
.
from_queryset
(
AnnouncementQuerySet
)()
objects
=
models
.
Manager
.
from_queryset
(
AnnouncementQuerySet
)()
...
@@ -437,6 +449,7 @@ class Announcement(ExtensibleModel):
...
@@ -437,6 +449,7 @@ class Announcement(ExtensibleModel):
verbose_name_plural
=
_
(
"
Announcements
"
)
verbose_name_plural
=
_
(
"
Announcements
"
)
@reversion.register
()
class
AnnouncementRecipient
(
ExtensibleModel
):
class
AnnouncementRecipient
(
ExtensibleModel
):
announcement
=
models
.
ForeignKey
(
Announcement
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
recipients
"
)
announcement
=
models
.
ForeignKey
(
Announcement
,
on_delete
=
models
.
CASCADE
,
related_name
=
"
recipients
"
)
...
@@ -465,6 +478,7 @@ class AnnouncementRecipient(ExtensibleModel):
...
@@ -465,6 +478,7 @@ class AnnouncementRecipient(ExtensibleModel):
verbose_name_plural
=
_
(
"
Announcement recipients
"
)
verbose_name_plural
=
_
(
"
Announcement recipients
"
)
@reversion.register
()
class
DashboardWidget
(
PolymorphicModel
,
PureDjangoModel
):
class
DashboardWidget
(
PolymorphicModel
,
PureDjangoModel
):
"""
Base class for dashboard widgets on the index page
"""
Base class for dashboard widgets on the index page
...
@@ -529,6 +543,7 @@ class DashboardWidget(PolymorphicModel, PureDjangoModel):
...
@@ -529,6 +543,7 @@ class DashboardWidget(PolymorphicModel, PureDjangoModel):
verbose_name_plural
=
_
(
"
Dashboard Widgets
"
)
verbose_name_plural
=
_
(
"
Dashboard Widgets
"
)
@reversion.register
()
class
CustomMenu
(
ExtensibleModel
):
class
CustomMenu
(
ExtensibleModel
):
id
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
"
Menu ID
"
),
primary_key
=
True
)
id
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
"
Menu ID
"
),
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
150
,
verbose_name
=
_
(
"
Menu name
"
))
name
=
models
.
CharField
(
max_length
=
150
,
verbose_name
=
_
(
"
Menu name
"
))
...
@@ -552,6 +567,7 @@ class CustomMenu(ExtensibleModel):
...
@@ -552,6 +567,7 @@ class CustomMenu(ExtensibleModel):
verbose_name_plural
=
_
(
"
Custom menus
"
)
verbose_name_plural
=
_
(
"
Custom menus
"
)
@reversion.register
()
class
CustomMenuItem
(
ExtensibleModel
):
class
CustomMenuItem
(
ExtensibleModel
):
menu
=
models
.
ForeignKey
(
menu
=
models
.
ForeignKey
(
CustomMenu
,
models
.
CASCADE
,
verbose_name
=
_
(
"
Menu
"
),
related_name
=
"
items
"
CustomMenu
,
models
.
CASCADE
,
verbose_name
=
_
(
"
Menu
"
),
related_name
=
"
items
"
...
@@ -569,6 +585,8 @@ class CustomMenuItem(ExtensibleModel):
...
@@ -569,6 +585,8 @@ class CustomMenuItem(ExtensibleModel):
verbose_name
=
_
(
"
Custom menu item
"
)
verbose_name
=
_
(
"
Custom menu item
"
)
verbose_name_plural
=
_
(
"
Custom menu items
"
)
verbose_name_plural
=
_
(
"
Custom menu items
"
)
@reversion.register
()
class
GroupType
(
ExtensibleModel
):
class
GroupType
(
ExtensibleModel
):
name
=
models
.
CharField
(
verbose_name
=
_
(
"
Title of type
"
),
max_length
=
50
)
name
=
models
.
CharField
(
verbose_name
=
_
(
"
Title of type
"
),
max_length
=
50
)
description
=
models
.
CharField
(
verbose_name
=
_
(
"
Description
"
),
max_length
=
500
)
description
=
models
.
CharField
(
verbose_name
=
_
(
"
Description
"
),
max_length
=
500
)
...
@@ -578,6 +596,7 @@ class GroupType(ExtensibleModel):
...
@@ -578,6 +596,7 @@ class GroupType(ExtensibleModel):
verbose_name_plural
=
_
(
"
Group types
"
)
verbose_name_plural
=
_
(
"
Group types
"
)
@reversion.register
()
class
GlobalPermissions
(
ExtensibleModel
):
class
GlobalPermissions
(
ExtensibleModel
):
class
Meta
:
class
Meta
:
managed
=
False
managed
=
False
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/settings.py
+
1
−
0
View file @
ba30cdb6
...
@@ -75,6 +75,7 @@ INSTALLED_APPS = [
...
@@ -75,6 +75,7 @@ INSTALLED_APPS = [
"
image_cropping
"
,
"
image_cropping
"
,
"
maintenance_mode
"
,
"
maintenance_mode
"
,
"
menu_generator
"
,
"
menu_generator
"
,
"
reversion
"
,
"
phonenumber_field
"
,
"
phonenumber_field
"
,
"
debug_toolbar
"
,
"
debug_toolbar
"
,
"
django_select2
"
,
"
django_select2
"
,
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
ba30cdb6
...
@@ -75,6 +75,7 @@ celery-haystack = {version="^0.3.1", optional=true}
...
@@ -75,6 +75,7 @@ celery-haystack = {version="^0.3.1", optional=true}
django-dbbackup
=
"^3.3.0"
django-dbbackup
=
"^3.3.0"
spdx-license-list
=
"^0.4.0"
spdx-license-list
=
"^0.4.0"
license-expression
=
"^1.2"
license-expression
=
"^1.2"
django-reversion
=
"^3.0.7"
[
tool.poetry.extras
]
[
tool.poetry.extras
]
ldap
=
[
"django-auth-ldap"
]
ldap
=
[
"django-auth-ldap"
]
...
...
This diff is collapsed.
Click to expand it.
Tom Teichler
@debdolph
mentioned in commit
af849a7e
·
Apr 27, 2020
mentioned in commit
af849a7e
mentioned in commit af849a7e01ace2a9adc19f007e95036540ad3099
Toggle commit list
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