Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 23
Project
Project
Details
Activity
Releases
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
Bianca Aguilar
widget_group 23
Commits
5ca21d38
Commit
5ca21d38
authored
Mar 16, 2022
by
Bianca Aguilar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited models.py so that the pub date could be automatically generated
parent
bbe4e819
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
db.sqlite3
db.sqlite3
+0
-0
models.cpython-310.pyc
forum/__pycache__/models.cpython-310.pyc
+0
-0
0003_alter_post_pub_date.py
forum/migrations/0003_alter_post_pub_date.py
+18
-0
0003_alter_post_pub_date.cpython-310.pyc
...ions/__pycache__/0003_alter_post_pub_date.cpython-310.pyc
+0
-0
models.py
forum/models.py
+1
-1
No files found.
db.sqlite3
View file @
5ca21d38
No preview for this file type
forum/__pycache__/models.cpython-310.pyc
View file @
5ca21d38
No preview for this file type
forum/migrations/0003_alter_post_pub_date.py
0 → 100644
View file @
5ca21d38
# Generated by Django 4.0.3 on 2022-03-16 05:15
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'forum'
,
'0002_alter_post_post_title_alter_post_pub_date'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'post'
,
name
=
'pub_date'
,
field
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'Date Published'
),
),
]
forum/migrations/__pycache__/0003_alter_post_pub_date.cpython-310.pyc
0 → 100644
View file @
5ca21d38
File added
forum/models.py
View file @
5ca21d38
...
@@ -4,7 +4,7 @@ from django.db import models
...
@@ -4,7 +4,7 @@ from django.db import models
class
Post
(
models
.
Model
):
class
Post
(
models
.
Model
):
post_title
=
models
.
CharField
(
max_length
=
50
)
post_title
=
models
.
CharField
(
max_length
=
50
)
post_body
=
models
.
CharField
(
max_length
=
500
)
post_body
=
models
.
CharField
(
max_length
=
500
)
pub_date
=
models
.
DateTimeField
(
"Date Published"
)
pub_date
=
models
.
DateTimeField
(
"Date Published"
,
auto_now
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
post_title
)
return
'{}'
.
format
(
self
.
post_title
)
\ No newline at end of file
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