Model Servicios, registro app en admin.py
This commit is contained in:
parent
39f632feb1
commit
2d6b559e30
0
ProyectoWeb/servicios/__init__.py
Normal file
0
ProyectoWeb/servicios/__init__.py
Normal file
11
ProyectoWeb/servicios/admin.py
Normal file
11
ProyectoWeb/servicios/admin.py
Normal 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)
|
||||||
|
|
5
ProyectoWeb/servicios/apps.py
Normal file
5
ProyectoWeb/servicios/apps.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ServiciosConfig(AppConfig):
|
||||||
|
name = 'servicios'
|
29
ProyectoWeb/servicios/migrations/0001_initial.py
Normal file
29
ProyectoWeb/servicios/migrations/0001_initial.py
Normal 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',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0002_auto_20201118_2354.py
Normal file
17
ProyectoWeb/servicios/migrations/0002_auto_20201118_2354.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0003_auto_20201118_2357.py
Normal file
17
ProyectoWeb/servicios/migrations/0003_auto_20201118_2357.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0004_auto_20201119_0000.py
Normal file
17
ProyectoWeb/servicios/migrations/0004_auto_20201119_0000.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0005_auto_20201119_0010.py
Normal file
17
ProyectoWeb/servicios/migrations/0005_auto_20201119_0010.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0006_auto_20201119_0323.py
Normal file
17
ProyectoWeb/servicios/migrations/0006_auto_20201119_0323.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
17
ProyectoWeb/servicios/migrations/0007_auto_20201119_0323.py
Normal file
17
ProyectoWeb/servicios/migrations/0007_auto_20201119_0323.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
0
ProyectoWeb/servicios/migrations/__init__.py
Normal file
0
ProyectoWeb/servicios/migrations/__init__.py
Normal file
21
ProyectoWeb/servicios/models.py
Normal file
21
ProyectoWeb/servicios/models.py
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
|
3
ProyectoWeb/servicios/tests.py
Normal file
3
ProyectoWeb/servicios/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
3
ProyectoWeb/servicios/views.py
Normal file
3
ProyectoWeb/servicios/views.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
BIN
ProyectoWeb/wikimg/admin_panel.png
Normal file
BIN
ProyectoWeb/wikimg/admin_panel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Loading…
Reference in New Issue
Block a user