0

我在 DJango 有这样的桌子吗?

| id | user_id | name          | source         | remaining | start_date                 | time_remaining | size |
+----+---------+---------------+----------------+-----------+----------------------------+----------------+------+
|  1 |       1 | ok.txt        | ngs.pradhi.com |        20 | February 05, 2013, 08:01AM | 1              | 4 MB |
|  2 |       1 | NC_008253.fna | ngs.pradhi.com |        20 | February 05, 2013, 08:02AM | 1              | 4 MB |
|  3 |       1 | test.data     | ngs.pradhi.com |         0 | February 05, 2013, 08:21AM | 1              | 4 MB 

我想检索数据 whereuser_id = request.user.idremaining < 100. 尝试使用:

Queue.objects.filter(user_id=request.user.id, remaining < 100) But didn't work.
4

1 回答 1

1
Queue.objects.filter(user_id=request.user.id, remaining__lt=100).exclude(remaining=0)

Django 字段查找

于 2013-02-05T03:54:09.380 回答