Issue in Django count string in a template

2015-02-12 Thread Ronaldo Bahia
I am facing issues trying to get a count. Hope you can help me. In the template, if I insert {{ message.count }} not happens 'coz message is a string. If I insert {% load inbox %} {% inbox_count as message %} it returns all unread messages, but I need to get the unread messages sent by a give

Re: Issue in Django count string in a template

2015-02-12 Thread Ronaldo Bahia
of applying .count() to it, as a template context variable, say > "unread_message_count". > > On Thu, Feb 12, 2015 at 1:06 PM, Ronaldo Bahia > wrote: > >> I am facing issues trying to get a count. Hope you can help me. >> >> In the template, if I inser

How to filter results using forms in Django/Python (best approach) ?

2015-02-20 Thread Ronaldo Bahia
I'm kind of new in python/django and I'd like to know: What's the best approach to filter results in Django using forms in a view? I need to filter candidates by haircolor, according to the model CandidateLook and by status, according to CandidateToJob model. Thanks in advance. Here is my co

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-21 Thread Ronaldo Bahia
> > > {{ form.as_p }} > > > > (the code above just creates, displays and submits the form, it does not > filter your results yet) > > On Fri, Feb 20, 2015 at 5:10 PM, Ronaldo Bahia > wrote: > >> I'm kind of new in python/django and I&#

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-22 Thread Ronaldo Bahia
l().order_by('candidate') > > candidates = [] > for candidate in job_candidates: > candidate.messages_sent = > sent_messages.get(candidate.candidate.user.id) > candidates.append(candidate) > context['candidate_list&#x

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-22 Thread Ronaldo Bahia
7;) > > candidates = [] > for candidate in job_candidates: > candidate.messages_sent = sent_messages.get( > candidate.candidate.user.id) > candidates.append(candidate) > context['candidate_list'] = candidates >

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-23 Thread Ronaldo Bahia
I have just updated my code in stackoverflow: http://stackoverflow.com/questions/28637326/how-to-filter-results-using-forms-in-django-best-approach *Ronaldo Bahia * Diretor | JobConvo.com Tel: 11 3280 6971 2015-02-22 23:16 GMT-03:00 Vijay Khemlani : > Well, I think you can continue posting

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-23 Thread Ronaldo Bahia
e other filter > > job_candidates = job_candidates.filter(status=self.cleaned_data['status']) > > But you should ble able to detect that kind of errors, those are Python > things, not something specifically about Django. > > > > > On Mon, Feb 23, 2015 at 7:40 AM, Ronaldo Bah

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-23 Thread Ronaldo Bahia
e particular > one the user is seeing on the view (the one that is passed to the form > method). > > > > > On Mon, Feb 23, 2015 at 12:31 PM, Ronaldo Bahia > wrote: > >> Oh, I'm feeling stupid right now :D >> >> now my new error: >

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-25 Thread Ronaldo Bahia
Hi Kirby, It seems very interesting. I'll let you know if I try it. Just for curiosity, what differentiates your project from django-filters or django-datafilters ? Thanks. *Ronaldo Bahia * 2015-02-24 12:57 GMT-03:00 C. Kirby : > I'm sorry I missed this thread at the beginning.

Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
Hi every one. Can you help me in this? http://stackoverflow.com/questions/29413107/django-modelform-object-has-no-attribute-cleaned-data-for-m2m-through Thanks in advance Ronaldo -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
inta-feira, 2 de abril de 2015 09:44:44 UTC-3, Vijay Khemlani escreveu: > > Call form.is_valid() (and check that it returns True) before accessing > form.cleaned_data > > On Thu, Apr 2, 2015 at 9:36 AM, Ronaldo Bahia > wrote: > >> >> Hi every one. >> >> Can you he

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
Dont know why but I still get the same error Ronaldo Bahia > Em 02/04/2015, às 10:50, Vijay Khemlani escreveu: > > In your Form class "job" is a ChoiceField, and it returns a primitive value > (such as "2") when cleaned. > > You would need to convert i

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
updated http://stackoverflow.com/questions/29413107/django-modelform-object-has-no-attribute-cleaned-data-for-m2m-through/29417768#29417768 *Ronaldo Bahia * Diretor | JobConvo.com Tel: 11 3280 6971 2015-04-02 13:15 GMT-03:00 Vijay Khemlani : > post your updated code > > On Thu, Apr 2

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
No. This line: job = Job.objects.get(id=form.cleaned_data['job']) If I change my form to get job__id: cojobs=Company.objects.select_related('job__id').values_list('job__id', flat=True) The error is still that line but a different message: Job matching query does

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-02 Thread Ronaldo Bahia
Sorry. It is if form.is_valid(): The line providing the error *Ronaldo Bahia * Diretor | JobConvo.com Tel: 11 3280 6971 2015-04-02 13:39 GMT-03:00 Ronaldo Bahia : > No. > This line: > > job = Job.objects.get(id=form.cleaned_data['job']) > > If I change my for

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-04 Thread Ronaldo Bahia
SOLVED http://stackoverflow.com/questions/29413107/django-modelform-object-has-no-attribute-cleaned-data-for-m2m-through/29446017#29446017 Thanks Vijay for helping me Regards, Ronaldo Em quinta-feira, 2 de abril de 2015 09:36:29 UTC-3, Ronaldo Bahia escreveu: > > > Hi every one. &g

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-05 Thread Ronaldo Bahia
eld(required=True, widget=forms.RadioSelect(attrs={'class': ''}), choices=STATUS_CHOICES) def save(): job = self.cleaned_data['job'] status = self.cleaned_data['status'] ctj = CandidateToJob( job = job, status = s

Re: Help with: Django 'ModelForm' object has no attribute 'cleaned_data' for M2M through

2015-04-06 Thread Ronaldo Bahia
;, 'Contratado') ) status = forms.ChoiceField(required=True, widget=forms.RadioSelect(attrs={'class': ''}), choices=STATUS_CHOICES) def save(): job = self.cleaned_data['job'] status = self.cleaned_data['status'] ctj = CandidateToJob( job = job, st

AWS ElasticBeanstalk update without modifying Django wsgi.conf

2016-08-26 Thread Ronaldo Bahia
I have a django app deployed in AWS EB using autoscaling. This app uses Django Rest with Token Authentication. In order for this to work, I have to add the following lines in etc/httpd/conf.d/wsgi.conf file: RewriteEngine onRewriteCond %{HTTP:Authorization} ^(.*)RewriteRule .* - [e=HTTP_AUTHO

Re: AWS ElasticBeanstalk update without modifying Django wsgi.conf

2016-08-29 Thread Ronaldo Bahia
Thanks a lot. I will test it and let you know the results. Best regards *Ronaldo Bahia* 11 3280 6971 11 963 622 581 *Materiais gratuitos para o RH:* - Melhorando Indicadores no RH <http://t.sidekickopen06.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs2zqkV8N4XXLC2d_McxW64QWwH56dPQWf2rrsL

Django Rest Create with a Writable Nested Serializer

2016-09-09 Thread Ronaldo Bahia
Hi everyone, I'm trying to perform a create in Django Rest Framework using a writable nested serializer. With the code bellow I can create a ScriptQuestion but I can't add a RecordedInterview into it. Django says OrderedDict is None. What am I doing wrong? Thanks in advance Thread: http

Python call Java causes Error: Could not find or load main class

2016-11-08 Thread Ronaldo Bahia
down votefavorite Hi, I am having issues to use the java program https://github.com/antonydeepak/ResumeParser/ in Django project in a localserver in MAC OS. I have installed Resume

Django query in DetailView

2014-10-29 Thread Ronaldo Bahia
*This question is also in http://stackoverflow.com/questions/26635406/django-query-in-detailview I have DetailVIew wich returns a list of related objects (m2m throught). It works just fine! But I need to search for objects'names and it is returning all objects instead of only the related ones.

Django auto fill recipient in Django_messages

2014-11-07 Thread Ronaldo Bahia
I'm building a job board and I'm using django_messages for private messages. It works great but I want to auto fill the recipient form field with the username and I don't know why. Some thoughts? http://stackoverflow.com/questions/26804088/django-auto-fill-recipient-in-django-messages Thanks

Re: Django auto fill recipient in Django_messages

2014-11-13 Thread Ronaldo Bahia
Thanks for answering, but it was solve by myself as posted in here: http://stackoverflow.com/questions/26817483/django-cannot-assign-uusername-message-recipient-must-be-a-user-instanc *Ronaldo Bahia * Diretor | JobConvo.com Tel: 11 3280 6971 2014-11-12 18:57 GMT-02:00 Collin Anderson

Django Python OSError No such file or directory but file exists

2017-08-01 Thread Ronaldo Bahia
Hi everyone, can you help me? Thanks in advance Thread: https://stackoverflow.com/questions/45449102/django-python-oserror-no-such-file-or-directory-but-file-exists Code: down votefavorite

Re: Django Python OSError No such file or directory but file exists

2017-08-04 Thread Ronaldo Bahia
here is no absolute path. How can I solve it? Thanks *Ronaldo Bahia* +55 11 3280 6971 +55 11 963 622 581 *Materiais gratuitos para o RH:* - ROI - Melhorando Indicadores no RH <http://blog.jobconvo.com/post/110644747055/o-impacto-das-entrevistas-virtuais-no-recrutamento?from=email> - Manu

Re: Django Python OSError No such file or directory but file exists

2017-08-07 Thread Ronaldo Bahia
SECRET_ACCESS_KEY) bucket_out = Bucket(conn, settings.AWS_STORAGE_BUCKET_NAME) k_out = Key(bucket=bucket_out, name=user_cv.resume) # Upload to S3 k_out.set_contents_from_filename('cv.pdf') k_out.make_public() # deleta o arquivo localmente

Re: Django Python OSError No such file or directory but file exists

2017-08-07 Thread Ronaldo Bahia
Turns out unoconv takes 2 seconds to perform the file conversion. So after the file conversion, I had to set time.sleep(3) before upload a file to S3. And after 1 week I got this working using variables. Thanks *Ronaldo Bahia* +55 11 3280 6971 +55 11 963 622 581 *Materiais gratuitos para o RH

Re: Django Python OSError No such file or directory but file exists

2017-08-07 Thread Ronaldo Bahia
thanks a lot: p = subprocess.Popen(('someprog.exe', str(i)) p.wait() *Ronaldo Bahia* +55 11 3280 6971 +55 11 963 622 581 *Materiais gratuitos para o RH:* - ROI - Melhorando Indicadores no RH <http://blog.jobconvo.com/post/110644747055/o-impacto-das-entrevistas-virtuais-no-recr