0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Django モデル操作編

Posted at

例えばviews.py内部で、フォームは使用しないがDBにデータを追加したいとき

views.py
[中略]
DB.objects.create(field_1 = data_1,
                   field_2 = data_2,
                   field_3 = data_3,)

postとDBが連携している場合の実装

views.py
[中略]
postData = PostObject()
postData.field = data_1
[続く]

ORMメソッドは他にもいろいろあるため要チェック

随時追記

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?