models.py
python_backend/curriculum/django/blog/models.py
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
Artigos relacionados
apps.py
apps.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/apps.py).
Ler artigo →0001_initial.py
0001_initial.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/migrations/0001_initial.py).
Ler artigo →urls.py
urls.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/urls.py).
Ler artigo →views.py
views.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/views.py).
Ler artigo →manage.py
manage.py — python source code from the python backend learning materials (python_backend/curriculum/django/manage.py).
Ler artigo →asgi.py
asgi.py — python source code from the python backend learning materials (python_backend/curriculum/django/myproject/asgi.py).
Ler artigo →