Differences between revisions 5 and 6
Revision 5 as of 2008-09-08 15:45:25
Size: 1460
Editor: 203
Comment:
Revision 6 as of 2008-09-24 17:59:33
Size: 1652
Editor: 203
Comment:
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:

=== 업로드파일의 경로변경 ===
다음처럼 파일경로(path, url)가 바뀌였다.
 * model.get_file_filename() --> model.file.name
 * model.get_file_url() --> model.file.url

[Django] 1.0 릴리즈(2008-09-04) 이후 바뀐 점들

참고정보

관련포스트

참고이슈들

form_for_model 이 없어짐

form_for_model 은 ModelForm을 서브클래싱하여 쓰라고 되어있으나 몇가지 문제가 있다.

  1. 다른 폼과 mixin 하여 쓸 수 없다. : metaclass conflict 메세지와 함께 안된다고 나온다. http://www.djangosnippets.org/snippets/703 을 써서 동작하게 할 수 있다.

  2. mixin 대상이 둘 다 ModelForm 일 경우 또 동작하지 않는다. http://code.djangoproject.com/ticket/7018 로 보고가 되어있다. 임시방편은 티켓페이지 참고

모델객체 save할때 force_insert?

모델의 save를 오버라이드 했을 경우, force_insert=True 인수를 추가로 줘야한다. 이는 모델객체를 create 할때 update가 아닌 insert만 하고자 하는 의도. ([http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#createandget_or_createwillneverupdateexistingobjects 참고])

업로드파일의 경로변경

다음처럼 파일경로(path, url)가 바뀌였다.

  • model.get_file_filename() --> model.file.name

  • model.get_file_url() --> model.file.url

Django1.0 (last edited 2013-06-28 09:46:23 by 61)

web biohackers.net