... earch = vector ) . filter ( ... search = SearchQuery ( Lexeme ( "fruit" ) & Lexeme ( "dessert" )) ... ) <QuerySet [<Entry: Apple Crumble Recipes>, <Entry: Banana Split Recipes>]> >>> Entry . objects . annotate ( search = vector ) . filter ( ... search ... = SearchQuery ( Lexeme ( "fruit" ) & Lexeme ( "dessert" ) & ~ Lexeme ( "banana" )) ... ) <QuerySet [<Entry: Apple Crumble Recipes>]> Lexeme objects also support term weighting and prefixes: >>> Entry . objects . annotate ( search = vect ... ... 100 , primary_key = True ) color = models . CharField ( max_length = 100 ) >>> fruit = Fruit . objects . create ( name = "Apple" , color = "Green" ) >>> fruit . name = "Pear" >>> fruit . save () >>> Fruit . objects . order_by ( "name" ) . values_list ... ( "name" , "color" ) <QuerySet [('Apple', 'Green'), ('Pear', 'Green')]> >>> # Saving with an existing primary key updates that row. >>> pear = Fruit . objects . g ... et ( name = "Pear" ) >>> pear . name = "Apple" >>> pear . color = "Red" >>> pear . save () >>> Fruit . objects . order_by ( "name" ) . values_list ( "name" , "color" ) ... ... )を作成するようになります。 複合主キーは tuple (タプル)で表現されます: >>> product = Product . objects . create ( name = "apple" ) >>> order = Order . objects . create ( reference = "A755H" ) >>> item = OrderLineItem . objects . create ( product = pr ... ... ラウザやクローラがよくリクエストする従来の URL を除外する方法の例です: import re IGNORABLE_404_URLS = [ re . compile ( r "^/apple-touch-icon.*\.png$" ), re . compile ( r "^/favicon\.ico$" ), re . compile ( r "^/robots\.txt$" ), ] (これらは正規表現なので ... ... ソッドと writeString() メソッドを完全に置き換える必要があります。 しかし、フィードフォーマットがRSSやAtom(例えば、 GeoRSS 、Appleの iTunes podcast format など)の派生形式である場合、より良い選択肢があります。これらのタイプのフィードは、通常、基本となるフ ... ... = CharField (), ... ) ... ) >>> for c in qs : ... print ( " %s : %s " % ( c . name , c . tagline )) ... Google: Do No Evil Apple: AAPL Yahoo: Internet Company Django Software Foundation: No Tagline SQL インジェクションを防ぐ Func の __init__() ( **ext ... 2026年10月08日