init
Some checks failed
CI/CD / Backend & Frontend Checks (push) Has been cancelled
CI/CD / Deploy to Production (push) Has been cancelled

This commit is contained in:
2026-05-18 11:34:07 +03:30
commit 7a8ddeabed
279 changed files with 37390 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from import_export import resources, fields
from import_export.widgets import ForeignKeyWidget
from gallery.models import Gallery
from users.models import User
class GalleryResource(resources.ModelResource):
uploaded_by = fields.Field(
column_name='uploaded_by',
attribute='uploaded_by',
widget=ForeignKeyWidget(User, 'username')
)
class Meta:
model = Gallery
fields = ('id', 'title', 'description', 'image', 'uploaded_by',
'alt_text', 'file_size', 'width', 'height', 'is_public', 'created_at')