Re: Hi all, i'm using 2 modelforms in one view function one as foreign key but when i submit babyform2 not storing in database. anyone please fix this

2021-06-01 Thread Lalit Suthar
because you're passing commit=False with form2 On Tue, 1 Jun 2021 at 14:10, Hugh Frost wrote: > def detail(request): > if request.method == 'POST': > baby_form1 = BabyForm1(data=request.POST) > baby_form2 = BabyForm2(data=request.POST) > > if baby_form1.is_valid() and

Hi all, i'm using 2 modelforms in one view function one as foreign key but when i submit babyform2 not storing in database. anyone please fix this

2021-06-01 Thread Hugh Frost
def detail(request): if request.method == 'POST': baby_form1 = BabyForm1(data=request.POST) baby_form2 = BabyForm2(data=request.POST) if baby_form1.is_valid() and baby_form2.is_valid(): baby_form1.save() print(baby_form1) baby_form2.b

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-19 Thread chaitanya orakala
Hi guys, I made a video on how to solve this problem. Please go to the link below and subscribe for more content. https://youtu.be/XvX6Q64oFyw There is a git repo link in the description as well. Thank You On Wed, Jun 10, 2020 at 3:50 PM chaitanya orakala wrote: > Answer : > > *First hide t

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-19 Thread chaitanya orakala
Hi guys, I made a video on how to solve this problem. here is the Link https://youtu.be/XvX6Q64oFyw On Wed, Jun 10, 2020 at 3:50 PM chaitanya orakala wrote: > Answer : > > *First hide the necessary fields which you want to hide and pop in drop > down.* > style.css > > #id_exec_first_name,

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread chaitanya orakala
Answer : *First hide the necessary fields which you want to hide and pop in drop down.* style.css #id_exec_first_name, label[for="id_exec_first_name"] { display: none } #id_exec_last_name, label[for="id_exec_last_name"]{ display: none } #id_exec_title, label[for="id_exec_title"]{ display

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread Balaji Shetty
Thank You Very Much for considering advice On Wed, Jun 10, 2020 at 8:11 AM chaitanya orakala wrote: > sure, I will do it by tomorrow > > > On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty > wrote: > >> Nice >> >> Can you please share sample code on git link. >> >> This is very common requirement in

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-10 Thread AMINE AZIZ
👍🏻 Shre your code, so it will help others. And if you can, change to resoulved, so it will be marked in Google search Best regards -- 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

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-09 Thread chaitanya orakala
sure, I will do it by tomorrow On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty wrote: > Nice > > Can you please share sample code on git link. > > This is very common requirement in every project > > > > On Tuesday, June 9, 2020, chaitanya orakala > wrote: > >> Thank You, Amine Aziz. I tried jque

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-08 Thread Balaji Shetty
Nice Can you please share sample code on git link. This is very common requirement in every project On Tuesday, June 9, 2020, chaitanya orakala wrote: > Thank You, Amine Aziz. I tried jquery and it worked. its so simple once we > know jquery. > do help others like you did to me. > > On Sun,

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-08 Thread chaitanya orakala
Thank You, Amine Aziz. I tried jquery and it worked. its so simple once we know jquery. do help others like you did to me. On Sun, Jun 7, 2020 at 1:18 PM AMINE AZIZ wrote: > I will share with you my iwn code used in admin , but it still the same as > the front end > > withe jQuery i can show inp

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread AMINE AZIZ
I will share with you my iwn code used in admin , but it still the same as the front end withe jQuery i can show input or hide it , so you will do the same with popup , by default it will be display none, and with Jquery you can show it if user change value to yes dropdown (select) you will u

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread AMINE AZIZ
I will share with you my iwn code used in admin , but it still the same as the front end withe jQuery i can show input or hide it , so you will do the same with popup , by default it will be display none, and with Jquery you can show it if user change value to yes dropdown (select) $(do

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread chaitanya orakala
Can anyone suggest how to approch this??? On Sun., Jun. 7, 2020, 12:09 p.m. chaitanya orakala, < chaitu.orak...@gmail.com> wrote: > *sure, here is my code*. please let me know how can I modify this to > achieve a dependent drop fields. > I want it to make action on executive_authority, next field

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread chaitanya orakala
*sure, here is my code*. please let me know how can I modify this to achieve a dependent drop fields. I want it to make action on executive_authority, next fields should pop-up *Views.py* from django.shortcuts import render, redirect from er_form.forms import NewClientForm, BillingGroupForm f

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread AMINE AZIZ
You 'll use JQUERY normal as the same in html You need every html id (so you cab add on change) JQUERY on change select Show hidden popup / or show hidden input Share your code. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread chaitanya orakala
Thanks for the response guys. I see many of them are saying need to use javascript or jquery. Is there any reference links to achieve that? ? On Sun, Jun 7, 2020 at 10:00 AM Shyam Acharjya wrote: > hi AMINE AZIZ. for frontend what approach should be taken? > thnx > > On Sunday, June 7, 2020 at

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread Shyam Acharjya
hi AMINE AZIZ. for frontend what approach should be taken? thnx On Sunday, June 7, 2020 at 7:19:28 PM UTC+5:30, AMINE AZIZ wrote: > > Hi > > You need to use some JQUERY code > > You need this in admin or frontend ? -- You received this message because you are subscribed to the Google Groups

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread Ernest Thuku
I think that you will have to use something like JavaScript in the model forms On Sun, Jun 7, 2020, 09:34 Sai wrote: > Hi guys, > I am working on a* Django project,* which involves submission form and > saving the data in the database using model form. I am stuck with one of > the functionaliti

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread Shyam Acharjya
If anyone has done this before.plese share the sollution.thnx On Sun, Jun 7, 2020 at 3:52 PM wongX Ndeso wrote: > You can use django form wizard if you want, much easier than you should > manipulate the onclick event using javascript or something similar with > that.. > Maybe you should remo

How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread AMINE AZIZ
Hi You need to use some JQUERY code You need this in admin or frontend ? -- 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...@googlegroup

Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread wongX Ndeso
You can use django form wizard if you want, much easier than you should manipulate the onclick event using javascript or something similar with that.. Maybe you should remodel your form or the flow.. Hope this help On Sun, Jun 7, 2020, 1:34 PM Sai wrote: > Hi guys, > I am working on a* Django p

How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-06 Thread Sai
Hi guys, I am working on a* Django project,* which involves submission form and saving the data in the database using model form. I am stuck with one of the functionalities of form which should work like for example "do you want benefit plan: *YES,* *next Field options should pop up*. if click*

More than 3 modelforms in inlineformsets

2020-02-11 Thread Zameer Ahmed
Hi, I have a situation where I need to have more than 3 nested forms for a model with Foreignkey with child models. Can someone please point me in the right direction because I've been trying this from last couple of days now. I can make it work with 1 parent and 2-3 child but not further than that

django modelforms unable to validate fields and save data entered by users into database

2019-10-21 Thread Gourab Mahapatra
Error i get : Traceback: File "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handle

DateInput - Django ModelForms

2019-01-24 Thread Maxwell Alves de Sousa
Boa tarde, primeiramente gostaria de pedir desculpas adiantado aos ADMs caso a minha pergunta/dúvida esteja fora do escopo do grupo. Também gostaria de avisar que sou marinheiro de primeira viagem no Django, e estou tendo algumas dificuldade para interpretar algumas coisa do mesmo. Dito isso, v

Re: Create ModelForms to create ModelForms

2017-08-02 Thread bobhaugen
We're using Fobi in https://github.com/FreedomCoop/valuenetwork Works pretty well. Does what it promises. Dev has been responsive to issues. On Wednesday, August 2, 2017 at 5:55:21 AM UTC-5, Thiago Luiz Parolin wrote: > > Hi, > Try using this app: > Django-fobi https://github.com/barseghyanartur/d

Re: Create ModelForms to create ModelForms

2017-08-02 Thread Thiago Luiz Parolin
Hi, Try using this app: Django-fobi https://github.com/barseghyanartur/django-fobi I've never used it, but it looks very promising. 2017-08-01 21:15 GMT-03:00 Shazia Nusrat : > I need to create a frontend app where I can use forms to create forms such > as Google Surveys or Survey Monkey kind of

Create ModelForms to create ModelForms

2017-08-01 Thread Shazia Nusrat
I need to create a frontend app where I can use forms to create forms such as Google Surveys or Survey Monkey kind of application. Can someone point me to any reusable app or something similar or someone can guide me that would be a great help. Regards, Shazia -- You received this message becau

Re: Using ModelForms

2015-08-31 Thread Florian Schweikert
On 25/08/15 01:25, Sait Maraşlıoğlu wrote: > default = timezone.now() Beware, timezone.now() will be evaluated once when the module is loaded, not on save if you might think. Use default = timezone.now without calling it to get the current value on save. -- You received this message because you

Re: Using ModelForms

2015-08-25 Thread Hugo Kitano
So the form should have action = '/stats/submit/' ? If I do this, whenever I click submit, it brings me back to the submission page, telling me that I didn't submit a file even if I did. On Tuesday, August 25, 2015 at 11:05:59 AM UTC-7, Hugo Osvaldo Barrera wrote: > > > On Tue, Aug 25, 2015,

Re: Using ModelForms

2015-08-25 Thread 'Hugo Osvaldo Barrera' via Django users
On Tue, Aug 25, 2015, at 14:16, Hugo Kitano wrote: > Noted.  "/stat/s" is an index page.  Here is what my urls.py looks > like.  Also, by using print statements, I've realized that the > request.method is always GET, not POST, which makes it so no model > instance is ever saved.  What does this GE

Re: Using ModelForms

2015-08-25 Thread Hugo Kitano
Noted. "/stat/s" is an index page. Here is what my urls.py looks like. Also, by using print statements, I've realized that the request.method is always GET, not POST, which makes it so no model instance is ever saved. What does this GET request refer to specifically? Thanks On Monday,

Re: Using ModelForms

2015-08-24 Thread Sait Maraşlıoğlu
instead of model_instance.sub_date = timezone.now() I suggest you to declare a default for that field in your model definition. default = timezone.now() On Thursday, 20 August 2015 23:41:05 UTC+3, Hugo Kitano wrote: > > Hi, I'm a beginner using Django, and I'm having trouble using model forms

Re: Using ModelForms

2015-08-24 Thread 'Hugo Osvaldo Barrera' via Django users
On Mon, Aug 24, 2015, at 16:41, Hugo Kitano wrote: > I'm actually now pretty certain that my html file is what's causing it > to not work > > Including your message as an inline image rather than simple text will reduce the amount of people that can actually read your message (and complicate foll

Re: Using ModelForms

2015-08-24 Thread Hugo Kitano
Also, it looks like the request.method is always 'GET', not 'POST', which means the form is never saved. How is this happening? On Monday, August 24, 2015 at 12:56:39 PM UTC-7, Hugo Kitano wrote: > > More specifically, what does the action="/stats/" field do and require? > > On Monday, August 24

Re: Using ModelForms

2015-08-24 Thread Hugo Kitano
More specifically, what does the action="/stats/" field do and require? On Monday, August 24, 2015 at 12:41:16 PM UTC-7, Hugo Kitano wrote: > > I'm actually now pretty certain that my html file is what's causing it to > not work > > > > On Monday, August 24, 2015 at 11:34:41 AM UTC-7, Hugo Kitano

Re: Using ModelForms

2015-08-24 Thread Hugo Kitano
I'm actually now pretty certain that my html file is what's causing it to not work On Monday, August 24, 2015 at 11:34:41 AM UTC-7, Hugo Kitano wrote: > > It always redirects to the stats page, though the model instance isn't > saved. > I suspect it has to do with the .save() function, but I c

Re: Using ModelForms

2015-08-24 Thread Hugo Kitano
It always redirects to the stats page, though the model instance isn't saved. I suspect it has to do with the .save() function, but I can't tell why, since I even create the modelform in the views.py file. Thanks, Hugo On Saturday, August 22, 2015 at 3:19:07 AM UTC-7, James Schneider wrote:

Re: Using ModelForms

2015-08-22 Thread James Schneider
On Aug 22, 2015 3:10 AM, "James Schneider" wrote: > > Hi, I'm a beginner using Django, and I'm having trouble using model forms to create instances of my model. > When a user submits a form, the database saves nothing. Here's my code for the view > > > So what exactly does happen?

Re: Using ModelForms

2015-08-22 Thread James Schneider
Hi, I'm a beginner using Django, and I'm having trouble using model forms to create instances of my model. When a user submits a form, the database saves nothing. Here's my code for the view So what exactly does happen? Based on the code you provided, you would either end up on the

Re: Using ModelForms

2015-08-21 Thread Hugo Kitano
Do you have any idea what could be causing the problem, then? On Friday, August 21, 2015 at 2:25:17 AM UTC-7, Hugo Osvaldo Barrera wrote: > > > > > On Thu, Aug 20, 2015, at 17:43, Edgar Gabaldi wrote: > > The code seems right. Probably your form has some error. Try print > {{form.errors}} i

Re: Using ModelForms

2015-08-21 Thread 'Hugo Osvaldo Barrera' via Django users
On Thu, Aug 20, 2015, at 17:43, Edgar Gabaldi wrote: > The code seems right. Probably your form has some error. Try print > {{form.errors}} in your template to check. Shouldn't {{ form.as_p }} include errors as well? This seems to be what the doc indicates: https://docs.djangoproject.com/en/1.

Re: Using ModelForms

2015-08-20 Thread Hugo Kitano
Could you elaborate on my form has some error? On Thursday, August 20, 2015 at 1:43:32 PM UTC-7, Edgar Gabaldi wrote: > > The code seems right. Probably your form has some error. Try print > {{form.errors}} in your template to check. > > On Thu, Aug 20, 2015 at 4:45 PM, Hugo Kitano > wrote: > >>

Re: Using ModelForms

2015-08-20 Thread Edgar Gabaldi
The code seems right. Probably your form has some error. Try print {{form.errors}} in your template to check. On Thu, Aug 20, 2015 at 4:45 PM, Hugo Kitano wrote: > Hi, I'm a beginner using Django, and I'm having trouble using model forms > to create instances of my model. > When a user submits a

Using ModelForms

2015-08-20 Thread Hugo Kitano
Hi, I'm a beginner using Django, and I'm having trouble using model forms to create instances of my model. When a user submits a form, the database saves nothing. Here's my code for the view def submit(request): SubmissionForm = modelform_factory(Submission, fields=('sub_name', 'sub_file'))

Re: Handle multiple modelforms in one html form

2015-01-17 Thread Eric Abrahamsen
Kakar Nyori writes: > When doing so, only the last pform is gets saved. And the other two > pforms are ignored. How do I get to save all the three forms of photo > (pforms) accordingly? > > Or is there any other way around? Your help will be much appreciated! > Thank you. James is right that a f

Re: Handle multiple modelforms in one html form

2015-01-17 Thread James Schneider
I'm guessing that if you look at the generated source code in the browser, all of the names for the fields in the pform form's are the same, which likely collide on the Django side (if the browser actually posts all the copies with the same field names, not sure what the typical browser behavior is

Handle multiple modelforms in one html form

2015-01-17 Thread Kakar Nyori
A user will have photos which will be related with their specific album. So this was the model for that: class Album(models.Model): > user = models.ForeignKey(User) > title = models.CharField(max_length=200) > pub_date = models.DateTimeField(auto_now_add=True, auto_now

Re: Working with ModelForms

2014-05-03 Thread Russell Keith-Magee
lease someone that put me in > the right way. > > ModelForms definitely work, and they can definitely be combined with CBVs. Django's documentation contains a whole lot of example code and tutorials, but if you don't tell us what you've tried (and I mean *exactly* what y

Working with ModelForms

2014-05-02 Thread LaPerl
Hi all, I have 5 different models all with relations with themselves. I want to use ModelForm to generate a form that will contain fields of all these models. I read and read, I tried different things to do this (inheritance, subclassing...) and then use the class based views to do CRUD with th

Django ModelForms - testing forms with model that have M2M inline instance using an intermediate model

2013-12-25 Thread luke lukes
I have invoice/estimates django app, I need to write tests for it. Since I'm a beginner with this, testing forms results hard for me. This is the code - for models, form and admin: # MODELS class Invoice(models.Model): subject = models.ForeignKey( Subject, verbose_name=

Re: ModelForms

2013-12-11 Thread Tom Evans
On Wed, Dec 11, 2013 at 11:22 AM, wrote: > > Hello, > > when using ModelForms, which is the correct way to implement the "edit item" > pattern? > > Suppose I've a table with many rows, each representing a record in a > database. > I choose one and wis

ModelForms

2013-12-11 Thread giuliano . bertoletti
Hello, when using ModelForms, which is the correct way to implement the "edit item" pattern? Suppose I've a table with many rows, each representing a record in a database. I choose one and wish to display/let the user edit the details. I'm trying to use a ModelForm and f

Multiple modelforms, mixing existing and non existing instances

2013-06-19 Thread Freddy
Hi everyone, I'm trying to get a particular formset, but i'm stuck on it. In my database, I have some information stored around external data, represented by this kind of model : LiveInfo(models.Model): external_id = models.IntegerField() live_url = models.URLField() description = m

Re: Modelforms and class based views

2013-01-06 Thread Pedro J. Aramburu
https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#model-formsets El domingo, 6 de enero de 2013 11:46:40 UTC-3, Pedro J. Aramburu escribió: > > Have you tried merging the forms with formsets? > https://docs.djangoproject.com/en/1.4/topics/forms/formsets/ > > El viernes

Re: Modelforms and class based views

2013-01-06 Thread Pedro J. Aramburu
first > project with class based views. I'm having trouble deciding how to write a > view that will display a two Modelforms, one having a foreign key over the > other. > > I will need to do the .save(commit=False) part to save my first model and > then be able to save the m

Re: Modelforms and class based views

2013-01-05 Thread nkryptic
Morales wrote: > > Hi everyone, > > I'm still wraping my head around class based views and I'm trying my first > project with class based views. I'm having trouble deciding how to write a > view that will display a two Modelforms, one having a foreign key over the

Modelforms and class based views

2013-01-04 Thread Marco A Morales
Hi everyone, I'm still wraping my head around class based views and I'm trying my first project with class based views. I'm having trouble deciding how to write a view that will display a two Modelforms, one having a foreign key over the other. I will need to do the .save(com

Re: Strange behavior using ModelForms

2012-12-18 Thread Karen Tracey
On Tue, Dec 18, 2012 at 4:11 PM, Francisco Vianna < francisco.v.via...@gmail.com> wrote: > After some debugging, I realized they become the same after calling > "is_valid" to the bound form. Now, I'm not sure if I am missing something > conceptually about ModelForms

Re: Strange behavior using ModelForms

2012-12-18 Thread Chris Cogdon
u_form = UserForm(request.POST, instance=request.user) >>> >>> if u_form.is_valid(): >>> if u_form.instance.email != u_form.cleaned_data['email']: >>> tmp_profile = u_form.instance.get_profile() >>>

Re: Strange behavior using ModelForms

2012-12-18 Thread Francisco Vianna
irmed = False >> tmp_profile.save() >> >> u_form.save() >> response['success'] = True >> else: >> response['errors'].append(u_**form.errors) >> >> >> When I get to test if the form e-mail is d

Re: Strange behavior using ModelForms

2012-12-18 Thread Chris Cogdon
else: > response['errors'].append(u_form.errors) > > > When I get to test if the form e-mail is diferent from the instance e-mail > in order to set a flag in my model, both emails > > u_form.instance.email > > and > > u_form.cleaned_dat

Strange behavior using ModelForms

2012-12-18 Thread Francisco Vianna
rom the instance e-mail in order to set a flag in my model, both emails u_form.instance.email and u_form.cleaned_data['email'] are the same. After some debugging, I realized they become the same after calling "is_valid" to the bound form. Now, I'm not sure if I am mis

Re: rendering modelForms

2012-07-10 Thread Tomas Neme
There's a way, but you'll need to touch the form on the python side quite a lot, changing the default widgets adding them the css classes you want. You can take a look at https://github.com/earle/django-bootstrap and https://github.com/dyve/django-bootstrap-toolkit/ they provide some shortcuts for

Re: rendering modelForms

2012-07-10 Thread Jirka Vejrazka
Hi Marilena, I'm also using Twitter Bootstrap and over time migrated to this template snipped that I'm including in my templates at the place where you put {{ form.as_table }} http://dpaste.com/hold/768995/ If you find it useful, great :) I'm not a web developer by nature so there may be a

Re: rendering modelForms

2012-07-10 Thread kenneth gonsalves
On Tue, 2012-07-10 at 04:06 -0700, mapapage wrote: > I already read that, but my question is how can I css-style only some > of my fields while the rest continue to be rendered by form.as_table. > Is there such an option? that I do not think you can do. What you have to do is to drill down into th

Re: rendering modelForms

2012-07-10 Thread mapapage
I already read that, but my question is how can I css-style only some of my fields while the rest continue to be rendered by form.as_table. Is there such an option? I want that because with modelForms I have a direct mapping of my forms to my models and if I customize them manually I loose for

Re: rendering modelForms

2012-07-09 Thread Daniel Roseman
On Monday, 9 July 2012 12:06:32 UTC+1, mapapage wrote: > > Hi! > In my django app I'm using modelForms and not simple django forms so in > order to render the form I just do {{ form.as_table }} an the template and > everything is being displayed. > That's simple, bu

Re: rendering modelForms

2012-07-09 Thread mapapage
The important part of my template is the following: > > > Forms > > > > {% extends "main.html" %} > > >> {% block content %} > > > enctype='multipart/form-data'{% endif %}> > > >> {% csrf_token %} > > > > > > > > {{ lname }} > > {{ fn

Re: rendering modelForms

2012-07-09 Thread kenneth gonsalves
On Mon, 2012-07-09 at 04:27 -0700, mapapage wrote: > In my django app I'm using modelForms and not simple django forms so > in order to render the form I just do {{ form.as_table }} an the > template and everything is being displayed. That's simple, but > obviously any html

rendering modelForms

2012-07-09 Thread mapapage
Hi! In my django app I'm using modelForms and not simple django forms so in order to render the form I just do {{ form.as_table }} an the template and everything is being displayed. That's simple, but obviously any html code is being skipped, so I wonder how will I further customi

rendering modelForms

2012-07-09 Thread Marilena Papageorgiou
Hi! In my django app I'm using modelForms and not simple django forms so in order to render the form I just do {{ form.as_table }} an the template and everything is being displayed. That's simple, but obviously any html code is being skipped, so I wonder how will I further customize my

Re: ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Excellent, that works perfectly. Thanks for you help. Wes On May 22, 9:58 am, bruno desthuilliers wrote: > On May 22, 10:34 am, wchildsuk wrote: > > > Hi, > > > I'm trying to use generic class based views to edit a specific > > queryset but I can't see to get my code working. I've defined quer

Re: ModelForms and CreateView Help

2012-05-22 Thread bruno desthuilliers
On May 22, 10:34 am, wchildsuk wrote: > Hi, > > I'm trying to use generic class based views to edit a specific > queryset but I can't see to get my code working. I've defined queryset Nope, cf Xavier's answer on this. > and relevant form but when the form renders it doesn't contain the > queryse

Re: ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Hi Xavier, I changed my queryset to use filter (ReminderMessage.objects.filter(id=1)) but it didn't make any difference to the form rendering correctly with the instance or saving. Regards Wes On May 22, 9:37 am, Xavier Ordoquy wrote: > Hi, > > get is a termination statement for querysets. > p

Re: ModelForms and CreateView Help

2012-05-22 Thread Xavier Ordoquy
Hi, get is a termination statement for querysets. please use filter instead. Regards, Xavier Ordoquy. Le 22 mai 2012 à 10:34, wchildsuk a écrit : > Hi, > > I'm trying to use generic class based views to edit a specific > queryset but I can't see to get my code working. I've defined queryset >

ModelForms and CreateView Help

2012-05-22 Thread wchildsuk
Hi, I'm trying to use generic class based views to edit a specific queryset but I can't see to get my code working. I've defined queryset and relevant form but when the form renders it doesn't contain the queryset and when it saves it creates a new entry instead of editing the existing one. If an

Difficulty with validation of multiple modelforms on 1 page

2012-05-07 Thread Roald
Hi all, I'm working on an application that uses a HTML-form consisting of multiple Django-ModelForms. Moreover, their validation is interdependent. Moreover, their data is interdependent. Moreover, I use multiple modelforms with the same instance (might be a bad idea anyway). My template

Re: Access specific ModelForm field option within array of ModelForms for use with .js

2012-05-03 Thread jondykeman
ave the following situation: > > I am rendering an array of ModelForms to my template. ie. formArray = > [, , ] > > In the template I display the forms with the following: > > {% for form in formArray %} > > {{ form }} > > {% endfor %} > > Previously I have

Re: Access specific ModelForm field option within array of ModelForms for use with .js

2012-05-03 Thread Kurtis Mullins
You could do something along these lines: {% for field in form %} ... {% ifequal field form.someSpecificField %} > {{ form }} > > {% endfor %} > > Previously I have accessed certain ModelForms using {% if forloop.counter > == # %} to add some customization. > > Howeve

Access specific ModelForm field option within array of ModelForms for use with .js

2012-05-02 Thread jondykeman
Hello, I have the following situation: I am rendering an array of ModelForms to my template. ie. formArray = [, , ] In the template I display the forms with the following: {% for form in formArray %} {{ form }} {% endfor %} Previously I have accessed certain ModelForms using {% if

Re: ModelForms

2012-04-27 Thread bruno desthuilliers
On Mar 23, 12:46 am, hack wrote: > I think I shot myself in the foot using ModelForms to generate all of my > html forms.  Is there any way to use a stylesheet when your forms are > generated from ModelForms? Yes of course, why ? > I've tried everything and cannot get it to

Re: ModelForms

2012-04-26 Thread Eryn Wells
On Thu, Mar 22, 2012 at 3:46 PM, hack wrote: > I think I shot myself in the foot using ModelForms to generate all of my > html forms.  Is there any way to use a stylesheet when your forms are > generated from ModelForms? You should be able to render the forms and plug the rendered HT

Re: ModelForms

2012-03-23 Thread Tim Ney
Not to gild the lilly, but, you could also do this, and it would work: either as part of the css you are inheriting from the "base" or, separately, you could create a whole slew of named css styles in one file, then apply each file to the template tags, table tags you use to call the data into the

Re: ModelForms

2012-03-23 Thread Kurtis Mullins
If you're worried about stylizing specific fields, it'll be setup as a table, ul, or paragraph based upon how you "render the form" (paragraph by default I think). The individual fields are named with the following convention (if I recall correctly) . So for a field named "password" in a paragraph

Re: ModelForms

2012-03-23 Thread Tim Ney
I think the best thing for you do is to create the css outside the template. Like this - create the css file, separately, then reference the file in the template. Or, better yet, add the css you need for your form in you main css file that is referenced in your base template and just inherit it by

Re: ModelForms

2012-03-23 Thread Mario Gudelj
It doesn't matter how you generate your form, your CSS should be applied from inside the template. You need to add a CSS file link to a template to which you're passing the form to inside your context from within a view, or you can embed it into your template using

ModelForms

2012-03-22 Thread hack
I think I shot myself in the foot using ModelForms to generate all of my html forms. Is there any way to use a stylesheet when your forms are generated from ModelForms? I've tried everything and cannot get it to work. I've tried directly importing the css files, I've tried lo

multiple modelforms in a single view not saving

2012-01-27 Thread Chris Wolfe
register_new_tenant(request, template_name ='tenant/ register_tenant.html'): """ This view takes the three incomplete modelforms Lease, Tenant, and Rental period and creates a new lease made up of lease details, its rent periods (hopefully plural); and finds and assigns

Re: ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Karen Tracey
Specify blank=True on the model field. When a ModelForm is created, the default value for a model form field's "required" attribute is based on the corresponding model field's "blank" attribute. Karen -- http://tracey.org/kmt/ -- You received this message because you are subscribed to the Googl

ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Jeff Heard
ur and make the fields editable? I know in a regular form, you specify a BooleanField(required=False) for all your boolean fields, but since the ModelForms and in particular the ProcessFormViews are automatically generated from the model, I can't seem to do that. -- Jeff -- You received this

Re: Model Inheritance and ModelForms

2011-10-29 Thread Alex
Tom, Thanks for the quick reply! However, when I tried that I got an error saying that inventoryitem "is an invalid keyword argument for this function". I fixed this by manually specifying the OneToOneField relationship with the parent class as inventoryItem and setting parent_link=True. With that

Re: Model Inheritance and ModelForms

2011-10-28 Thread Tom Evans
On Fri, Oct 28, 2011 at 7:50 AM, Alex wrote: > I've been scouring Google and the Django documentation and I can't > figure out how to do this. I'm working on an inventory management > system for my shop. My inventory models.py similar to the following: > >    class ItemType( models.Model ): >    

Model Inheritance and ModelForms

2011-10-28 Thread Alex
I've been scouring Google and the Django documentation and I can't figure out how to do this. I'm working on an inventory management system for my shop. My inventory models.py similar to the following: class ItemType( models.Model ): def __unicode__( self ): return "blah bl

Re: In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Timmy O'Mahony
Wow, thanks for the great reply. It makes sense that it's the related object manager. I have everything working now so thank you very much again! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://

Re: In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Andre Terra
Hello, Timmy "rel" is the related manager object that will be used in specific fields, namely those that refer to relationships to other table. These relationships are handled by objects in django.db.models.fields.related[1]. For example, take User and Group from django.contrib.auth.models. Assum

In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Timmy O'Mahony
I am trying to use a 3rd party form field and custom widget in my own model form and I am having trouble understanding what the "rel" attribute is used for. for example: class SomeFormField(forms.ModelChoiceField): def __init__(self, rel, queryset, to_field_name, *args, **kwargs): ... I see it

Re: Question on cleaning ModelForms

2011-10-18 Thread Tom Evans
On Tue, Oct 18, 2011 at 2:00 PM, Jeff Heard wrote: > But I want to be able to invalidate my form if geocoding fails...  Can I > still do that in the save method? > No, save() is not part of validation. However, it is not hard to combine the two: In the clean() method, calculate the geocoding poi

Re: Question on cleaning ModelForms

2011-10-18 Thread Jeff Heard
But I want to be able to invalidate my form if geocoding fails... Can I still do that in the save method? On Oct 18, 2011, at 4:52 AM, Daniel Roseman wrote: > On Monday, 17 October 2011 20:30:35 UTC+1, Jefferson Heard wrote: > class FarmersMarket(ModelForm): >class Meta: > model =

Re: Question on cleaning ModelForms

2011-10-18 Thread Daniel Roseman
On Monday, 17 October 2011 20:30:35 UTC+1, Jefferson Heard wrote: > > class FarmersMarket(ModelForm): >class Meta: > model = models.FarmersMarket > exclude = ('location',) > >def clean(self): > place, (lat, lng) = _g.geocode(self.cleaned_data['address']) > self.clean

  1   2   3   >