Skip to content

Instantly share code, notes, and snippets.

@palibaya
palibaya / gist:5362798
Last active December 16, 2015 02:29
Composite Unique
<?php
class MyModel extends CActiveRecord
{
public function rules()
{
return array(
array('attr_a', 'compositeUnique', 'other' => 'attr_b'),
);
}
public function compositeUnique($attribute,$params)
@palibaya
palibaya / gist:5361696
Created April 11, 2013 08:25
Environment for Behave + Django + Selenium
# -*- coding: utf-8 *-*
import os
import urlparse
import logging
from selenium import webdriver
# This is necessary for all installed apps to be recognized, for some reason.
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
def before_all(context):