Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Django Example

from django.db import models

class Reporter(models.Model):
    full_name = models.CharField(max_length=70)

    def __str__(self):
        return self.full_name

class Article(models.Model):
    pub_date = models.DateField()
    headline = models.CharField(max_length=200)
    content = models.TextField()
    reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE)

    def __str__(self):
        return self.headline
Comment

django sample

$ django-admin startproject mysite
Comment

PREVIOUS NEXT
Code Example
Python :: python regular expression 
Python :: keras conv2d batchnorm 
Python :: python list object ids 
Python :: Python Selenium import WebElement 
Python :: python parcourir ligne 
Python :: python create temp file 
Python :: os path splitext 
Python :: python if null 
Python :: merge two dictionaries 
Python :: how to write to a specific line in a file python 
Python :: python inject into process 
Python :: one liner if else replacement in python 
Python :: What is the use of f in python? 
Python :: how to convert numpy array to cv2 image 
Python :: create numpy array with ones 
Python :: scroll to element selenium python 
Python :: change xticks python 
Python :: set and tuple in python 
Python :: int to char python 
Python :: python get 2d array output as matrix 
Python :: how to make python code faster 
Python :: for loop get rid of stop words python 
Python :: pytest local modules 
Python :: decrypt vnc password 
Python :: python create file in current directory 
Python :: no module named googlesearch 
Python :: django orm group by month and year 
Python :: logging.basicConfig() 
Python :: python list of whole numbers 
Python :: load static 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =