This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read file | |
with open('names.txt') as f: | |
file_data = f.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
from django.conf import settings | |
import csv | |
from bah_api.models import withDependents, withOutDependents, ZipMHA | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
# Populate CSV file into model | |
def LoadCSV(file_location, my_model, delim): | |
f = open(file_location) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model finance.rb | |
class Finance < ActiveRecord::Base | |
# Attributes | |
attr_accessible :amount, :date, :description, :type | |
# Associations | |
belongs_to :users, :dependent => :destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model finance.rb | |
class Finance < ActiveRecord::Base | |
attr_accessible :amount, :date, :description, :type | |
belongs_to :users, :dependent => :destroy | |
end | |
# model income.rb |
NewerOlder