-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d1eb40
commit 5d6f762
Showing
20 changed files
with
308 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Generated by Django 4.1.3 on 2024-12-22 15:21 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('base', '0001_initial'), | ||
('auth', '0012_alter_user_first_name_max_length'), | ||
('accounts', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='profile', | ||
name='city', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.city', verbose_name='city'), | ||
), | ||
migrations.AddField( | ||
model_name='profile', | ||
name='user', | ||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user'), | ||
), | ||
migrations.AddField( | ||
model_name='address', | ||
name='city', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='base.city', verbose_name='city'), | ||
), | ||
migrations.AddField( | ||
model_name='address', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user'), | ||
), | ||
migrations.AddField( | ||
model_name='user', | ||
name='groups', | ||
field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups'), | ||
), | ||
migrations.AddField( | ||
model_name='user', | ||
name='user_permissions', | ||
field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
from django.contrib import admin | ||
|
||
from base.models import Footer | ||
from base.admin.singleton import SingletonModelAdmin | ||
from base.models import Footer, FooterColumn, FooterImage, FooterRow | ||
|
||
|
||
class FooterRowInline(admin.TabularInline): | ||
model = FooterRow | ||
extra = 0 | ||
|
||
|
||
@admin.register(Footer) | ||
class FooterAdmin(admin.ModelAdmin): | ||
""" | ||
Admin panel for footer | ||
""" | ||
class FooterAdmin(SingletonModelAdmin): | ||
list_display = ("id", "text", "logo") | ||
|
||
|
||
list_display = ("id",) | ||
filter_horizontal = ("social_accounts", "useful_link") | ||
@admin.register(FooterColumn) | ||
class FooterColumnAdmin(admin.ModelAdmin): | ||
list_display = ("id", "title", "link", "order") | ||
list_editable = ("order",) | ||
search_fields = ("title", "link") | ||
inlines = (FooterRowInline,) | ||
|
||
def has_add_permission(self, request): | ||
if self.model.objects.exists(): | ||
return False | ||
|
||
return super().has_add_permission(request) | ||
@admin.register(FooterImage) | ||
class FooterImageAdmin(admin.ModelAdmin): | ||
list_display = ("id", "image", "link", "order") | ||
list_editable = ("order",) | ||
search_fields = ("link",) |
Oops, something went wrong.