Django Framework Database model

Source: Internet
Author: User

Bloggers have recently started to optimize the API Interface Automation framework, this time using the Django framework to complete

The first is the code for the Database model setup:

1 #-*-coding:utf-8-*-2  from __future__ Importunicode_literals3  fromDatetimeImportdatetime4  fromDjango.dbImportModels5 6 #Create your models here.7 8 9 #API Interface ClassificationTen classModule (models. Model): OneModule_name = models. Charfield (max_length=30) A  -     def __unicode__(self): -         returnSelf.module_name the  -  - #API Interface Details - classMain (models. Model): +module =models. ForeignKey (Module) -Main_name = models. Charfield (max_length=30) +Main_url = models. Charfield (max_length=30) A  at     def __unicode__(self): -         returnSelf.main_name -  -  - #API use case execution logging - classRecord (models. Model): inMain =models. ForeignKey (Main) -Record_name = models. Charfield (max_length=64) toRecord_user = models. Charfield (max_length=64) +     #Auto_now_add=true for the first time, no update is created -Record_time = models. Datetimefield (auto_now_add=True) the  *     def __unicode__(self): $         returnSelf.record_namePanax Notoginseng  -  the #API Interface use case + classCase (models. Model): ARecord =models. ForeignKey (Record) theCase_name = models. Charfield (max_length=1024, null=True) +Case_doc = models. Charfield (max_length=1024, null=True) -ENV = models. TextField (null=True) $General_param = models. TextField (null=True) $Request_param = models. TextField (null=True) -Response_param = models. TextField (null=True) -  the     def __unicode__(self): -         returnSelf.case_doc

Design ideas: Show the classification of the API, the following is each API interface, and then open is the interface under all the automated test case records, open the record can see all the use case details

The use case details here include the use case name, environment, public parameters, request parameters, return parameters, and the execution of the use cases have not been added

Django Framework Database model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.