목록Personal DB/Unclassified record (50)
Silver Library (Archived)
wayhome25.github.io/django/2017/05/06/django-form/ 장고 폼 (form) · 초보몽키의 개발공부로그 장고 폼 (form) 06 May 2017 | python Django form AskDjango 수업을 듣고 중요한 내용을 정리하였습니다. form 장고의 가장 큰 Feature 중 하나 Model 클래스와 유사하게 Form 클래스를 정의 주요역할 (custom form class) wayhome25.github.io
wayhome25.github.io/django/2017/05/05/django-url-reverse/ URL Reverse, 아는 사람은 꼭 쓴다는 get_absolute_url() · 초보몽키의 개발공부로그 특정 모델에 대한 Detail뷰를 작성할 경우, Detail뷰에 대한 URLConf설정을 하자마자, 필히 get_absolute_url설정을 해주세요. 코드가 보다 간결해집니다 wayhome25.github.io
To prevent a user to attempt 'hacky' thing by inputting a weird URL, Use: else: form = forms.SearchForm() return render(request, "rooms/search.html", {"form": form})
What is this? QueryDict.getlist(key, default=None)¶ Returns a list of the data with the requested key. Returns an empty list if the key doesn’t exist and default is None. It’s guaranteed to return a list unless the default value provided isn’t a list. e.g. >>> q = QueryDict('a=1', mutable=True) >>> q.update({'a': '2'}) >>> q.getlist('a') ['1', '2'] >>> q['a'] # returns the last '2' docs.djangopr..