Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Model create #67

Closed
gonboy opened this issue Jun 15, 2016 · 4 comments
Closed

About Model create #67

gonboy opened this issue Jun 15, 2016 · 4 comments

Comments

@gonboy
Copy link

gonboy commented Jun 15, 2016

tspawn model user

So in Controller, I write :

eg : It couldn't create a new User in mysql
is it all right?

void register(void)
{
    User user;
    user.setEmail("email");
    user.setActive(0);
    if(!user.create())
        qDebug() << "false";     //always false
    else
        qDebug() << "true";
}

but

User user = User::get("email"):
user.setName("xxx");
user.save();   //it's OK
user.remove(); //it's OK
@gonboy gonboy changed the title About Model creat About Model create Jun 15, 2016
@gonboy
Copy link
Author

gonboy commented Jul 25, 2016

tspawn model user

So in Controller, I write :

eg : It couldn't create a new User in mysql
is it all right?

void register(void)
{
    User user;
    user.setEmail("email");
    user.setActive(0);
    if(!user.create())
        qDebug() << "false";     //always false
    else
        qDebug() << "true";
}

@treefrogframework
Copy link
Owner

Check log files.
May find error logs.

@gonboy gonboy closed this as completed Nov 4, 2016
@gonboy
Copy link
Author

gonboy commented Nov 4, 2016

ok

@gonboy gonboy reopened this Nov 4, 2016
@gonboy
Copy link
Author

gonboy commented Nov 4, 2016

ok

@gonboy gonboy closed this as completed Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants