Friday, January 30, 2015

Re: Best Practices Model Design

Hi,

I'm quite new to Django myself. I doubt anyone is going through your whole Models File. You should have at least copy & pasted it from some kind of IDE to preserve the indention level.

As for your other questions about the url to user-/profilename, have you looked at the tutorial: https://docs.djangoproject.com/en/1.7/intro/tutorial03/
There the urls.py is explained. In their example question_id is used, but I bet you could use something else as well. Or go with the user_id (that's what I did, of course doesn't look so pretty).

And about the file upload - I didn't rename the files yet, but it's good practice, so I looked up the documentation and apparently you can overwrite the filename. I will have to try this out too later: https://docs.djangoproject.com/en/1.7/ref/models/fields/#django.db.models.FileField

--
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+unsubscribe@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/8ba0d61e-4374-4391-b7c9-45b49253499d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment