1.注解名称:@JsonIgnore 作用:在实体类向前台返回数据时用来忽略不想传递给前台的属性或接口。 Eg:User实体中会有字段password字段, 当返回用户信息给前台的时候,当然是不希望将password值也一并返回。所以,这个时候可以在password属性上加上注解JsonIgnore ...
分类:
Web程序 时间:
2020-04-11 00:38:34
阅读次数:
271
魔法方法 __repr__方法,返回对象的内存地址 class student: def __repr__(self): stu=student() print(stu) #返回对象内存地址,类中没有__repr__方法。 print(stu.__repr__()) #返回对象内存地址,类中有__r ...
分类:
编程语言 时间:
2020-04-07 00:20:30
阅读次数:
88
__str__ 直接显示变量调用的不是__str__(),而是__repr__(),两者的区别是__str__()返回用户看到的字符串,而__repr__()返回程序开发者看到的字符串,也就是说,__repr__()是为调试服务的。 解决办法是再定义一个__repr__()。但是通常__str__( ...
分类:
其他好文 时间:
2020-04-05 15:54:19
阅读次数:
73
class Www: def __init__(self,name): self.name=name def __str__(self): return '名称 %s'%self.name #__repr__=__str__ *这是在__str__转换__repr__函数的偷懒小方法 #__str_ ...
分类:
编程语言 时间:
2020-04-03 22:12:51
阅读次数:
93
One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions ...
分类:
其他好文 时间:
2020-04-02 22:39:14
阅读次数:
84
选择在Linux下安装redis,现在采用虚拟机安装的centos7 进行安装的 1.安装gcc redis是c语言编写的 yum install gcc-c++ 2.下载redis安装包,在root目录下执行 wget http://download.redis.io/releases/redis ...
分类:
系统相关 时间:
2020-04-02 01:02:06
阅读次数:
76
阅读目录 isinstance和issubclass 反射 setattr delattr getattr hasattr __str__和__repr__ item系列 __getitem__ __setitem__ __delitem__ __del__ __new__ __call__ wit ...
分类:
其他好文 时间:
2020-04-01 22:09:16
阅读次数:
100
我的代码是这样写的: 本地一直正常,发到linux环境下,一直报空指针,排查了好多地方,最后才发现是大小写的问题:windows环境不区分大小写,所以不报错,linux区分大小写,所以路径始终有问题 ...
分类:
其他好文 时间:
2020-04-01 14:40:16
阅读次数:
165
E - Power Strings Given two strings a and b we define ab to be their concatenation. For example, if a = "abc" and b = "def" then ab = "abcdef". If we ...
分类:
其他好文 时间:
2020-03-31 14:21:25
阅读次数:
63
[toc] 内置数据结构 + 数值型 + int在python中就是长整型,没有大小限制 + float由整数和小数部分组成,只有双精度型 + complex由实数和虚数部分,实、虚部都是浮点数 + bool是int的子类,仅有2个实例,Ture、False对应1、0 + 类型转换 + + + 、` ...
分类:
编程语言 时间:
2020-03-27 00:55:56
阅读次数:
67