Over-rides the default save function for PlugEvents.

        If a sacrifice date is set for an object in this model, then Active is set to False.
435051
def save(self):
        """"""
        if self.SacrificeDate:
            self.Active = False
        super(PlugEvents, self).save()
900566
def get_or_save_default(self, key, default_value):
        
        val = self.get_or_none(key)
        if val is None:
            self.update(key, default_value)
            val = default_value
        return val
750508
function(options) {
      inputEx.DatePickerField.superclass.setOptions.call(this, options);
      
      // Overwrite default options
      this.options.className = options.className ? options.className : 'inputEx-Field inputEx-DateField inputEx-PickerField inputEx-DatePickerField';

      this.options.readonly = YAHOO.lang.isUndefined(options.readonly) ? true : options.readonly;
      
      // Added options
      this.options.calendar = options.calendar || inputEx.messages.defautCalendarOpts;
   }
303699
function(key, val, options) {
    var opts = options || {};
    var self = this;
    var attrs;
    /* eslint no-eq-null: 0*/
    if (key == null || typeof key === 'object') {
      opts = val || {};
      attrs = key;
    } else if (key) {
      (attrs = {})[key] = val;
    }
    // if saving only specified attributes, call set,
    // since preSave may depend on changed attributes
    if (attrs) {
      this.set(attrs, opts);
    }
    var error = opts.error;
    var fns = [
      _.bind(self.preSave, self, opts),
      _.bind(PromisedModel.prototype.save, self, key, opts),
      _.bind(self.afterSave, self, opts)
    ];
    return sequence(fns).then(function(results) {
      return results[1];
    }, function(err) {
      if (error) error.call(opts, self, err);
      return failWithError(opts, err);
    });
  }
293499
function(elem) {
			var inst = this._getInst(elem);
			if (!$.isEmptyObject(inst)) {
				inst.selectedDates = [];
				this.hide(elem);
				var defaultDate = inst.get('defaultDate');
				if (inst.options.selectDefaultDate && defaultDate) {
					this.setDate(elem, (defaultDate || inst.options.calendar.today()).newDate());
				}
				else {
					this._updateInput(elem);
				}
			}
		}
614852
def save(self, *args, **kwargs):
        
        ignore_default_check = kwargs.pop('ignore_default_check', False)
        # if making this status the default one
        if self.is_default != self._current_is_default and self.is_default is True:
            # uncheck other default statuses first
            for status in self.__class__.objects.filter(is_default=True):
                status.is_default = False
                status.save(ignore_default_check=True)

        super(Status, self).save(*args, **kwargs)

        # in case there are no default statuses, make this one as the default one
        if self.__class__.objects.filter(is_default=True).count() == 0 and not ignore_default_check:
            self.is_default = True
            self.save()
        # update __current_status
        self._current_is_default = self.is_default
920784
def save_wrapper(cls, save, new_class):
        
        def _wrapped(self, *args, **kwargs):
            if not self.installed:
                raise AssertionError('Module %s is not installed' %
                                     self.verbose_name)

            logger.info("Saving %s module" % self.verbose_name)
            pre_save.send(sender=self)
            res = save(self, *args, **kwargs)
            post_save.send(sender=self)
            logger.info("Saved %s module" % self.verbose_name)

            return res

        return _wrapped
435712
function () {
                this.isDefaultPrevented = true;

                if (this.$) {
                    var e = this.$.orginalEvent;

                    if (e) {
                        if (e.preventDefault) {
                            e.preventDefault();
                        } else {
                            e.returnValue = false;  // IE
                        }
                    }
                }
            }
202378
def save(self, obj, data, is_m2m=False):
        
        if not self.readonly:
            attrs = self.attribute.split('__')
            for attr in attrs[:-1]:
                obj = getattr(obj, attr, None)
            cleaned = self.clean(data)
            if cleaned is not None or self.saves_null_values:
                if not is_m2m:
                    setattr(obj, attrs[-1], cleaned)
                else:
                    getattr(obj, attrs[-1]).set(cleaned)
624997
function timestampsPlugin(schema, options) {

  // Add the fields to the schema
  schema.add({
    createdAt: {
      type: Date,
      'default': Date.now
    },
    updatedAt: {
      type: Date,
      'default': Date.now
    },
    deletedAt: {
      type: Date,
      sparse: true
    }
  });

  // Define the pre save hook
  schema.pre('save', function (next) {
    this.updatedAt = new Date();
    next();
  });

  // Create an index on all the paths
  schema.path('createdAt').index(true);
  schema.path('updatedAt').index(true);
  schema.path('deletedAt').index(true);
}
758327
function( event ) {
            event = $.getEvent( event );

            if ( event.preventDefault ) {
                $.cancelEvent = function( event ){
                    // W3C for preventing default
                    event.preventDefault();
                };
            } else {
                $.cancelEvent = function( event ){
                    event = $.getEvent( event );
                    // legacy for preventing default
                    event.cancel = true;
                    // IE for preventing default
                    event.returnValue = false;
                };
            }
            $.cancelEvent( event );
        }
797312
public void setOptional(boolean optional) {
    if (field.getType().isPrimitive() || field.isAnnotationPresent(Version.class)
        || field.isAnnotationPresent(CreatedTimestamp.class)
        || field.isAnnotationPresent(UpdatedTimestamp.class)) {
      this.optional = false;
    } else {
      this.optional = optional;
    }
  }
151245
def forceValue(self, newVal, noteEdited=False):
        """"""
        if newVal is None:
            newVal = ""
        self.choice.set(newVal)
        if noteEdited:
            self.widgetEdited(val=newVal, skipDups=False)
778311
function stopWatchingForValueChange() {
	  if (!activeElement) {
	    return;
	  }

	  // delete restores the original property definition
	  delete activeElement.value;

	  if (activeElement.detachEvent) {
	    activeElement.detachEvent('onpropertychange', handlePropertyChange);
	  } else {
	    activeElement.removeEventListener('propertychange', handlePropertyChange, false);
	  }

	  activeElement = null;
	  activeElementInst = null;
	  activeElementValue = null;
	  activeElementValueProp = null;
	}
485876
function buildEventObject(type, data) {
        var isDefaultPrevented = false;
        return {
            type: type,
            data: data,

            /**
             * Prevent the default action for this event
             * @returns {void}
             */
            preventDefault: function () {
                isDefaultPrevented = true;
            },

            /**
             * Return true if preventDefault() has been called on this event
             * @returns {Boolean}
             */
            isDefaultPrevented: function () {
                return isDefaultPrevented;
            }
        };
    }
753549
function( event ) { //jshint ignore:line
        for ( var i = 0; i < preStepLeavePlugins.length; i++ ) {
            var thisLevel = preStepLeavePlugins[ i ];
            if ( thisLevel !== undefined ) {
                for ( var j = 0; j < thisLevel.length; j++ ) {
                    if ( thisLevel[ j ]( event ) === false ) {

                        // If a plugin returns false, the stepleave event (and related transition)
                        // is aborted
                        return false;
                    }
                }
            }
        }
    }
793746
function () {
            var pos = this._savedX, newValue = Math.max(pos / this._railWidth, 0);
            if (newValue !== this._value) {
                this._value = newValue;
                this._storeValue();
            } else {
                this._notifyDataChange();
            }
            return;
        }