Parent
0c40e86725
révision
b74bb99989
|
@ -5,6 +5,7 @@ from wagtail.admin.edit_handlers import (
|
|||
)
|
||||
from wagtail.contrib.modeladmin.options import ModelAdmin, ModelAdminGroup
|
||||
from wagtail.documents.edit_handlers import DocumentChooserPanel
|
||||
from wagtail.images.edit_handlers import ImageChooserPanel
|
||||
|
||||
from . import models
|
||||
|
||||
|
@ -41,7 +42,13 @@ class StructureAdmin(ModelAdmin):
|
|||
|
||||
panels = [
|
||||
FieldPanel('nom'),
|
||||
FieldPanel('description'),
|
||||
MultiFieldPanel(
|
||||
[
|
||||
FieldPanel('description'),
|
||||
ImageChooserPanel('logo'),
|
||||
],
|
||||
heading='Identité',
|
||||
),
|
||||
MultiFieldPanel(
|
||||
[
|
||||
FieldPanel('tel'),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 3.2.10 on 2022-01-04 13:32
|
||||
# Generated by Django 3.2.10 on 2022-01-05 15:00
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
@ -20,6 +20,7 @@ class Migration(migrations.Migration):
|
|||
dependencies = [
|
||||
('taggit', '0003_taggeditem_add_unique_index'),
|
||||
('wagtaildocs', '0012_uploadeddocument'),
|
||||
('wagtailimages', '0023_add_choose_permissions'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
@ -62,17 +63,6 @@ class Migration(migrations.Migration):
|
|||
'verbose_name_plural': 'Types de ressource',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Structure',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nom', models.CharField(max_length=128, verbose_name='nom')),
|
||||
('description', wagtail.core.fields.RichTextField(blank=True)),
|
||||
('tel', models.CharField(blank=True, help_text="Utilisez de préférence l'indicatif téléphonique régionnal.Par exemple: +33601020304 plutôt que 0601020304", max_length=128, verbose_name='numéro de téléphone')),
|
||||
('url', models.URLField(blank=True, help_text='adresse URL', verbose_name='site web')),
|
||||
('location', models.CharField(blank=True, help_text="Localisation géographique sous forme de Geo URI. Vous pouvez facilement fabriquer ce lien depuis l'option 'partager' sur OpenStreetMap", max_length=200, validators=[django.core.validators.RegexValidator('^geo:([-+]?\\d+(?:\\.\\d+)?),([-+]?\\d+(?:\\.\\d+)?)(?:\\?z=(\\d{1,2}))?$', message='Veuillez entrer une adresse URI Geo correcte')], verbose_name='Geo URI')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Thematique',
|
||||
fields=[
|
||||
|
@ -86,6 +76,18 @@ class Migration(migrations.Migration):
|
|||
'verbose_name_plural': 'thématiques',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Structure',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nom', models.CharField(max_length=128, verbose_name='nom')),
|
||||
('description', wagtail.core.fields.RichTextField(blank=True)),
|
||||
('tel', models.CharField(blank=True, help_text="Utilisez de préférence l'indicatif téléphonique régionnal.Par exemple: +33601020304 plutôt que 0601020304", max_length=128, verbose_name='numéro de téléphone')),
|
||||
('url', models.URLField(blank=True, help_text='adresse URL', verbose_name='site web')),
|
||||
('location', models.CharField(blank=True, help_text="Localisation géographique sous forme de Geo URI. Vous pouvez facilement fabriquer ce lien depuis l'option 'partager' sur OpenStreetMap", max_length=200, validators=[django.core.validators.RegexValidator('^geo:([-+]?\\d+(?:\\.\\d+)?),([-+]?\\d+(?:\\.\\d+)?)(?:\\?z=(\\d{1,2}))?$', message='Veuillez entrer une adresse URI Geo correcte')], verbose_name='Geo URI')),
|
||||
('logo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='RessourceTag',
|
||||
fields=[
|
||||
|
|
|
@ -125,6 +125,13 @@ class Structure(models.Model):
|
|||
"OpenStreetMap"
|
||||
),
|
||||
)
|
||||
logo = models.ForeignKey(
|
||||
'wagtailimages.Image',
|
||||
null=True,
|
||||
blank=True,
|
||||
on_delete=models.SET_NULL,
|
||||
related_name='+',
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.nom
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket