小编Árn*_*son的帖子

当tastypie连接非ORM源时,如何返回404?

我正在使用这里描述的类似外观的模式:http://django-tastypie.readthedocs.org/en/latest/non_orm_data_sources.html

def obj_get(self, request=None, **kwargs):
    rv = MyObject(init=kwargs['pk'])
    audit_trail.message( ... )
    return rv
Run Code Online (Sandbox Code Playgroud)

我不能返回None,抛出一个错误.

python rest http-status-code-404 tastypie

8
推荐指数
1
解决办法
2641
查看次数

小数点后双精度

午休时我们开始讨论double价值类型的精确度.

我的同事认为,小数点后总是有15位.

在我看来,人们无法分辨,因为IEEE 754没有对此做出假设,它取决于第一个1在二进制表示中的位置.(即小数点前的数字大小也计算在内)

怎么能做出更合格的陈述?

c# double ieee-754

6
推荐指数
1
解决办法
7066
查看次数

标签 统计

c# ×1

double ×1

http-status-code-404 ×1

ieee-754 ×1

python ×1

rest ×1

tastypie ×1