Skip to content

Commit

Permalink
Cria app de pessoas
Browse files Browse the repository at this point in the history
  • Loading branch information
brnocesar committed Nov 8, 2020
1 parent cb855da commit d502182
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 0 deletions.
Empty file added apps/pessoas/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions apps/pessoas/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.contrib import admin
from .models import Pessoa

class IndexPessoa(admin.ModelAdmin):
list_display = ('id', 'nome', 'email')
list_display_links = ('id', 'nome')
search_fields = ('nome',)
list_per_page = 10

admin.site.register(Pessoa, IndexPessoa)
5 changes: 5 additions & 0 deletions apps/pessoas/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class PessoasConfig(AppConfig):
name = 'pessoas'
22 changes: 22 additions & 0 deletions apps/pessoas/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.1.3 on 2020-11-08 00:32

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Pessoa',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nome', models.CharField(max_length=200)),
('email', models.CharField(max_length=200)),
],
),
]
Empty file.
5 changes: 5 additions & 0 deletions apps/pessoas/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.db import models

class Pessoa(models.Model):
nome = models.CharField(max_length=200)
email = models.CharField(max_length=200)
3 changes: 3 additions & 0 deletions apps/pessoas/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions apps/pessoas/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
1 change: 1 addition & 0 deletions djangoreceitas/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'apps.receitas',
'apps.pessoas',
]

MIDDLEWARE = [
Expand Down

0 comments on commit d502182

Please sign in to comment.