This article is the 7th article in the "correct open mode of WeX5" series, which details the additions and deletions of data components in WeX5 and the method of data locating.PrefaceA preliminary study on data components we briefly introduce the introduction of data components and the underlying structure and features, and implement simple data presentation and data churn. As mentioned in the previous article, the data component is a mapping of the background database table in the front end, an
The thin data model is one of the most notorious and problematic abuses of relational database systems. Unfortunately, there are times when you really need a thin data model. The so-called thin data model is simply to design each table as a common data structure for storing a collection of name-value pairs. This is much like a property file in Java. Sometimes these tables can also be used to store metadata, such as the desired data type. This is necessary because the database only allows one col
:23:01', '%H.%i.%s') |+-------------------------------------+| 22.23.01 |+-------------------------------------+
MySQL date and time conversion functions: date_format (date, format), time_format (time, format) can convert a date/time to a variety of string formats. It is an inverse conversion of the str_to_date (str, format) function.
5. MySQL returns the country/region time format function: get_format ()
MySQL get_format () syntax:
get_format(date|time|datetime, 'eur'
: date_format (date, format), time_format (time, format) can convert a date/time to a variety of string formats. It is an inverse conversion of the str_to_date (str, format) function. 5. mySQL returns the time format function of a country or region: get_format () MySQL get_format () syntax: get_format (date | time | datetime, 'eur' | 'USA '| 'jis' | 'ISO '| all examples of 'internal' MySQL get_format () usage: select get_format (date, '
change a specified column, we can call the update () method of the result set object: example:
>>> Publisher.objects.filter(id=52).update(name='Apress Publishing')
The equivalent SQL statement is more efficient and does not cause race conditions.
UPDATE books_publisherSET name = 'Apress Publishing'WHERE id = 52;
The update () method is valid for any result set (QuerySet), which means you can update multiple records at the same time. The following example shows how to change the country fiel
Ming:benz
With the simple example above, it is easy to pass some complex data through a string, and then it is much more convenient to work with Ajax.Let's look at the role of PHP's Serialize function.Example four:
$arr = array(' Peter ' = array(' Country ' = ' USA ',' Age ' = 20) ,' Li Ming ' = = array(' Country ' = ' China ',' Age ' = 21));$serialize _var = serialize ($arr);echo $serialize _var;
Show Results:
A:2: {s:5: "Peter"; A:2: {s:7: "Cou
Data context format
Generally, the data context formula is displayed as follows:"/" + {Table. Field} + "/" + {table. Field}
You can also use the following formats:
Similar to a path format:/USA/bicycle
Strong format:/Country [USA]/product class [Bicycle]Note:
You can add detailed level information in the format starting from "0:/
'] */person.prototype.lastname = ' Jin '; /* Rewrite the prototype and react dynamically to the instance. Just as your mother is trendy, the neighbors say you're the son of a hot woman. * Notice, here we rewrite the person's prototype, is to add a lastName attribute to mother, equivalent to mother.lastname= ' Jin ' * Here is not to change mother.prototype, change the different levels, the effect will often have a great difference. * P1: ' Jack ', [' Hangzhou ', ' Guangzhou '];
, Parentheses, braces, braces, colons, and commas. The following is a JSON payload:
{"UserID":"0001","UserName":"ZhangSan","UserAge":"22"}
It looks simple. The keys and values correspond one to one (Key ---- Value). Let's look at a complicated JSON payload:
{Employees:[ {"EmployeeID":"1","LastName":"Davolio","City":"Seattle","Country":"USA"}, {"EmployeeID":"2","LastName":"Fuller","City":"Tacoma","Country":"
different. * P1: 'jack', ['hangzhou', 'hangzhou']; _ proto __: 'jin' ;__ proto __: 18, ['shenzhen ', 'shanghai'] * p2: 'mark'; _ proto __: 'jin' ;__ proto __: 18, ['shenzhen', 'shanghai'] */Person. prototype = {age: 28, address: {country: 'usa', city: 'Washington '}}; var p3 = new Person ('Obama');/* rewrite the prototype! At this time, the Person prototype has completely become a new object, that is, the Person has changed to a mother. * In this cas
(
'Country'=>'USA',
'Age'=>20
),
'LiMing'=>array
(
'Country'=>'CHINA',
'Age'=>21
)
);
$serializeserialize_var=serialize($arr);
echo$serialize_var;
JSON parsing result:
a:2:{s:5:"Peter";a:2:{s:7:"Country";s:3:"USA";s:3:"Age";i:20;}s:7:"LiMing";a:2:{s:7:"Country";s:5:"CHINA";s:3:"Age";i:21;}}
This result looks more complex than JSON, but it is also very simple.
complex way to communicate, and to customize a behavior that is distributed across multiple classes without having to generate too many subclasses.#ifndef mediator_h#define mediator_h#include#include "Mediator.h" int main () {Unitednationssecuritycouncil UNSC; USA USA (UNSC); Iraq Iraq (UNSC); UNSC. SetColleague1 (USA); UNSC. SetColleague2 (iraq),
("Testtopicexchange", "Key1.a.c.key2", "This is rabbitmq!");Topic is similar to direct, except that "mode" is supported on the match, and in the Routing_key form of "dot", two wildcard characters can be used:* Denotes a word.#表示零个或多个词.
As shown in the image above: This type of exchanger allows messages from different sources to reach a pair of columns, in fact, it is more clear that the meaning of the fuzzy match, for example: The Routekey of the red column in the above image is
just update a column, we use the update () function,>>> Publisher.objects.filter (id=52). Update (name= ' Apress publishing ')The equivalent SQL statement becomes more efficient and does not cause race conditions.UPDATE books_publisherset name = ' Apress publishing ' WHERE id = 52;The update () method is valid for any result set (QuerySet), which means that you can update multiple records at the same time. The following example shows how to set all Publisher's Country field values by ' U. S.A.
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.