Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Django pull from Google Sheets

from django.db import models
from gsheets import mixins
from uuid import uuid4

class Person(mixins.SheetPullableMixin, models.Model):
    spreadsheet_id = '18F_HLftNtaouHgA3fmfT2M1Va9oO-YWTBw2EDsuz8V4'
    model_id_field = 'guid'

    guid = models.CharField(primary_key=True, max_length=255, default=uuid4)

    first_name = models.CharField(max_length=127)
    last_name = models.CharField(max_length=127)
    email = models.CharField(max_length=127, null=True, blank=True, default=None)
    phone = models.CharField(max_length=127, null=True, blank=True, default=None)

    def __str__(self):
        return f'{self.first_name} {self.last_name} // {self.email} ({self.guid})'
Comment

PREVIOUS NEXT
Code Example
Python :: python tokenize sentence italian spacy 
Python :: how to make a square multicolor square spiral python 
Python :: how to create simple window in wxPython 
Python :: how to accept invalidfileexception in python 
Python :: find-squares-and-odd-numbers-in-the-given-list 
Python :: Python docx title 
Python :: django force download file 
Python :: python find if strings have common substring 
Python :: How can I use Apache Spark with notebook in Anaconda 
Python :: mechanize python XE #25 
Python :: ~coinbase api 
Python :: pandas get only entries that match list 
Python :: create list 
Python :: multiplication objects 
Python :: install python3 yum centOS redhat 
Python :: # swap variables 
Python :: for _ in range python 
Python :: pairplot legend position 
Python :: R[~i] in python 
Python :: pyttsx3 Using an external event loop¶ 
Python :: BIDS extract JSON data 
Python :: add Elements to Python list Using extend() method 
Python :: maximum of a list in python recursively 
Python :: basic kivy md 
Python :: python adding an item 
Python :: python ordereddict initialization 
Python :: Python NumPy rollaxis Function Syntax 
Python :: how to extract a list of values from numpy array using index list 
Python :: Python NumPy dstack Function Example 02 
Python :: python increase a value every n rows 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =