Than How can I achieve my Goal with sqlite and Django ??
Do you have any solution for that ??
On Monday, August 6, 2018 at 10:49:29 PM UTC+5:30, HEMENDRA SINGH HADA
wrote:
>
> Hi Team,
>
> My application using sqlite DB and in my model table class, I have define
> attributes like Below -
>
> class MyUser(AbstractBaseUser):
> email = models.EmailField(
> verbose_name='email address',
> max_length=255,
> unique=True,
> )
> date_of_birth = models.DateField()
> * is_active = models.BooleanField(default=True)*
> * is_admin = models.BooleanField(default=False)*
>
> objects = MyUserManager()
>
> USERNAME_FIELD = 'email'
> REQUIRED_FIELDS = ['date_of_birth']
>
>
> But we I see the same table in sqlite interface, it shows me table
> definition like this-
>
> sqlite> .dump authapp_myuser
> PRAGMA foreign_keys=OFF;
> BEGIN TRANSACTION;
> CREATE TABLE "authapp_myuser" ("id" integer NOT NULL PRIMARY KEY
> AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime
> NULL, "email" varchar(255) NOT NULL UNIQUE, "date_of_birth" date NOT NULL,
> *"is_active"
> bool NOT NULL, "is_admin" bool NOT NULL*);
> COMMIT;
>
> If I am giving is_active field with default value *True*, Then why its
> not showing in *"is_active" bool NOT NULL.*
>
> This case is working fine when I insert any data from GUI application or
> Django admin page, If I try to insert something from sqlite interface, I
> need to pass that default value too.
>
> Please give some suggestion, Because I have requirment where I need to
> insert or update the table values from outside Django App.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/e4102182-823a-4633-8221-431eb358ca69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.