Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread 'Peter Müller' via Django users
If I could I would gladly rewrite the tutorial. But sadly I do not have enough time to do so. However I think it is bad since it not only completely disregards the zen of py but also its own principles (DRY etc.) If you need concrete examples I can name you tons. A quick one is e.g. that there

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread 'Peter Müller' via Django users
I do not think that "Each view is responsible for doing one of two things: Returning an > HttpResponse object containing the content for the requested page, or > raising an exception such as Http404. The rest is up to you." > is easy for a beginner to understand. Also the tutorial directly

Separator between forms in formset factory

2017-01-28 Thread Jeroen van Oorschot
Hi, I'm using a modelformset_factory() for displaying a form multiple times automatically. This works perfect. I would like to have some kind of separator between the individual forms in the page. Now the formsetfactory just shows all forms after eachother, and it can be quite hard too see

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread Vijay Khemlani
> A quick one is e.g. that there is no explanation of what a view is and what > > its purpose is. "The code above maps URLs, as simple regular expressions, to the location of Python callback functions (“views”)" "Each view is responsible for doing one of two things: Returning an HttpResponse

Django Debug Toolbar installation

2017-01-28 Thread Richard Jackson
Hi everyone, I've recently installed the Django Debug Toolbar for local use; I've just pushed the code online and am greeted with the below error: [81.95.157.172] out: Traceback (most recent call last): [81.95.157.172] out: File "", line 1, in [81.95.157.172] out: File

Adding line-level profiling to Django admin functions?

2017-01-28 Thread Derek
I am looking for a way to get detailed profiling information (line-level timing) for custom Django admin functions - especially actions. All the various guides and blog posts seem to deal with adding profiling (e.g. via decorators) to plain Django views, and nothing at all deals with this aspect

Re: Separator between forms in formset factory

2017-01-28 Thread Michal Petrucha
On Sat, Jan 28, 2017 at 04:33:47AM -0800, Jeroen van Oorschot wrote: > Hi, > I'm using a > modelformset_factory() > > for displaying a form multiple times automatically. This works perfect. > > I would like to have some kind of separator between the individual forms in > the page. Now the

Re: file fields

2017-01-28 Thread ludovic coues
The error should give some information on what is going wrong and how to fix it 2017-01-27 23:25 GMT+01:00 ايهاب توفيق : > > Thank you for your reply and I try the fixed model but the problem with the > view that I use to store the files from templets to the db I followed

Re: Django Debug Toolbar installation

2017-01-28 Thread Vijay Khemlani
Did you install debug_toolber on your server? pip install django-debug-toolbar On 1/28/17, Richard Jackson wrote: > Hi everyone, > > I've recently installed the Django Debug Toolbar for local use; I've just > pushed the code online and am greeted with the below error: > >

Re: Separator between forms in formset factory

2017-01-28 Thread Grzegorz Tężycki
How you render your formset. You can add separator in your html template: example: {% for form in formset.forms %} {{ form.as_p }} {% if not forloop.last %} {% endif %} {% endfor %} W dniu sobota, 28 stycznia 2017 15:08:00 UTC+1 użytkownik Jeroen van Oorschot napisał: >

Django shell on django admin site

2017-01-28 Thread Grzegorz Tężycki
Hi everyone. I created small application which can execute python code in django project environment.Maybe someone will be interested and has any suggestions. django-admin-shell: https://github.com/djk2/django-admin-shell -- You received this message because you are subscribed to the Google

Re: Moving from django 1.3 to 1.9

2017-01-28 Thread Alan
Many thanks to you all guys, I will follow this path. Alan On 27 January 2017 at 22:05, bobhaugen wrote: > I agree with all the advice to go a step at a time. > > Here's a bunch of clues and chatter in github issues about how we upgraded > from 1.4 to 1.8, one minor

Signals and dispatch uid

2017-01-28 Thread Melvyn Sopacua
Hello, I'm having a hard time figuring out both from docs and code what the best strategy is for preventing a loop, if in post_save() you need to save the provided instance. I'm implementing an ImageField that is able to handle multiple arbitrary thumbnail images. For that purpose I've

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
Ok that makes sense. Now I have something like this class modelStudentAdmin(admin.ModelAdmin): form = modelStudentAdminForm #Only display students that belong to this user def get_queryset(self, request): qs = super(modelStudentAdmin, self).get_queryset(request) if

limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
I currently have a model that looks like this class modelStudent(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,null=True, blank=True) school = models.ForeignKey(modelSchool) Now I also have a modelStudentAdmin of the above model which basically

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Melvyn Sopacua
On Saturday 28 January 2017 18:21:34 Mike08 wrote: > now my question is in the admin when the user attempts to create a new > modelStudent for the field "user" all available users are shown in > the drop down. My question is if there is a way for me to > limit/restrict that drop down to a certain

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
I am not sure if i understand this are you suggesting that i return a form instead of a queryset ? -- 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

Re: Unclear Debug Message (Bug?) When Invalid Url in Extended Template

2017-01-28 Thread Connor Boyle
Does not appear to be fixed in Django 1.11a1. On Monday, January 23, 2017 at 7:31:22 PM UTC-6, Tim Graham wrote: > > Could you check with Django 1.11a1? This might be fixed in > https://code.djangoproject.com/ticket/27584. > > On Saturday, January 21, 2017 at 6:02:27 PM UTC-5, Connor Boyle