읽기 전용 필드로 만들기(feat.admin)

hyuckhoon.ko·2021년 2월 17일
0

What I learned in first year

목록 보기
71/146
 p = Product.objects.last()
 a = [p.name for p in p.__class__._meta.fields]

결과
['id', 'created_at', 'updated_at', 'deleted_at', 'is_deleted', 'product_code', 'brand', 'purchased_year', 'purchased_where', 'purchased_price', 'wish_price', 'name', 'agreement', 'product_grade', 'user', 'memo', 'sell_category', 'product_status', 'price', 'godomall_link', 'is_reebonze', 'is_discounted', 'hit', 'kakao_prevention']




출처: https://stackoverflow.com/questions/13817525/django-admin-make-all-fields-readonly

0개의 댓글