Django framework: Model Association, properties of model class

1. correlation 1.1 model class relationship There are three types of relationships in relational databases: ForeignKey: one to many. Define the field in the multiple end. ManyToManyField: many to many, defining fields on either end. One to one field: one to one, define the field on either end. 1.1.1 one to many relationship #Define book mode ...

Posted by LiamProductions on Mon, 20 Jan 2020 10:15:24 -0800

Use LINQ to get items in one List, not another List

I will assume that there is a simple LINQ query that can do this, but I'm not sure how. Give this Code: class Program { static void Main(string[] args) { List<Person> peopleList1 = new List<Person>(); peopleList1.Add(new Person() { ID = 1 }); peopleList1.Add(new Person() { ID = 2 }); peo ...

Posted by Rohan Shenoy on Sat, 18 Jan 2020 06:12:13 -0800

Experience and skills summary of Python Django development

Article directory 1. Data transfer between front and back stations 2. Several common methods of interacting with database and returning data 3. Solutions of multiple buttons corresponding to one form 4. Form control and operation in HTML 5. Message frame message usage 6. Auto now, auto now add of Dat ...

Posted by Ilovetopk on Sat, 18 Jan 2020 04:11:04 -0800

Quick review of MySQL: subqueries

Article Directory 11.1 Subquery 11.2 Use subqueries as calculated fields 11.3 Subquery Skills Prerequisite: Reference book MySQL is sure 11.1 Subquery Subqueries, as the name implies, are queries nested in other queries. Create the following tables first: ############################### # Role ...

Posted by Scifa on Fri, 17 Jan 2020 19:45:03 -0800

Review of JDBC and summary of tools

Article directory Summary JDBC JDBC access database steps jdbc common interface 1. Statement interface Three Statement classes Common Statement transaction management Time type 1. java.util.Date Date comparison processing Text storage CLOB Related types in mysql BLOB Related types in Mysql ...

Posted by crimsonmoon on Fri, 17 Jan 2020 07:15:00 -0800

Quickly read very large tables as data frames

I have a very large table (30 million rows), and I want to load it as a data frame in R. read.table() has many convenient functions, but it seems that there are many logic in the implementation that will slow things down. As far as I'm concerned, I'm assuming that I know the type of column in advance, that the table doesn't contain any column ...

Posted by Johnlbuk on Fri, 17 Jan 2020 07:09:11 -0800

Log4j2 configuration and customization

The new requirements need to make some customized things on log4j, so the log4j2 is supplemented To configure Let's look at the traditional configuration of log4j2 <?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <properties> <property name="log_path"&gt ...

Posted by fluteflute on Fri, 17 Jan 2020 03:18:16 -0800

Data source and connection pool of Mybatis principle

In Java engineering projects, we often use the Mybatis framework to add, delete, query and modify the data in the database. Its principle is to encapsulate JDBC and optimize the connection of data sources. Let's review the process of JDBC operating database. JDBC operation database When JDBC operates the database, you need to specify the co ...

Posted by The End on Thu, 16 Jan 2020 23:08:18 -0800

Django Web framework teaching notes

Catalog Article directory Catalog Query data Field lookup query predicate Modify data record Delete record Aggregate query F object Q object - Q() Native database operation method Query data The query of database needs to use manager object Call the query interface through the MyModel.ob ...

Posted by BDKR on Thu, 16 Jan 2020 07:22:00 -0800

store (mall project) Springboot+springmvc+ajax+mybatis(11)

44. Receiving address - display list - controller layer (a) Handling newly created exceptions nothing (b) Requests to be processed for design Request path / addresses/ Request parameter: HttpSession session Request method: GET Response result: jsonresult < list < address > > (c) P ...

Posted by tengkie on Thu, 16 Jan 2020 05:31:01 -0800