intTypePromotion=1

Web to py enterprise web framework - p 20

Chia sẻ: Yukogaru Yukogaru | Ngày: | Loại File: PDF | Số trang:10

0
52
lượt xem
4
download

Web to py enterprise web framework - p 20

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

OTHER OPERATORS 175 6.10 Other Operators web2py has other operators that provide an API to access equivalent SQL operators. Let’s define another table "log" to store security events, their timestamp and severity, where the severity is an integer number. 1 2 3 db.define_table('log', Field('event'), Field('timestamp', 'datetime'), Field('severity', 'integer')) As before, insert a few events, a "port scan", an "xss injection" and an "unauthorized login". For the sake of the example, you can log events with the same timestamp but with different severities (1, 2, 3 respectively). 1 2 3 4 5 1 import datetime now = datetime.datetime.now() print db.log.insert(event='port scan', timestamp=now, severity=1) print db.log.insert(event='xss injection',...

Chủ đề:
Lưu

Nội dung Text: Web to py enterprise web framework - p 20

ADSENSE
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2