Time of Update: 2016-08-23
標籤:當abstract=True時,這個model就變成了abstrct base class,那這個基類有什麼特性呢?當某一model中設定了abstract=True時,就會使該model中的欄位都不會產生對應的表,而是可以作為基類加入到其他model中那有什麼用呢?有時多個model有些相同的欄位,這樣很浪費時間,而且重複本身也不利於代碼簡潔。好該abstract來了看官例: from django.db import modelsclass
Time of Update: 2016-08-23
標籤:HTML 頁面內容包含以下標籤即可: <input id="btn_select" type="button" value="從相簿選擇" /> <input id="btn_takephoto" type="button" value="拍照" /> <img id="imgViewer" src=""
Time of Update: 2016-08-23
標籤:第一部分 HTML1、HTML標準:<html> <head>
Time of Update: 2016-08-23
標籤:<select id="search"> <option value=‘1‘>baidu</option> <option value=‘2‘>sogou</option></select>1.清空select標籤下的option標籤(1) $("#search").html("");(2)
Time of Update: 2016-08-23
標籤:myeclipse1、使用DB Browser建立資料庫連接Window->Show View->Other... 搜尋DB650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/86/55/wKioL1e8B5jBOYhvAAAhwrFzn6U170.png" title="001.PNG" alt="wKioL1e8B5jBOYhvAAAhwrFzn6U170.png" />在DB Browser建立資料庫連接65
Time of Update: 2016-08-23
標籤:檔案上傳
Time of Update: 2016-08-23
標籤:<!DOCTYPE HTML><html><head><meta charset="UTF-8"><script language="javascript" type="text/javascript">function autoPlay(){var myAuto = document.getElementById(‘myaudio‘);myAuto.play();}</script></head><
Time of Update: 2016-08-23
標籤:針對於YII2.0官方手冊來說,我稍微修改了一些內容具體的就是把model層裡定義的uoload方法在controller方法裡合并了建立模型namespace app\models;use yii\base\Model;use yii\web\UploadedFile;class UploadForm extends Model{ public $imageFile;//定義一個公用的名稱 public function rules() { return [
Time of Update: 2016-08-23
標籤:對background的兩種運用:一是background中的線性漸層,background: linear-gradient(to bottom,#0e7bef,#0d73da);這個是對背景顏色從上到下的一種線性漸層(linear-gradient),兩個顏色參數是從第一個顏色參數漸層到第二個顏色參數。二是對background: #0e7bef url(../img/sprites.auto.26d10b5b.png)center 0
Time of Update: 2016-08-23
標籤:html頁面代碼<div id="localImag" style="display:none"><img id="preview" width="150" height="150" /></div> <input type=‘file‘ name=‘file‘ id=‘doc‘ onclick=‘javascript:setImagePreview()
Time of Update: 2016-08-23
標籤:如何通過CSS3 實現響應式Web設計:分為三個步驟:(1)允許網頁寬度自動調整。首先在頁面頭部中,我們需要加入這樣一行:<meta name="viewport" content="width=device-width, initial-scale=1" /> viewport是網頁預設的寬度和高度,網頁的寬度預設就等於自己螢幕寬度(width=device-width),並且原始縮放比例(initial-scale=1)為1.0,也就是網頁初始大小占螢幕面積的1
Time of Update: 2016-08-23
標籤:首先利用composer 下載相關的外掛程式 在根目錄執行此代碼 composer require barryvdh/laravel-ide-helper再者在config/app.php 添加一條命令Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,接著在laravel中使用 命令列進行安裝外掛程式php artisan
Time of Update: 2016-08-23
標籤:<?php/** *+------------------------------------------------------ * PHP 漢字轉拼音 *+------------------------------------------------------ * 使用方法: * $py = new PinYin(); * echo $py->getAllPY("輸出漢字所有拼音"); //shuchuhanzisuoyoupinyin
Time of Update: 2016-08-23
標籤:php部分header("Content-type:application/vnd.ms-excel");header("Content-Disposition:attachment;filename=Export_test.xlsx"); $OutputExcel = S(‘OutputExcel‘); $this->assign(‘OutputExcel‘,$OutputExcel)->display(‘test‘);html部分<html xmlns:o="urn:
Time of Update: 2016-08-23
標籤:js2word/html2word的簡單實現以C#描述如下: StringBuilder sb = new StringBuilder(); sb.Append("<html ");
Time of Update: 2016-08-23
標籤:1. Input的size與maxlength屬性的區別 maxlength="500",表示input輸入框中最多夠輸入500個字元。W3C標準指出maxlength規定文字欄位中允許的最大字元數。 size="500",則表示input輸入框只顯示500個可見的字元,但使用者實際可以輸入無限多的內容。W3C指出size屬性規定輸入欄位中的可見字元數。 input表單控制項的 size 屬性是一個可視化的設計屬性,在項目中建議使用 CSS 中的width屬性來代替它。
Time of Update: 2016-08-23
標籤:老規矩 直接上代碼 代碼中詳細注釋: function checkAll(){ var alls=document.getElementById(‘tab-stp‘).getElementsByTagName(‘input‘);//擷取到 id tab-stp 下面的所有input for(i=0;i<alls.length;i++){ //通過for迴圈 把所有input遍曆出來
Time of Update: 2016-08-23
標籤:DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall. A blockhouse is a small castle that has four openings through
Time of Update: 2016-08-23
標籤:新增元素 js對新增元素無效 web前端 通過監聽父級容器下匹配子項目進行事件綁定<div id="test1"> <input type="button" class="btn" value="按鈕1"/> <input&nbs
Time of Update: 2016-08-23
標籤:php日期時間計算 轉載 //php擷取今天日期date("Y-m-d");//php擷取昨天日期date("Y-m-d",strtotime("-1 day"))//php擷取明天日期date("Y-m-d",strtotime("+1 day"))//php擷取一周后日期date("Y-m-d",strtotime("+1 week"))//php擷取一周零兩天四小時兩秒後時間date("Y-m-d