Minify HTML in Django

2016-10-31 Thread Web Architect
Hi, Is there an optimal and efficient way to minify HTML in Django? I tried using django-htmlmin but it's affecting the performance. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: Form Saving Related Issues

2016-10-31 Thread pradam programming
Thank you sir for the reply.. But I am using HTML forms then what should I do...? I want error message should display instantly when user enter existing mail id..! On 1 Nov 2016 12:05 am, "Andromeda Yelton" wrote: > If your model has the uniqueness constraint, you should get a form error > mess

BaseInlineFormSet with unique_together Model

2016-10-31 Thread Matthew Pava
Good day, I am new to this list, but I would like to understand better what is going on and how I can fix it the Django way. I have a model similar to the ingredients list of a recipe. class FoodItem(models.Model): name = models.CharField() class Recipe(models.Model):

Updating mixin subclassed instances

2016-10-31 Thread Radek Svarz
Hi, I am using my custom permission mixin on several of my apps's models (not all). For the case when I need to merge from the "old - context" permission to the "new - context" permission I want to have function which changes the corresponding permission reference attribute in all models, whic

Re: Form Saving Related Issues

2016-10-31 Thread Andromeda Yelton
If your model has the uniqueness constraint, you should get a form error message automatically. If you don't want your model to have that constraint but you still want your form to throw an error message, you can add a clean_ and a clean_ function that check for uniqueness and raise ValidationError

Re: Redirect after Form

2016-10-31 Thread Moreplavec
Many thanks, works fine and looks much better to me. Dne pondělí 31. října 2016 10:21:37 UTC+1 Michal Petrucha napsal(a): > > On Sun, Oct 30, 2016 at 06:39:19AM -0700, Moreplavec wrote: > > I found in Django Tutorial solution: > > https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : > >

Re: Using django pagination or slicing

2016-10-31 Thread ADEWALE ADISA
Thanks fedowag. On Oct 31, 2016 12:01 PM, "王安刚" wrote: > hi > i prefer method 2 > > you can get all the list from db and store it in redis using zadd > each time an ajax request comes, you get the data you need using zrange > > > 在 2016年10月31日星期一 UTC+8上午9:05:07,ADEWALE ADISA写道: >> >> Hello, >> Pl

Re: Using django pagination or slicing

2016-10-31 Thread ADEWALE ADISA
Thanks very much Ludovic for the advice. On Oct 31, 2016 9:53 AM, "ludovic coues" wrote: > I would use 1 + 2 from your list. > > 3 might work on 1000 record, depending on how much data there is per > record. But if you grow to more than 10,000 record, the page loading > can take minutes. I have e

Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-31 Thread Stefano Probst
You could use a whole deployment setup. Forward Django though nginx by using WSGI (Gnuicorn, etc). Then everything should work. -- 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, se

Re: Using django pagination or slicing

2016-10-31 Thread 王安刚
hi i prefer method 2 you can get all the list from db and store it in redis using zadd each time an ajax request comes, you get the data you need using zrange 在 2016年10月31日星期一 UTC+8上午9:05:07,ADEWALE ADISA写道: > > Hello, > Please I need an advice on the best approach to take on the following > i

Form Saving Related Issues

2016-10-31 Thread pradam programming
Hi, Please I need an advice on the best approach to take on the following issues. I have create a form to save user details like first name,last name,email,mobile number etc... 1.Now I need to show error message (In Models i gave email and mobile no field as unique = True) when user enter a email

Re: Redirect after Form

2016-10-31 Thread Michal Petrucha
On Sun, Oct 30, 2016 at 06:39:19AM -0700, Moreplavec wrote: > I found in Django Tutorial solution: > https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : > > Now i have: > > return HttpResponseRedirect(reverse('crm:company_detail', args=(company.pk,))) > #return redirect('views.company_de

Re: Using django pagination or slicing

2016-10-31 Thread ludovic coues
I would use 1 + 2 from your list. 3 might work on 1000 record, depending on how much data there is per record. But if you grow to more than 10,000 record, the page loading can take minutes. I have experienced that issue with two different project. Django pagination by itself won't give you the in