Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
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
Ilham Maulana
library-app-django
Commits
80972dba
Commit
80972dba
authored
Jul 16, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add created_at and updated_at field to book loan model
parent
d4527ebf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
0003_bookloan_created_at_bookloan_updated_at.py
...igrations/0003_bookloan_created_at_bookloan_updated_at.py
+25
-0
models.py
loans/models.py
+2
-0
No files found.
loans/migrations/0003_bookloan_created_at_bookloan_updated_at.py
0 → 100644
View file @
80972dba
# Generated by Django 5.0.7 on 2024-07-16 05:53
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'loans'
,
'0002_alter_bookloan_loan_date'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'bookloan'
,
name
=
'created_at'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
datetime
.
datetime
(
2024
,
7
,
16
,
5
,
53
,
54
,
878346
,
tzinfo
=
datetime
.
timezone
.
utc
)),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'bookloan'
,
name
=
'updated_at'
,
field
=
models
.
DateTimeField
(
auto_now
=
True
),
),
]
loans/models.py
View file @
80972dba
...
...
@@ -11,3 +11,5 @@ class BookLoan(models.Model):
loan_date
=
models
.
DateTimeField
()
due_date
=
models
.
DateTimeField
()
return_date
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
updated_at
=
models
.
DateTimeField
(
auto_now
=
True
)
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