Model Servicios, registro app en admin.py

This commit is contained in:
jp.av.dev 2020-11-20 14:04:12 -03:00
parent 39f632feb1
commit 2d6b559e30
15 changed files with 174 additions and 0 deletions

View File

View File

@ -0,0 +1,11 @@
from django.contrib import admin
from .models import Servicio
# Register your models here.
class ServicioAdmin(admin.ModelAdmin):
readonly_fields = ('created','updated')
admin.site.register(Servicio, ServicioAdmin)

View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ServiciosConfig(AppConfig):
name = 'servicios'

View File

@ -0,0 +1,29 @@
# Generated by Django 3.1.3 on 2020-11-19 02:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Servicio',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('titulo', models.CharField(max_length=50)),
('contenido', models.CharField(max_length=50)),
('imagen', models.ImageField(upload_to='')),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now_add=True)),
],
options={
'verbose_name': 'servicio',
'verbose_name_plural': 'servicios',
},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 02:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'servicio', 'verbose_name_plural': 's'},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 02:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0002_auto_20201118_2354'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'servicio'},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 03:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0003_auto_20201118_2357'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'app_service'},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 03:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0004_auto_20201119_0000'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'service', 'verbose_name_plural': 'services'},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 06:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0005_auto_20201119_0010'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'servic', 'verbose_name_plural': 'services'},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 3.1.3 on 2020-11-19 06:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servicios', '0006_auto_20201119_0323'),
]
operations = [
migrations.AlterModelOptions(
name='servicio',
options={'verbose_name': 'service', 'verbose_name_plural': 'services'},
),
]

View File

@ -0,0 +1,21 @@
from django.db import models
# Create your models here.
class Servicio(models.Model):
titulo = models.CharField( max_length = 50 )
contenido = models.CharField( max_length = 50 )
imagen = models.ImageField()
created = models.DateTimeField( auto_now_add = True)
updated = models.DateTimeField( auto_now_add = True)
class Meta:
verbose_name = 'servicio'
verbose_name_plural = 'servicios'
def __str_(self):
return self.titulo

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB