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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
bdc40ff3
Verified
Commit
bdc40ff3
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use auto_now_add for created_at field
parent
cb08794d
No related branches found
No related tags found
1 merge request
!137
Generalise notifications and implement SMS notifications
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/models.py
+2
-3
2 additions, 3 deletions
aleksis/core/models.py
with
2 additions
and
3 deletions
aleksis/core/models.py
+
2
−
3
View file @
bdc40ff3
...
...
@@ -3,7 +3,6 @@ from typing import Optional
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth.models
import
User
from
django.db
import
models
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
from
image_cropping
import
ImageCropField
,
ImageRatioField
from
phonenumber_field.modelfields
import
PhoneNumberField
...
...
@@ -195,7 +194,7 @@ class Activity(models.Model):
app
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
"
Application
"
))
created_at
=
models
.
DateTimeField
(
default
=
timezone
.
now
,
verbose_name
=
_
(
"
Created at
"
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
"
Created at
"
))
def
__str__
(
self
):
return
self
.
title
...
...
@@ -216,7 +215,7 @@ class Notification(models.Model):
read
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
"
Read
"
))
sent
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
"
Sent
"
))
created_at
=
models
.
DateTimeField
(
default
=
timezone
.
now
,
verbose_name
=
_
(
"
Created at
"
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
"
Created at
"
))
def
__str__
(
self
):
return
self
.
title
...
...
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