方式一,直接判断 方式二,从源码入手 如果要验证username是否在数据库中存在,先查看源码,由于数据验证是从 obj.is_valid()方法开始验证,所以进入这个方法 依次查看 回到form类 必须要抛出ValidationError异常,导入这个异常 ...
分类:
数据库 时间:
2019-02-26 19:44:59
阅读次数:
202
On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep ...
分类:
其他好文 时间:
2019-02-26 16:57:24
阅读次数:
163
1050 String Subtraction (20 分) Given two strings S?1?? and S?2??, S=S?1???S?2?? is defined to be the remaining string after taking all the characters ...
分类:
其他好文 时间:
2019-02-25 21:50:06
阅读次数:
207
题目如下: On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters ...
分类:
其他好文 时间:
2019-02-25 19:03:29
阅读次数:
229
ARTS第十周 ARTS是什么? Algorithm :每周至少做一个leetcode的算法题; Review :阅读并点评至少一篇英文技术文章; Tip/Techni :学习至少一个技术技巧; Share :分享一篇有观点和思考的技术文章。 Algorithm 题目: "20. Valid Par ...
分类:
其他好文 时间:
2019-02-24 23:03:41
阅读次数:
185
一、数组 8) 双指针 滑动窗口 例题: 3. Longest Substring Without Repeating Characters 描述:Given a string, find the length of the longest substring without repeating c ...
分类:
其他好文 时间:
2019-02-24 19:04:19
阅读次数:
137
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa ...
分类:
其他好文 时间:
2019-02-24 18:46:38
阅读次数:
178
view中使用is_valid()方法: 局部钩子和全局钩子函数代码 通过is_valid()方法找到源码中的run_validation 最后执行self.to_internal_value(data) 流程总结: is_valid self.run_validation (执行Serialize ...
分类:
其他好文 时间:
2019-02-24 16:16:55
阅读次数:
212
1031 Hello World for U (20 分) Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld ...
分类:
其他好文 时间:
2019-02-24 00:37:38
阅读次数:
135
Problem Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to ...
分类:
其他好文 时间:
2019-02-23 17:12:39
阅读次数:
135