public function createFormForModel(string $classname, DAO $dao)
    {
        if (!is_a($classname, Model::class, true))
            throw new \InvalidArgumentException("Not a valid Model class provided");

        $form = new Form($classname);
        $refl = new ReflectionClass($classname);
        $fields = $this->getAnnotatedFields($refl, []);

        $columns = $dao->getColumns();
        foreach ($columns as $name => $coldef)
        {
            if (isset($fields[$name]))
                continue;

            // Ignore serial columns
            if ($coldef->getSerial())
                continue;

            $validator = function ($value) use ($classname, $coldef)
            {
                return $classname::validate($coldef, $value);
            };

            $type = new Validator(Type::VALIDATE_CUSTOM, ['custom' => $validator]);
            $field = new FormField($name, $type, 'text', null); 

            $fields[$name] = $field;
        }

        foreach ($fields as $name => $field)
            $form->add($field);

        $this->addFormValidators($refl, [], $form);
        return $form;
    }