... import Length , Upper >>> from django.db.models.lookups import GreaterThan # Find companies that have more employees than chairs. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) # Find companies that have at least twice as man ... y employees # as chairs. Both the querysets below are equivalent. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) * 2 ) >> ... > Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) + F ( "num_chairs" )) # How many chairs are needed for each company to seat all employees? >>> company = ( ... Company ... ... import Length , Upper >>> from django.db.models.lookups import GreaterThan # Find companies that have more employees than chairs. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) # Find companies that have at least twice as man ... y employees # as chairs. Both the querysets below are equivalent. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) * 2 ) >> ... > Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) + F ( "num_chairs" )) # How many chairs are needed for each company to seat all employees? >>> company = ( ... Company ... 2026年10月08日