Returns all the fields that are CharFields except for password from the
        User model.  For the built-in User model, that means username,
        first_name, last_name, and email.
761996
def owner_search_fields(self):
        
        try:
            from django.contrib.auth import get_user_model
        except ImportError:  # Django < 1.5
            from django.contrib.auth.models import User
        else:
            User = get_user_model()
        return [
            field.name for field in User._meta.fields
            if isinstance(field, models.CharField) and field.name != 'password'
        ]
505326
def _unpack_user(v):
  """"""
  uv = v.uservalue()
  email = unicode(uv.email().decode('utf-8'))
  auth_domain = unicode(uv.auth_domain().decode('utf-8'))
  obfuscated_gaiaid = uv.obfuscated_gaiaid().decode('utf-8')
  obfuscated_gaiaid = unicode(obfuscated_gaiaid)

  federated_identity = None
  if uv.has_federated_identity():
    federated_identity = unicode(
        uv.federated_identity().decode('utf-8'))

  value = users.User(email=email,
                     _auth_domain=auth_domain,
                     _user_id=obfuscated_gaiaid,
                     federated_identity=federated_identity)
  return value
1231890
def clean_name(self):
        
        field_name = self.cleaned_data['name']
        # get_all_field_names is deprecated in Django 1.8, this also fixes proxied models
        if hasattr(self.model._meta, 'get_fields'):
            field_names = [field.name for field in self.model._meta.get_fields()]
        else:
            field_names = self.model._meta.get_all_field_names()
        if field_name not in field_names:
            raise ValidationError("%r is not a valid field." % field_name)
        return field_name
467342
def full_name(self):
        
        formatted_user = []
        if self.user.first_name is not None:
            formatted_user.append(self.user.first_name)
        if self.user.last_name is not None:
            formatted_user.append(self.user.last_name)
        return " ".join(formatted_user)
853870
def get_sudoers_entry(username=None, sudoers_entries=None):
    
    for entry in sudoers_entries:
        if entry.startswith(username):
            return entry.replace(username, '').strip()
299445
def clean(self):
        
        raise forms.ValidationError(
            self.error_messages['invalid_login'],
            code='invalid_login',
            params={'username': self.username_field.verbose_name}
        )
609893
private void restoreFieldsFromUserInfo() {

        String savedEmail = (String)(m_user.getAdditionalInfo().get(ADDINFO_EMAIL));
        String savedName = (String)(m_user.getAdditionalInfo().get(ADDINFO_USER));
        String savedMessage = (String)(m_user.getAdditionalInfo().get(ADDINFO_MESSAGE));

        if (savedEmail != null) {
            m_emailField.setValue(savedEmail);
        }

        if (savedName != null) {
            m_userField.setValue(savedName);
        }

        if (savedMessage != null) {
            m_commitMessage.setValue(savedMessage);
        }
    }
863792
def get_readonly_fields(self, request, obj=None):
        
        if obj:
            return list(self.readonly_fields) + ['id', 'identity',
                                                 'is_current']
        return self.readonly_fields
691232
def fields
      [
        ["Handle", :handle, proc { |v| v.to_hash }, :required],
        ["Id", :handle, proc { |v| v.id }, :required],
        ["DebtorHandle", :debtor, proc { |v| v.handle.to_hash }],
        ["Name", :name, nil, :required],
        ["Number", :number],
        ["TelephoneNumber", :telephone_number],
        ["Email", :email],
        ["Comments", :comments],
        ["ExternalId", :external_id],
        ["IsToReceiveEmailCopyOfOrder", :is_to_receive_email_copy_of_order, proc { |v| v || false }, :required],
        ["IsToReceiveEmailCopyOfInvoice", :is_to_receive_email_copy_of_invoice, proc { |v| v || false }, :required]
      ]
    end
240182
def username_validator(self, form, field):
        
        username = field.data
        if len(username) < 3:
            raise ValidationError(
                _('Username must be at least 3 characters long'))
        valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._'
        chars = list(username)
        for char in chars:
            if char not in valid_chars:
                raise ValidationError(
                    _("Username may only contain letters, numbers, '-', '.' and '_'"))
167533
def get_user(self, username):
        
        User = get_user_model()  # noqa
        try:
            user = User.objects.get(**{
                User.USERNAME_FIELD: username,
                'is_active': False
            })
            return user
        except User.DoesNotExist:
            return None
1167440
def unsearchable_fields(self):
        
        filter_func = lambda field: not field.is_searchable
        return filter(filter_func, self.names) + \
               filter(filter_func, self.emails) + \
               filter(filter_func, self.phones) + \
               filter(filter_func, self.usernames) + \
               filter(filter_func, self.addresses) + \
               filter(filter_func, self.dobs)
447590
public List<Charset> getAcceptCharset() {
		List<Charset> result = new ArrayList<Charset>();
		String value = getFirst(ACCEPT_CHARSET);
		if (value != null) {
			String[] tokens = value.split(",\\s*");
			for (String token : tokens) {
				int paramIdx = token.indexOf(';');
				String charsetName;
				if (paramIdx == -1) {
					charsetName = token;
				}
				else {
					charsetName = token.substring(0, paramIdx);
				}
				if (!charsetName.equals("*")) {
					result.add(Charset.forName(charsetName));
				}
			}
		}
		return result;
	}
1240316
def clean(self):
        
        if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
            if self.cleaned_data['password1'] != self.cleaned_data['password2']:
                raise forms.ValidationError(_('The two password fields didn\'t match.'))
        return self.cleaned_data
365791
public function getFields()
    {
        $model = $this->getModelInstance();
        $fields = $model->getFillable();
        $filtered_fields = [];

        foreach ($fields as $f) {
            if ($f !== 'password' && $f !== 'Password') {
                $filtered_fields[] = $f;
            }
        }

        return $filtered_fields;
    }
264164
def get_user_details(self, response):
        """"""
        email = response['email']
        username = response.get('nickname', email).split('@', 1)[0]
        return {'username': username,
                'email': email,
                'fullname': '',
                'first_name': '',
                'last_name': ''}
1249102
def exclude_fields(obj, exclude=EXCLUDE):
  
  return dict([(k, getattr(obj, k)) for k in obj.__slots__ if k not in exclude])