Re: ModelForm, ImageField and User

2007-12-28 Thread l5x
On Dec 27, 8:22 am, Muchanic <[EMAIL PROTECTED]> wrote: > Just FYI and for anyone else who comes across this thread - I had the > same problem, trying to pass a ForeignKey via HiddenInput in an app > I'm working on. If you need to/want to do it this way, the trick is > that you have to use a Mode

Re: ModelForm, ImageField and User

2007-12-26 Thread Muchanic
Just FYI and for anyone else who comes across this thread - I had the same problem, trying to pass a ForeignKey via HiddenInput in an app I'm working on. If you need to/want to do it this way, the trick is that you have to use a ModelChoiceField and not an IntegerField for Django to be able to do

Re: ModelForm, ImageField and User

2007-12-25 Thread l5x
Thank you, I will check that. I wasn't aware of that possibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: ModelForm, ImageField and User

2007-12-24 Thread lispingng
i think you should look at using threadlocals to access users outside the request instead of sending the user id in a hidden field. http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser quite straightforward On Dec 24, 2:10 am, l5x <[EMAIL PROTECTED]> wrote: > class Photo(models.Model):

ModelForm, ImageField and User

2007-12-23 Thread l5x
class Photo(models.Model): user = models.ForeignKey(User) main = models.BooleanField(_('Is main?')) icon = models.ImageField(_('Icon'), upload_to='photo', null=True, blank=True, help_text=_('Don\'t touch! It will be generated automatically')) medium = m