Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

python - Django: standard location/conventions for data import scripts? -


i'm working on number of django projects, , in of them, have initial data import.

this data isn't neat json, shown in fixture examples in django docs - tends messy excel or csv files. scripts tend following snippet, , run them standalone python, because don't know better:

import sys django.core.management import setup_environ sys.path.append(location of django projects, ex: 'c:\django') mysite import settings setup_environ(settings)  project_name.app_name.models import model_name  import csv reader = csv.reader(open(complete path data, ex: "c:/django/mysite/restaurants.csv"), dialect='excel')  row in reader:    column_one_title = row[0]    column_two_title = row[1]     model_name.objects.get_or_create(my_first_column=column_one_title, my_second_column=column_two_title) 

i feel when commit these projects github or send them client or whatever, should include import scripts. they're important part of project.

is there standard way, in django, store import scripts i've written import data?

where in project should sit? should using management commands?

thanks!

i putting them in management commands - way when else works on project, commands they're expected wasn't familiar choices being made during initial development.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -