Python Forum
How do I make a Django model from a tab-delimited data file?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I make a Django model from a tab-delimited data file?
#1
I have a tab-delimited data file that looks something like this:


[inline] NAME S1903_C02_001E state county tract State-County-Tract-ID
Census Tract 201, Autauga County, Alabama 66000 01 001 020100 01001020100
Census Tract 202, Autauga County, Alabama 41107 01 001 020200 01001020200
Census Tract 203, Autauga County, Alabama 51250 01 001 020300 01001020300[/inline]

I want to make a Django model named MyModel with three columns: "name", "data", and "geoid", which correspond to the file's columns "NAME", "S1903_C02_001E", and "State-County-Tract-ID." Can I do this via command line, or with a custom Python script? I'm running my Django project locally on a computer running Debian 9.3.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Django: View is unable to find attributes of database model pythonpaul32 0 480 Dec-07-2023, 06:38 PM
Last Post: pythonpaul32
  Querying Django model db - from Jose Portilla’s Udemy course Drone4four 2 1,657 Aug-09-2022, 09:25 AM
Last Post: Addweb
  Save JSON data to sqlite database on Django Quin 0 2,804 Mar-26-2022, 06:22 PM
Last Post: Quin
Photo After using models.Model on my class Im getting 'ImproperlyConfigured' error Django khavro 1 2,150 Apr-05-2021, 03:11 PM
Last Post: SheeppOSU
  DJANGO Looping Through Context Variable with specific data Taz 0 1,780 Feb-18-2021, 03:52 PM
Last Post: Taz
  creating an exe file for a python django project Sanjish 0 2,585 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  Open and read a tab delimited file from html using python cgi luffy 2 2,633 Aug-24-2020, 06:25 AM
Last Post: luffy
  How to make data coming from a database clickable giving more details newbie1 8 3,670 May-29-2020, 11:19 PM
Last Post: newbie1
  [Django] css file is not applying to the page SheeppOSU 1 3,029 May-09-2020, 06:54 AM
Last Post: menator01
  [Django]calculate value in model smabubakkar 0 1,627 Apr-15-2020, 03:40 PM
Last Post: smabubakkar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020