Fixes on PasswordForm

This commit is contained in:
Antonio de la Rosa 2015-08-26 00:32:20 +02:00
parent 528d5a2d48
commit 7dbe80697e
7 changed files with 76 additions and 18 deletions

View file

@ -76,6 +76,27 @@ class EmailField extends PhangoField {
return $value;
}
/**
* By default primaryfield use a hidden form
*/
public function create_form()
{
/*$form=new PasswordForm($this->name_component, $this->value);
$form->default_value=$this->default_value;
$form->required=$this->required;
$form->label=$this->label;
$form->type='password';*/
$form=parent::create_form();
$form->field=new EmailField();
return $form;
}
}

View file

@ -35,7 +35,6 @@ class ForeignKeyField extends IntegerField{
$this->fields_related_model=array();
//Representative field for related model...
$this->name_field_to_field='';
$this->null_relation=$null_relation;
$this->default_id=$default;
$this->quot_open='';
$this->quot_close='';

View file

@ -9,7 +9,7 @@
*/
namespace PhangoApp\PhaModels\CoreFields;
use PhangoApp\PhaModels\Forms\BaseForm;
use PhangoApp\PhaModels\Forms\PasswordForm;
use PhangoApp\PhaUtils\Utils;
class PasswordField extends CharField {
@ -72,7 +72,7 @@ class PasswordField extends CharField {
public function create_form()
{
$form=new BaseForm($this->name_component, $this->value);
$form=new PasswordForm($this->name_component, $this->value);
$form->default_value=$this->default_value;
$form->required=$this->required;
$form->label=$this->label;