how to wring the python models code

  Python

Email

from django.db import models

class Api(models.Model):
    name = models.CharField(max_length=30)
    lasnname = models.CharField(max_length=50)
    lasnname = models.CharField(max_length=30)
    phonenumber = models.CharField(max_length=30)

    def __str(self):
        return  self.name + '----'+self.lasnname

class Song(models.Model):
    movie = models.ForeignKey(Api, on_delete=models.CASCADE)
    file_type = models.CharField(max_length=50)
    song_name = models.CharField(max_length=30)


class emplist(models.Model):
    name = models.CharField(max_length=20)
    title = models.TextField()
    body = models.SlugField()
    createdata = models.DateTimeField(auto_now=True)
    author = models.ForeignKey(Api, on_delete=models.CASCADE)
Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of