码迷,mamicode.com
首页 >  
搜索关键字:models    ( 3511个结果
django get和filter方法的几点不同
django的get和filter方法是django model常用到的,搞清楚两者的区别非常重要。为了说明它们两者的区别定义2个modelsclass Student(models.Model):name = models.CharField('姓名', max_length=20, defaul
分类:其他好文   时间:2016-03-21 09:23:29    阅读次数:144
python类库26[web2py之基本概念]
一 web2py的应用的执行环境Models,Controllers和views所在的执行环境中,以下对象已经被默认地导入: Global Objects: request,response,session,cache Navigation: redirect,HTTP Internationali
分类:编程语言   时间:2016-03-16 07:14:34    阅读次数:469
Yii 2.0 文件上传
先创建一个(UploadForm.php)模型层 <?phpnamespace app\models;use yii\base\Model;use yii\web\UploadedFile;/*** UploadForm is the model behind the upload form.*/c
分类:Web程序   时间:2016-03-13 23:47:16    阅读次数:254
Laravel 基本任务笔记
数据库: 建表为tasks的迁移文件: 迁移文件在database/migrations中。 自带属性:自增id,时间戳。 使用迁移文件建表: 每个表对应一个Models,用于封装所有针对表的操作。 Models的php文件被放置在/app目录下。名字能够自动对应。 用于将url与对应的功能关联。也
分类:其他好文   时间:2016-03-13 00:43:37    阅读次数:187
python中__unicode__方法的使用
python中__unicode__(self):方法:__unicode()方法告诉python如何实现对象的unicode表示。如以下数据模型:class Host(models.Model): id = models.AutoField(primary_key=True) ip = model
分类:编程语言   时间:2016-03-11 17:07:49    阅读次数:188
Yii2 登录Model
<?php namespace app\models; use Yii; class User extends \yii\db\ActiveRecord implements \yii\web\IdentityInterface { public $auth_key='sun'; public $a
分类:其他好文   时间:2016-03-10 23:14:06    阅读次数:184
MVC怎么在同一个action返回两个表的数据
一般返回一个model这样@model MvcMusicStore.Models.Album 方法: public ActionResult Details(int id) { var album = storeDB.Albums.Find(id); return View(album); } 这个
分类:Web程序   时间:2016-03-10 14:24:58    阅读次数:194
django1.8 增加注册用户其他字段
在V1.6及之后版本已经删除get_profile()方法,需要使用userprofile。 1.新建moduel,名为UserProfile: class UserProfile(models.Model): user=models.OneToOneField(User,unique=True)
分类:其他好文   时间:2016-03-09 15:30:56    阅读次数:134
数据库操作
查看数据表定义 [root@host-100-100-5-17 alu02]# cat blog/models.py from django.db import models class Employee(models.Model): name = models.CharField(max_leng
分类:数据库   时间:2016-03-08 00:22:13    阅读次数:177
【转载】FLUNT温度场模拟
1. Gambit 绘制几何计算域,划分网格,定义边界类型 2. fluent设置以及计算 注意: define->models->energy 打开能量方程 define->models->viscous 打开湍流方程k-epsilon materials 选择 air即可 zone下面选择flu
分类:其他好文   时间:2016-03-05 22:02:26    阅读次数:388
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!