django1.7新機能migrations

http://a-records.info/2014/09/29/18/

django.db.utils.Error: ('00000', '[00000] [iODBC][Driver Manager]dlopen({SQL Server Native Client 10.0}, 6): image not found (0) (SQLDriverConnect)')

~/TFManager/tfmanager $ python manage.py migrate --list Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/Users/shohayakawa/anaconda/lib/python2.7/site-packages/django/core/manageme…

macにSQL Server Expressはインストールできない?

macではできないっぽい http://dba.stackexchange.com/questions/62513/sql-server-on-mac linuxではできる? http://msdn.microsoft.com/en-us/library/hh568451%28v=sql.110%29.aspx

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually djangoでmigrationのラベルを指定してmigrateしようとした時のエラー。このときはDB移行した時の最初のmigrateだったのでcontent…

Windows Azure SQL Database 管理ポータルから接続文字列をコピーしてきて使う場合

Windows Azure SQL Database 管理ポータルから接続文字列をコピーしてきて使う場合は、SQL Server Native Client 11 の場合、ODBC 接続において Driver 指定を、{SQL Server Native Client 10.0} → {SQL Server Native Client 11.0} に書き換える必要あり ht…

ERROR IM002 Microsoft ODBC Driver Manager

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in SSRS odbcのエラー settings.pyで指定しているODBCの名前が違うことによるエラーだった。 あとSQL Server Expressをインストールしていない…

git cloneでエラー

git

fatal: The remote end hung up unexpectedly fatal: index-pack failed リポジトリが大きい場合と少しずつcloneしないといけない git clone --depth 10 [url] git fetch --unshallow ちなみにdepth10でクローンしてからもう一回depth10でfetchしようとした…

UnicodeDecodeError: 'utf8' codec can't decode byte 0x97 in position 3

pipでインストール時にUnicodeDecodeError C:\> pip install django-pyodbc-azure Downloading/unpacking django-pyodbc-azure Cleaning up... Exception: Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\pip\basecommand.py", li…

django-pyodbc-azureをインストール

$ sudo pip install django-pyodbc-azure Password: Requirement already satisfied (use --upgrade to upgrade): django-pyodbc-azure in /Users/shohayakawa/anaconda/lib/python2.7/site-packages Downloading/unpacking Django>=1.7.1 (from django-pyod…

pipでpyodbcをインストール

pip install pyodbc これだと Could not find any downloads that satisfy the requirement pyodbc と言われる sudo pip install --allow-external pyodbc --allow-unverified pyodbc pyodbc とするとインストールできた。 http://stackoverflow.com/questio…

pipでpyodbcインストール時にエラー

n file included from /private/tmp/pip_build_root/pyodbc/src/buffer.cpp:12: /private/tmp/pip_build_root/pyodbc/src/pyodbc.h:52:10: fatal error: 'sql.h' file not found #include sql.h ^ 1 error generated. error: command 'gcc' failed with exit…

Debug Assertion Failed

fopenするところでNULLになっていた

PythonでMySQLに接続

http://www.python-izm.com/contents/external/mysql.shtml

MULとは

MUL -> 重複可能な外部制約キーPRI -> 重複不可な外部制約キー 外部制約キー -> テーブルの指定したカラムに格納できる値を他のテーブルに格納されている値だけに限定するもの http://hrt0kmt.hatenablog.com/entry/2014/07/09/000000 http://www.dbonline.j…

Djangoで既存テーブルの構造変更

調べてみるとmodelを変更した後にalter tableしないといけないとあったが、しなくてもできたっぽい。 ①model変更②makemigrations③migrate python manage.py makemigrations python manage.py migrate http://i2bskn.hateblo.jp/entry/20120616/1339852257 ht…

DjangoでDBにテーブル追加

①Modelにクラス追加 ②makemigrations python manage.py makemigrations ③migrate python manage.py migrate

mysql_exceptions.OperationalError: (1701,

mysql_exceptions.OperationalError: (1701, 'Cannot truncate a table referenced in a foreign key constraint http://stackoverflow.com/questions/5452760/truncate-foreign-key-constrained-table

mysql_exceptions.OperationalError: (2019, "Can't initialize character set utf-8

utf-8 -> utf8 http://purazumakoi.hatenablog.com/entry/2013/11/20/202637

テーブルを空にする

SQL

truncate table [table]; http://www.dbonline.jp/mysql/insert/index12.html

SQLコマンドでSQL文を見る

SQL

show create table [table]; http://stackoverflow.com/questions/5317889/sql-keys-mul-vs-pri-vs-uni

ユーザー管理

http://www.karakaram.com/mysql-user-grant

setAttribute

setAttributeしたい時はjQuery使えないっぽい getElementByIdとかquerySelectorAllとか使うquerySelectorAllはリストを返す http://qiita.com/3upjp/items/bf575019a5894decb51b https://developer.mozilla.org/ja/docs/Web/API/document.querySelectorAll

datepickerで任意の日付にCSSを適用

http://acro-engineer.hatenablog.com/entry/20111117/1321575622 http://d.hatena.ne.jp/aroundthedistance/20101209/1291871545

.gitignoreの反映

Git

自分のローカルでのみ無視したい場合はホーム下に.gitignoreと.gitconfigをつくる .gitignore *.pyc *~ .gitconfig [core] excludesfile = ~/.gitignore 既に追跡対象にいている場合は git rm --cached で追跡対象から外してcommitする http://qiita.com/y_m…

datepickerの土日の色をカスタマイズ

http://zuoka.blogspot.jp/2013/05/jquery-ui-datepicker-css.html

ブロック要素を含んだリストに角丸を適用するとき

CSS

リストタグの中にラベルタグなどを入れている場合で、 label {display: block;} というようにラベルをブロック要素としている場合、border-radiusを使う時は label {border-radius: 10px;} ul {border-radius: 10px;} というようにlabelタグとulタグの2つにb…

python manage.py migrateでエラー

$ python manage.py migrate --list 上記のコマンドでmigrationの状態を確認 admin [X] 0001_initial auth [X] 0001_initial contenttypes [X] 0001_initial login [X] 0001_initial manager [X] 0001_initial [X] 0002_auto_20140922_1937 [ ] 0003_auto_20…

DBのテーブルにカラム追加

http://ameblo.jp/ekispresso/entry-11485508958.html

pyqt 親ウィンドウから子ウィジェットを作成するとき、selfをつけてクラス変数にして子ウィジェット作成

http://stackoverflow.com/questions/5899826/pyqt-how-to-remove-a-widget