Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
Is there any bootstrap hack to fix this ?? -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send

Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
yes, it should be ok i will check that link -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, s

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-22 Thread Dylan Reinhold
Andrew, You do not to get the field with _meta.get_field just use setattr which takes a string as the field name. Now if you are creating a new instance of your model and are just passing a single field all other fields would need to have defaults or be null=True. In your do stuff area you can

Re: modelform DateField rendering as text

2018-01-22 Thread Costja Covtushenko
Hi, Do you mean that it should be rendered like: ? If so check that documentation page . It is said that DateInput renders as type=’text’. If you are curios why it is done in that way, please ask at: django-develo

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-22 Thread Tom Tanner
Darn, is this possible with a new object of the model? My idea is to in the end let the user input information that will be made into a new record to add to the model. But I need the user to type in the model they want to use... On Monday, January 22, 2018 at 1:09:53 PM UTC-5, Andrew Standley w

Re: Django 1.5 tutorial error: 'module' has no attribute 'StackedInLine'

2018-01-22 Thread Richard Roberts
Awesome Spot Karen. On Wednesday, 27 March 2013 15:48:18 UTC, Karen Tracey wrote: > > On Wed, Mar 27, 2013 at 11:32 AM, +Emmanuel > wrote: > >> Hello there, >> >> I am working through the django tutorial at djangoproject.com. So far >> everything works out fine until Section 2.4.6 (customizing

Re: django-payslip

2018-01-22 Thread sum abiut
Thanks for response. Manage to load the page this time. Cheers On Mon, Jan 22, 2018 at 3:59 PM, Ramiro Morales wrote: > The detailed error page is giving you all the information you need to > diagnose the issue. > > It tells you you have two paths defined in your URL map: /admin/ and > /payslip

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-22 Thread Andrew Standley
Hey Tom,     First you'll need to create or get a particular instance of your model using one of it's managers  `model.objects` and a query. Ex for a model with a unique 'name' charfield: `model_obj = model.objects.get(name='MyObject')` You can then use the column_name to set that attribute on

Re: Need to create an edit box connected to one table field

2018-01-22 Thread eileen
Yes, I use Form. Here's it's contents: from django import forms from .widgets import ChainedSelectWidget from .models import Child class SponsorForm(forms.Form): child = forms.IntegerField() class FilterForm(forms.Form): gender = forms.ChoiceField(choices=[(x, x) for x in ('-', 'MAL

Re: Django escapes a string partially

2018-01-22 Thread Julio Biason
Hi, You should wrap your `data-content={{ v.error_msg }}` in quotes, like this: `data-content="{{ v.error_msg }}"`. Otherwise you'll generate the template as `data-content='NoneType' object has not attribute "rfind"`, which is a valid HTML (data-content will have the string 'NoneType' and the no

Re: Django escapes a string partially

2018-01-22 Thread Daniel Roseman
On Monday, 22 January 2018 16:02:30 UTC, Ron Moran wrote: > > Hi there! > > I have a problem with escaping an error. > I have this unicode in python(2.7) which isn't escaped well in a span > element: > > u"'NoneType' object has no attribute 'rfind'" > The template is defined as follows: > >

Django escapes a string partially

2018-01-22 Thread Ron Moran
Hi there! I have a problem with escaping an error. I have this unicode in python(2.7) which isn't escaped well in a span element: u"'NoneType' object has no attribute 'rfind'" The template is defined as follows: {{ v.get_human_status }} where v.error_msg is the string above. It should be not

modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
*models.py* class HumanUser(AbstractUser): birth_date = models.DateField(null=True, blank=True, verbose_name=u "DOB") *forms.py* class profile_form(forms.ModelForm): def __init__(self, *args, **kwargs): kwargs.setdefault('label_suffix', '') super(profile_form, self

Re: Calling api from django view error. forbidden (csrf token is missing or incorrect)

2018-01-22 Thread Yungjae Kim
You will have to either get CSRF token and send it or ignore it completely. csrf_exempt from django.views.decorators.csrf will be helpful. For HttpResponse to returning a json, pass in a stringfied dict. On Monday, January 22, 2018 at 5:06:35 AM UTC-5, chern...@gmail.com wrote: > > The reason wh

Re: Calling api from django view error. forbidden (csrf token is missing or incorrect)

2018-01-22 Thread cherngyorng
The reason why im using this is because i am using integrating 2 different project. The api call is suppose to call the api from another app. Further more i also need to save some of the details the was get from both post and get method On Monday, January 22, 2018 at 5:03:18 PM UTC+9, chern...@

Django view to call api

2018-01-22 Thread cherngyorng
So i'm using django view to call api post method but its giving me 400 error As i encounter csrf forbidden error b4, im using the @csrf_exempt for now. I tried doing post method on both the API itself and also using the view to call the api. However when using the view to call, i got 400 erro

Re: Calling api from django view error. forbidden (csrf token is missing or incorrect)

2018-01-22 Thread Andréas Kühne
Hi, You seem to be doing a very complicated setup. You are creating both the api viewset and another view. First of all - why? Secondly, I am not sure that the csrf token will work when chaining your posts like that. So my main issue would be, can't you just post directly to the /api/test/ views

Calling api from django view error. forbidden (csrf token is missing or incorrect)

2018-01-22 Thread cherngyorng
I seen alot of other solution, tried it but problem still persist. When i do a requests.get, it works fine but when i'm doing requests.post. I got this forbidden (csrf token is missing or incorrect) error. Here is my code *models.py* class TestPost(models.Model): # reminderId = models.A