Re: I'm moving to Oxford
Glad you let the whole Django community know ;) On 09-01-14, at 08:52, "Will McGugan"wrote: > Hi, > > I'm sending this out to everyone in my gmail contacts, because I'm > lazy. Apologies if you don't need to know this. > > I'm moving to Oxford tomorrow (Thursday 15th). Please get in touch > if you need my new address. My landline will change, but you can > always get me on my mobile. > > I wont have internet access at home from tomorrow, so apologies if > emails go unanswered till I get broadband again! > > So long, London! > > Will > > -- > Will McGugan > http://www.willmcgugan.com > > > --~--~-~--~~~---~--~~ 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 from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: request.FILES always empty
Thank you On Mon, Jan 5, 2009 at 3:39 PM, Alex Koshelev <daeva...@gmail.com> wrote: > > You don't set proper `enctype` to the form [1] > > [1]: > http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form > > > On Mon, Jan 5, 2009 at 11:34 PM, Glimps <mjsdes...@gmail.com> wrote: > > > > I'm using ModelForm to render my form. I have a FileField in my model > > that shows up as a type="file" on my page. Thing is, even if I select > > a file to upload Django always complains about the field being empty > > and my form never validates. > > > > Here's my model: > > > > class IOs(models.Model): > >name= models.CharField(max_length=50) > >desc = models.TextField() > >target = models.FileField(upload_to="io/uploads/", max_length=40) > >ident = models.CharField(max_length=255) > > > > My model form: > > class IOsForm(ModelForm): > >class Meta: > >model = IOs > > > > here's my snippet to validate the form: > > > >if request.method == 'POST': > >form = IOsForm(request.POST, request.FILES) > >if form.is_valid(): > >form.ident = getNewID() > >form.save() > > > > When I check for request.FILES after posting I get " >>" > > This is the code I use to render the template > > > > id="new_io_form"> > > > >{{ html_form.as_ul }} > > > > > > value="Submit" name="btn_submit" > > id="bnt_submit" /> > > > > > > > > I'm quite sure I'm doing a newbie mistake, just can't figure out what. > > > > > > > > > -- Marc Boivin Dévelopeur/Intégrateur Web MA14.com 418-803-7139 --~--~-~--~~~---~--~~ 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 from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Admin: design question
Keith Eberle wrote: >Maybe you can do something similar to what's in this post (using queryset): >http://groups.google.com/ > > > group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst=restrict+users+to+their+own+data#a07cabfb4725447d It is valid, tested and working on Django 1.0. I have it working. It is not documented, you need to search in the source code to get around it. If you are to try this method, only consider this. The query set method should look like this: def queryset(self, request): qs= super(Admin_Class_Of_Your_Model, self).queryset(request) return qs.filter(user = request.user) On 9/13/08, Gertjan Klein <[EMAIL PROTECTED]> wrote: > > > Keith Eberle wrote: > > >Maybe you can do something similar to what's in this post (using > queryset): > > > http://groups.google.com/group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst=restrict+users+to+their+own+data#a07cabfb4725447d > > > Is that still valid? I can find no documentation for a queryset method > on the ModelAdmin class here: > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/ > > I added one regardless to my ProjectCodeAdmin class: > > class ProjectCodeAdmin(admin.ModelAdmin): > def queryset(self, request): > return super(ProjectCodeAdmin, self).filter( > Customer= request.Customer) > > but it seems to be ignored. (I also wonder -- is this supposed to get > called *everywhere* I need a ProjectCode dropdown? Even if there is no > Customer on that page, and hence the request? ...) > > That said, placing it there feels wrong. IIUC, a site-specific admin.py > and ModelAdmin instances are ment to tweak the admin interface. Limiting > the list of ProjectCodes in the dropdown can be done there, but > resticting the allowed ProjectCodes should be done in the model. Doesn't > that mean the code now has to be written twice? > > My biggest worry, though, is updating the user interface if a new or > different Customer is selected. I have seen no suggestions yet that > admin is able to cope with that without too much intervention on my > part... Hopefully that's because people knowing it can, and how, are > currently busy with more important stuff like going out and having fun. > ;) > > > Regards, > Gertjan. > > -- > Gertjan Klein <[EMAIL PROTECTED]> > > > > > --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---