django create model from dictionary
# create instance of model
m = MyModel(**data_dict)
# don't forget to save to database!
m.save()
django create model from dictionary
# create instance of model
m = MyModel(**data_dict)
# don't forget to save to database!
m.save()
create models in django
from django.db import models
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=50)
email = models.CharField(max_length=50)
contact = models.CharField(max_length=50)
content = models.TextField()
def __str__(self):
return self.name + ' ' + self.email
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us