Re: Are forms supposed to submit empty strings for blank fields?

2018-10-08 Thread HashRocketSyntax
Shouldn't they be None? -- 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 email to django-us

Are forms supposed to submit empty strings for blank fields?

2018-10-08 Thread HashRocketSyntax
I'm running into problems downstream with empty strings. Are django forms supposed to submit empty strings for form fields that are not filled out? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

Django how to go about using npm modules with static/ templates

2018-07-13 Thread HashRocketSyntax
I have recently added *npm* to my project in order to keep better track of my js dependencies. Previously I have just been git cloning to my static/vendor folder. I've also added *gulp* , but have only got it doing hello world things right now. It seems simple enough - it can watch files, min

Clean ValidationError not showing when form.is_valid() called

2018-06-23 Thread HashRocketSyntax
I'm trying to show my ValidationError from clean_MY_VALUE in the template. *template* {% csrf_token %} {{form.as_p}} Submit {{ form.errors }} {{ form.non_field_errors }} *views.py* def MY_VIEW_CLASS(request, MY_ARG): MY_ARG = "query to check for silly conditions" if request.method=

Re: Pass value from view to non-model form

2018-06-23 Thread HashRocketSyntax
SOLVED. https://stackoverflow.com/questions/50997267/django-pass-value-from-view-to-non-model-form/51002442#51002442 thank you for pointing me in the right direction On Friday, June 22, 2018 at 9:37:26 PM UTC-4, HashRocketSyntax wrote: > > When I call my form in my view, I am trying t

Re: Pass value from view to non-model form

2018-06-23 Thread HashRocketSyntax
Looks like I was missing an `initial` inside init... 0_o https://stackoverflow.com/questions/1993014/passing-kwargs-to-django-form On Friday, June 22, 2018 at 9:37:26 PM UTC-4, HashRocketSyntax wrote: > > When I call my form in my view, I am trying to pass MY_VALUE to the form &

Re: Pass value from view to non-model form

2018-06-23 Thread HashRocketSyntax
.pop (presumably that's why) and > you pass OTHER_VALUE as a positional argument. > > E.g. > > MY_FORM(request.POST, OTHER_VALUE=OTHER_VALUE) > > > would pass it as a keyword argument and then you can > use kwargs.pop('OTHER_VALUE') in the form's init. &g

Pass value from view to non-model form

2018-06-22 Thread HashRocketSyntax
When I call my form in my view, I am trying to pass MY_VALUE to the form as an argument. I am doing this because I want to get my validation out of my views and into my forms. *views.py* OTHER_VALUE = "the query that i run" if request.method=='POST': form = MY_FORM(request.POST, OTHER_VALUE)

Django formset for models without foreign key

2018-06-18 Thread HashRocketSyntax
I'm trying to use formset to create connections between my Neo4j nodes. These models have been constructed using the django-neomodel package. They aren't related using foreign keys, but since this *isn't* an inline formset that shouldn't matter, right? *models.py* class Person(DjangoNode):

Django formset for models without foreign key

2018-06-17 Thread HashRocketSyntax
I'm trying to use formset to create connections between my Neo4j nodes. These models have been constructed using the django-neomodel package. They aren't related using foreign keys, but since this *isn't* an inline formset that shouldn't matter, right? *models.py* class Person(DjangoNode):

Re: Inlineformset without foreign key possible?

2018-06-05 Thread HashRocketSyntax
Thank you for pointing me in the right direction =) looks like that class is more generic. On Tuesday, June 5, 2018 at 9:08:35 PM UTC, Matthew Pava wrote: > > I’m not able to wrap my head around your specific application, but if you > don’t want to use a ForeignKey on a formset, don’t use an