list_filter = ['group']
readonly_fields = ['created_at']
autocomplete_fields = ['book']
+ search_fields = ['text', 'link', 'picture_alt', 'picture_author', 'picture_link', 'image_title', 'image_author', 'image_link']
fieldsets = (
(None, {'fields': ('group', 'sticky', 'created_at', 'book')}),
(_('Content'), {'fields': ('link', 'vip', 'text', 'small')}),
class CarouselItemInline(OrderableAdmin, admin.TabularInline):
model = CarouselItem
ordering_field = 'order'
+ autocomplete_fields = ['banner']
class CarouselAdmin(admin.ModelAdmin):
--- /dev/null
+# Generated by Django 3.2.16 on 2022-10-14 08:04
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('social', '0013_auto_20210120_1445'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='carouselitem',
+ name='order',
+ field=models.PositiveSmallIntegerField(verbose_name='order'),
+ ),
+ migrations.AlterUniqueTogether(
+ name='carouselitem',
+ unique_together=set(),
+ ),
+ ]
class CarouselItem(models.Model):
- order = models.PositiveSmallIntegerField(_('order'), unique=True)
+ order = models.PositiveSmallIntegerField(_('order'))
carousel = models.ForeignKey(Carousel, models.CASCADE, verbose_name=_('carousel'))
banner = models.ForeignKey(Cite, models.CASCADE, null=True, blank=True, verbose_name=_('banner'))
banner_group = models.ForeignKey(BannerGroup, models.CASCADE, null=True, blank=True, verbose_name=_('banner group'))
class Meta:
ordering = ('order',)
- unique_together = [('carousel', 'order')]
verbose_name = _('carousel item')
verbose_name_plural = _('carousel items')