On Saturday, October 18, 2014 10:05:11 PM UTC-7, Jon Joseph wrote:
>
>
>     def __str__(self):
>         return self.problem_number + '\n' + self.problem_statement
>

I don't like this idea of sticking a new line into a string representation. 
Do you really want a new line crammed into every possible situation where a 
string repr might appear? Feels like "code smell" to me. Does the problem 
go away if you replace the \n with a hyphen or something? 
 

>
> I would like to populate the database by using the PostgreSQL specific 
> command:
>
> COPY solutions_problemlist from 'filename'  
>

Rather than using pg's COPY command, I recommend writing an actual Django 
import script to parse your tab-delim file and import via the ORM. It'll be 
more automatable, part of your code repo, and more Django-like. You could 
also do it as a migration if you just need it to happen once.

./s

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d350010b-20a9-4821-9a0a-0f8f6ca7b6a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to