Re: HELP - Django variable in style (width) attribute

2016-10-15 Thread Constantine Covtushenko
Hi Aline, It is not direct answer for what you are asking, but why do you calculate the percentage 2 times? Why just use `with ` tag? With it nor problem at all. Hope that helps. Regards, Constantine C. On Sun, Oct 16, 2016

A Backup Model in Django?

2016-10-15 Thread Bernd Wechner
A curious question I've had trouble finding an answer for alas. I have a model that I'd like to backup in the database in a backup model. This being the pro-forma so to speqk: from django.db import models class MyModel(models.Model): # Declare fields class MyModel_backup(MyModel): def c

Re: HELP - Django variable in style (width) attribute

2016-10-15 Thread James Schneider
> Why the template tag call {% get_percentage question.pk choice.pk %} works inside the span tag, but doesn't work in style (width) attribute? > > What is wrong? > No idea. You haven't provided what your template tag does, or what the rendered template looks like. What does the final HTML look li

HELP - Django variable in style (width) attribute

2016-10-15 Thread Aline C. R. Souza
Hello Guys, favorite Why the template tag call {% get_percentage question.pk choice.pk %} works inside the span tag, but doesn't work in style (width) attribute? What is wrong? {% for choice in question.c

Re: HELP - Writing your first Django app, part 1

2016-10-15 Thread Armando Licurgo
criar arquivo vazio em unixlike use touch nome_do_arquivo Armando Licurgo Software Developer 2016-10-14 18:44 GMT-03:00 Asad Jibran Ahmed : > Just save the file inside the *poll *folder. That creates the file. > > Asad Jibran Ahmed > http://blog.asadjb.com > > On Fri, Oct 14, 2016 at 9:55 PM,

Re: NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-15 Thread Aline C. R. Souza
Thank you for your time, Constantine. I gave up on following this path. I threw away everything that I did on this matter, and I followed the steps of this link: http://django-haystack.readthedocs.io/en/v2.5.0/tutorial.html It took me some time to understand, but now it is working fine. Than

Re: Dynamic choice option for select filed in Multivaluefield

2016-10-15 Thread Constantine Covtushenko
Hi Saranya, Please try in TestForm > self.fields['t'].fields[1].widget.choices = ((1,1),) Hope it helps On Fri, Oct 14, 2016 at 9:31 AM, saranya k wrote: > I want to set choices for ChoiceField in MultiValueField in form init. But > its not getting updated. > class TestField(forms.MultiValueF

Re: NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-15 Thread Constantine Covtushenko
Hi Aline, I did not use Haystack but I am using ElastickSearch. I carefully read you post on StackOverflow and see that search form returns author of the post without `pk` key defined. Did you check what is returned by ElastickSearch? May be your SearchForm returns exactly what Elastick stores in