class GalleryInlines(NonrelatedTabularInline):
model = Gallery
tab = True
extra = 0
can_delete = False
fields = ["image", "status",
"is_deleted", "caption",
"created_at"]
readonly_fields = ["image", "status",
"is_deleted", "caption",
"created_at"]
def get_form_queryset(self, obj):
return self.model.objects.filter(salon=obj.salon)
def save_new_instance(self, parent, instance):
pass
class Meta:
verbose_name = "نمونه کار"
verbose_name_plural = "نمونه کار ها"