Results of 11 - 20 of about 60 for pk (0.143 sec.)
- モデルインスタンスリファレンス — Django 4.0.6 ドキュメント 8129
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
. create ( val = 1 ) MyModel . objects . filter ( pk = obj . pk ) . update ( val = F ( 'val' ) + 1 ) # ...
the documentation for AutoField for more details. pk プロパティ ¶ Model. pk ¶ Regardless of whether you ...
ne for you, each model will have a property called pk . It behaves like a normal attribute on the model, ...
ce's primary key value. It is effectively hash(obj.pk) . If the instance doesn't have a primary key valu ...
-
https://man.plustar.jp/django/ref/models/instances.html
- [similar]
- クエリー式 — Django 4.0.6 ドキュメント 7910
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
mployee . objects . filter ( company = OuterRef ( 'pk' ), salary__gt = 10 )) ) # Lookup expressions can ...
e reloaded: reporter = Reporters . objects . get ( pk = reporter . pk ) # Or, more succinctly: reporter ...
= Comment . objects . filter ( post = OuterRef ( 'pk' )) . order_by ( '-created_at' ) >>> Post . object ...
objects . filter ( author = OuterRef ( OuterRef ( 'pk' ))) Changed in Django 3.2: Support for transforms ...
-
https://man.plustar.jp/django/ref/models/expressions.html
- [similar]
- 多対多 (many-to-many) 関係 — Django 4.0.6 ドキュメント 7910
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
>]> >>> Article . objects . filter ( publications__pk = 1 ) <QuerySet [<Article: Django lets you build w ...
on Journal>]> >>> Publication . objects . filter ( pk = 1 ) <QuerySet [<Publication: The Python Journal> ...
l>]> >>> Publication . objects . filter ( article__pk = 1 ) <QuerySet [<Publication: The Python Journal> ...
ience Weekly>]> >>> a1 = Article . objects . get ( pk = 1 ) >>> a1 . publications . all () <QuerySet []> ...
-
https://man.plustar.jp/django/topics/db/examples/many_to_many.html
- [similar]
- Base views — Django 4.0.6 ドキュメント 7809
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
kwargs ): article = get_object_or_404 ( Article , pk = kwargs [ 'pk' ]) article . update_counter () ret ...
cleDetailView urlpatterns = [ path ( 'counter/<int:pk>/' , ArticleCounterRedirectView . as_view (), name ...
= 'article-counter' ), path ( 'details/<int:pk>/' , ArticleDetailView . as_view (), name = 'artic ...
-
https://man.plustar.jp/django/ref/class-based-views/base.html
- [similar]
- Admin actions — Django 4.0.6 ドキュメント 7605
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
, queryset ): selected = queryset . values_list ( 'pk' , flat = True ) ct = ContentType . objects . get_ ...
nseRedirect ( '/export/?ct= %s &ids= %s ' % ( ct . pk , ',' . join ( str ( pk ) for pk in selected ), )) ...
-
https://man.plustar.jp/django/ref/contrib/admin/actions.html
- [similar]
- Django 3.0 リリースノート — Django 4.0.6 ドキュメント 7605
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
on MySQL 8.0.16+. The new allows_group_by_selected_pks_on_model() method of django.db.backends.base.Base ...
riding the features class allows_group_by_selected_pks_on_model() method as you require. See Subclassing ...
e the update_or_create() method or QuerySet.filter(pk=…).update(…) instead. For example: >>> MyModel . o ...
bjects . update_or_create ( pk = existing_pk , defaults = { 'name' : 'new name' } ...
-
https://man.plustar.jp/django/releases/3.0.html
- [similar]
- Django 1.4 documentation 7503
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
.get(id=1) と同じです。 >>> Poll . objects . get ( pk = 1 ) <Poll: What's up?> # カスタムメソッドが動作す ...
確かめてみましょう。 >>> p = Poll . objects . get ( pk = 1 ) >>> p . was_published_recently () True # Pol ...
する set を作ります。 >>> p = Poll . objects . get ( pk = 1 ) # 関連するオブジェクトの set から choice を表 ...
uest , poll_id ): try : p = Poll . objects . get ( pk = poll_id ) except Poll . DoesNotExist : raise Htt ...
-
https://man.plustar.jp/django/contents.html
- [similar]
- 非同期サポート — Django 4.0.6 ドキュメント 7503
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
Blog . objects . get , thread_sensitive = True )( pk = 123 ) 次のコードのように、ORMのコードを独自の関数 ...
asgiref.sync import sync_to_async def _get_blog ( pk ): return Blog . objects . select_related ( 'autho ...
r' ) . get ( pk = pk ) get_blog = sync_to_async ( _get_blog , thre ...
-
https://man.plustar.jp/django/topics/async.html
- [similar]
- Signals — Django 4.0.6 ドキュメント 7402
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
ded to, removed from or cleared from the relation. pk_set For the pre_add and post_add actions, this is ...
istent values may be submitted, and will appear in pk_set , even though they have no effect on the datab ...
ing (the class of the objects added to the Pizza ) pk_set {t.id} (since only Topping t was added to the ...
he class of the objects removed from the Topping ) pk_set {p.id} (since only Pizza p was removed from th ...
-
https://man.plustar.jp/django/ref/signals.html
- [similar]
- Porting your apps from Django 0.96 to 1.0 — Django 4.0.6 ドキュメント 7198
- " + tagname + " "); } }); $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { va
...
_length connection.ops.max_name_length backend.get_pk_default_value connection.ops.pk_default_value back ...
.allows_group_by_ordinal backend.allows_unique_and_pk connection.features.allows_unique_and_pk backend.a ...
-
https://man.plustar.jp/django/releases/1.0-porting-guide.html
- [similar]