reverse(4)
-
Django admin reverse
Reversing admin URLs in Django | en.proft.me Reversing admin URLs in Django | en.proft.me Short note about reversing admin URLs in Django. en.proft.me
2021.03.03 -
Django Admin TabularInline에 링크 추가
class TestedBoxInline(admin.TabularInline) : model = Tested_Data_Box extra = 0 fields = ['id','getBoxLink','char','coords_1','coords_2','coords_3','coords_4','page'] readonly_fields = ['getBoxLink','char','coords_1','coords_2','coords_3','coords_4','page'] def getBoxLink(self, obj) : return format_html("%s" %(reverse('admin:%s_trained_box_change' %obj._meta.app_label,args=(obj.box_id,)), obj.box..
2021.03.03 -
Django Admin change_form.html에 버튼 추가 및 저장시 custom 작업 수행
{% block submit_buttons_bottom %} {{ block.super }} {% endblock %} def response_change(self, request, obj): if "_gotoTrainedBoxes" in request.POST or "_gotoTrainedBoxes(include Image)" in request.POST : if "_gotoTrainedBoxes(include Image)" in request.POST : Trained_Image.createImageData(obj) opts = self.model._meta msg = format_html('The Trained_Image “{}” was changed successfully.', obj.id) se..
2021.02.12 -
list 순서 뒤집기
list = [ 1, 7, 5] list.reverse() print(list) [5, 7, 1] temp = list(reversed(list)) print(temp) [1, 7, 5] print(list) [5, 7, 1]
2020.12.27