Re: Django formset hidden id field

2015-05-27 Thread Cheng Guo
> Cheers > Matthias > > 2015-05-27 15:47 GMT+02:00 Cheng Guo >: > >> Hello, >> >> I have a formset and when I render it, Django would include this line in >> the HTML: >> >> >> >> I am curious what is the purpose of having an id f

Django formset hidden id field

2015-05-27 Thread Cheng Guo
Hello, I have a formset and when I render it, Django would include this line in the HTML: I am curious what is the purpose of having an id field here. I mean in what situation would you use it. I did look through Django's documentation on formset

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Thank you Daniel, I didn't know this! I am going to lookup how to use session. Thanks! On Monday, 19 January 2015 17:13:10 UTC+8, Daniel Roseman wrote: > > On Monday, 19 January 2015 07:28:14 UTC, Cheng Guo wrote: >> >> Hello, >> >> I am new to Django and I h

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
nd up the same as > the previous value). > > TL;DR; The hash shouldn't be calculated external to the file that is > attached to the object, it should be calculated by the object itself. > > Hope that helps and makes sense... > > -James > > > On Jan 19, 2015

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
bject is > saved, the object itself would create the hash. This way you can save the > object from any view (or from the shell), and it would always generate a > new hash automagically (new meaning recalculated, may end up the same as > the previous value). > > TL;DR; The hash sho

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
@classmethod def save_to_disk(): pass On Monday, 19 January 2015 16:12:28 UTC+8, daniel.franca wrote: > > If the operations are model related, why don't move some of those > functions to models.py. > On Mon 19 Jan 2015 at 08:46 Mike Dewhirst > wrote: > >>

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, thanks! On Monday, 19 January 2015 15:46:40 UTC+8, Mike Dewhirst wrote: > > On 19/01/2015 6:28 PM, Cheng Guo wrote: > > Hello, > > > > I am new to Django and I have run into an issue with views.py. I > > understand that there is a function behind each v

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, thanks! -- 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@goo

Newbie question: How to avoid a very long view function?

2015-01-18 Thread Cheng Guo
Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need to: 1. check the file extension is cor

Re: Unicode character in Django project path

2015-01-18 Thread Cheng Guo
oding/decoding that in not aware of. > > Search through https://code.djangoproject.com/search and see if another > ticket already exists. > > -James > On Jan 18, 2015 7:05 PM, "Cheng Guo" > > wrote: > >> Hello everyone, >> >> I am new to

Unicode character in Django project path

2015-01-18 Thread Cheng Guo
Hello everyone, I am new to this community. I have run into an issue related to Unicode character in project path: http://stackoverflow.com/questions/27996774/unicode-character-in-django-project-path Another user on StackOverflow provided a detailed analysis of what is causing the bug in the l