前回のサムネイル画像のアップロードの書き込み http://programing-a2c-jp.blogspot.com/2007/09/django.html ではviewの側にサムネイル画像の保存処理を書いていたがadminから画像を保存するときにサムネイルを自ら指定しないと保存できないといった問題があったのでmodelのsaveメソッドを再定義してサムネイル保存の処理を追加してみた。これでadmin側から画像を保存する時もサムネイルが自動生成されるようになった。 ####### models.py class PhotoWithThumb ###### class PhotoWithThumb (models.Model): photo_name = models.CharField(maxlength=200) pub_date = models.DateTimeField('da
Custom Upload Fields and Filters NOTE: Much of this article -- such as altering the names and paths of uploaded files -- is obsolete as of r8244 and the Django 1.0 alpha 2. See the new file documentation for details. I've made custom file upload fields with some extra features: automatic upload_to path (based on app/model/field names) automatic renaming the filename based on the primary key maxim
djangoのsvn版(2007-09-16)のnewformsを使ってview側で主に処理を行うことでサムネイル付き画像のアップロードに挑戦してみた。 ファイルの保存を行うときはsaveメソッドでなくsave_FIELD_fileメソッド(FIELDには ファイルインスタンスのフィールド名が入る)を使うとかが、注意点かもしれない。 参考にしたのは http://www.oluyede.org/blog/2007/03/18/django-image-uploading-validation-and-newforms/ など。 でも上記のサイトのコードにある new_data = request.POST.copy() new_data.update(request.FILES)などはうまくいかなかったので含めなかった。 また、0.96 には無いnewformsのImageField()を
Backwards-incompatible changes This section of the Django wiki documents all backwards-incompatible changes to Django from 0.96 to 1.0. If you're already running Django 1.0, you need not worry about anything on this page. Django historians, you can view pre-0.96 changes on the OlderBackwardsIncompatibleChanges page. For changes after version 1.0, which are kept to a minimum due to our API stabili
Python for JavaScript Programmers By Atul Varma I couldn't find anything on the web that attempted to teach Python to readers who already knew JavaScript, so I thought I'd give it a shot, since a number of my friends at Mozilla don't know much about Python but know JavaScript incredibly well. The languages actually aren't that dissimilar--in fact, some of JavaScript's latest features have been bor
This script is for people who wants to have a consistent look for checkboxes across browser or those who simply want them to look better. By using this script you wont loose any of the regular inputs usability. See below for a demo of the project or click here for the full project documentation. If you need support with prettySociable, please take a look at our forums Documentation Please see this
GoogleAppEngineについて前回紹介し,SDKを用いたローカルでの開発方法,および「Hello, World」を表示して公開するところまで説明しました。 今回はかんたんなアプリケーションの作成を通してGoogleのwebapp Frameworkを説明します。サンプルとして,かんたんなひとことブログサービスを作成します。このアプリケーションの作成チュートリアルを通して,データの投稿や削除,ユーザー認証などWebアプリケーションの基本的な機能を実装する方法を一緒に学んでいきましょう。 仕様を決める 実装する機能は以下の通りとします(図1,図2)。 ひとことの投稿 ひとことの削除…自分が投稿したひとことを選んで削除できる すべてのひとことの削除…管理者のみすべてのひとことを削除できる
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く