MODELFORM DESIGN

2022-04-15 Thread Heman Okumbo
I need to implement a model design where users_a upload data:(Description_Fields-name,email,area,region,comments and some images) according to their Location_Fields(country, city/state and district).when user_b search for content they access this data according to the criterion it was

Re: Using ModelForm in inlineAdmin with view permissions

2022-01-03 Thread the.one.abo...@gmail.com
Hi, My previous email did not include link to the demo project. Please find the demo project here: https://github.com/pandafy/inline_view_only. Thanks, Gagan Deep On Saturday, January 1, 2022 at 10:15:21 PM UTC+5:30 the.one.abo...@gmail.com wrote: > Hello everyone! > > I have created a

Using ModelForm in inlineAdmin with view permissions

2022-01-01 Thread the.one.abo...@gmail.com
Hello everyone! I have created a demo project to convey my use case programmatically. Here is a brief description of the project. The Django project contains an application "home" that has four models: Device, Location, FloorPlan and DeviceLocation. DeviceLocation is a thorough model that

Modelform foreign key not working

2021-10-20 Thread Aruna Priya Nagarajan
Am new to django, and I am trying to create a form using modelform. The form has foerign key value (connection_type below in forms.py) and its not displaying the values it is referring to. For the image below, the columns, Connection name : displayed Connection type : text box has not appeared

Using ModelForm to get labels in a DetailView

2021-09-19 Thread bnmng
I don't know if this is good practice, but to get field labels in a DetailView, it seems to work fine if you just add a form to the context: views.py: class ItemDetailView(DetailView): model = Item context_object_name = "item" def get_context_data(self, **kwargs):

How to get a user from a Modelform

2020-09-02 Thread Annick Sakoua
Hi all, I have a model from which I had a form. I would like to show in the form a MultipleChoiceField: customer that shows only the user's customers. Nothing show in the MultipleChoiceField. I don't know how to succed to get the user in my form. Please help. Thanks a lot *models.py* class

Django Admin. Make custom fields from custom form in ModelForm readonly.

2020-06-11 Thread Maxven SkiLaren
I have such admin code: class SomeModelAdminForm(forms.ModelForm): custom_field1 = forms.CharField(...) custom_field2 = forms.IntegerField(...) class SomeModelAdmin(admin.ModelAdmin): fields = ... readonly_fields = ... form = SomeModelAdminForm def

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread lemme smash
okay, man. seems like you need to read and repeat everything you know about python and django. i highly recommend you to go through django tutorial. On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote: > > Traceback: > > File >

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread Gourab Mahapatra
and now this error shows, something related to the job instance, i don't know but if you want then i can share with you my models.py file code and views.py file code please help me in this regard, I am stuck here since 2 weeks. I have attached the screenshot of the error please find attached ..

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread Gourab Mahapatra
On Tuesday, 22 October 2019 11:33:23 UTC+5:30, Gourab Mahapatra wrote: > > and now this error shows, something related to the job instance, i don't > know but if you want then i can share with you my models.py file code and > views.py file code > please help me in this regard, > I am stuck

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
and also I tried to use statements as shown in the attached file. But still I get an error like the above thread: Exception Type: NameError Exception Value: name 'job_name' is not defined On Monday, 21 October 2019 20:38:13 UTC+5:30, lemme smash wrote: > > it's quite expected behavior. if

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
sir/madam, when I replace the particular statement with the one which you have adviced me to use. then, this gives me an error something like: Exception Type: NameError Exception Value: name 'job_name' is not defined please help me in fixing this issue Thanks & Regards Gourab Mahapatra

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread lemme smash
it's quite expected behavior. if you want to check if job exists, you better use Job.objects.filter(name=job_name).exists() On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote: > > Traceback: > > File >

unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
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\handlers\base.py"

Stucked In Modelform

2019-09-21 Thread Shakil Ahmmed
I Have three ForeignKey in my model.. When I Create Form with ModelForm and show the foreign key field into html select it execute Duplicate Queries for each Foreignkey field Heres My Models.py class TeamModel(models.Model): team_name = models.CharField(unique=True, db_index=True

Fwd: Stucked In ModelForm

2019-09-21 Thread Shakil Ahmmed
-- Forwarded message - From: Shakil Ahmmed Date: Sun, Sep 22, 2019 at 1:46 AM Subject: Stucked In ModelForm To: I Have three ForeignKey in my model.. When I Create Form with ModelForm and show the foreign key field into html select it execute Duplicate Queries for each

Re: Code wont let me pull data to modelform from database, :(

2019-08-17 Thread Kean
l try to solve your > conditions. > > > Thanks > > On Sat, 17 Aug 2019, 01:58 Kean, wrote: > Hi, > > New to Django, and am really really struggling which something maybe others > may find really easy.. > > I've created a custom database model, and the subsequent mode

Re: Code wont let me pull data to modelform from database, :(

2019-08-16 Thread RONAK JAIN
will try to solve your conditions. Thanks On Sat, 17 Aug 2019, 01:58 Kean, wrote: > Hi, > > New to Django, and am really really struggling which something maybe > others may find really easy.. > > I've created a custom database model, and the subsequent modelform > templa

Code wont let me pull data to modelform from database, :(

2019-08-16 Thread Kean
Hi, New to Django, and am really really struggling which something maybe others may find really easy.. I've created a custom database model, and the subsequent modelform template to enable creating a record and storing to database. However I am struggling to create two instances, where

Custom error messages not working in Django ModelForm - help needed

2019-08-09 Thread אורי
Django Users, I want to release Speedy Net and Speedy Match to production in September or October 2019. I need help with the following issue on GitHub and Stack Overflow: https://github.com/speedy-net/speedy-net/issues/3 Any suggestions? There are other issues on Speedy Net which I also need

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Melvyn Sopacua
On dinsdag 16 juli 2019 03:25:11 CEST Jacob Greene wrote: > Hello! Has anyone dealt with this before? It seems that my forms don't add > the CSS class to errors raised in model.clean() or model.clean_fields() > methods. > > I have a form that looks something like this: > > class

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jani Tiainen
king them with that "form_error" > css class. They are just red and bold, most errors are shown with the > correct CSS class like my UniqueConstraints or any exceptions I throw in > the modelForm clean() method, but any exceptions I throw in the > Model.clean() or Model.full_cle

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jacob Greene
are shown with the correct CSS class like my UniqueConstraints or any exceptions I throw in the modelForm clean() method, but any exceptions I throw in the Model.clean() or Model.full_clean() do not get the correct css class. -- You received this message because you are subscribed to the Google Group

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jani Tiainen
At least you should't call super.clean_fields() in clean() method... Also how are you outputting errors in your template? ti 16. heinäk. 2019 klo 5.22 Jacob Greene kirjoitti: > Hello! Has anyone dealt with this before? It seems that my forms don't add > the CSS class to errors raised in

ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-15 Thread Jacob Greene
Hello! Has anyone dealt with this before? It seems that my forms don't add the CSS class to errors raised in model.clean() or model.clean_fields() methods. I have a form that looks something like this: class HttpsFaxBoxForm(forms.ModelForm): error_css_class = 'form_error' class Meta:

Re: Can I override __new__ in Django ModelForm?

2019-07-10 Thread Jani Tiainen
Hi. You can add fields dynamically on model __init__ method and AFAIK that's best and recommended way to do it. I'm not sure is that even in Django docs. ke 10. heinäk. 2019 klo 17.44 אורי kirjoitti: > Hi, > > I have a ModelForm with Django 1.11, and I'm moving a few fields to

Can I override __new__ in Django ModelForm?

2019-07-10 Thread אורי
Hi, I have a ModelForm with Django 1.11, and I'm moving a few fields to another model. Calling make_migrations causes an error because these fields don't exist in the current model. I added some of the fields to the form, but one of the fields is a TranslatedField and therefore

Re: get_absolute_url() necessary with ModelForm ?

2019-07-07 Thread Axel Rau
d dbtable. >> UpdateView does not work with ModelForm w/o get_absolute_url(). >> >> Does there any workaround exist? >> >> Thanks, Axel >> > > UpdateView works perfectly fine without `get_absolute_url()`. It does however > need a `success_url

Re: get_absolute_url() necessary with ModelForm ?

2019-07-06 Thread Daniel Roseman
On Thursday, 4 July 2019 18:45:47 UTC+1, axe...@chaos1.de wrote: > > I’m using a model in 2 apps with different urls. > Subclasing it and overwriting get_absolute_url() did not work, > because it mangled dbtable. > UpdateView does not work with ModelForm w/o get_absolute_u

get_absolute_url() necessary with ModelForm ?

2019-07-04 Thread Axel Rau
I’m using a model in 2 apps with different urls. Subclasing it and overwriting get_absolute_url() did not work, because it mangled dbtable. UpdateView does not work with ModelForm w/o get_absolute_url(). Does there any workaround exist? Thanks, Axel --- PGP-Key: CDE74120 ☀ computing @ chaos

SAVING DATA IN FORMTOOL WIZARD MODELFORM

2019-05-28 Thread Simon John
Hi Any one can help on how to save data using formtool wizard and Modelform The view of my models and form and views and the error are here -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Formtools Wizard and Modelform saving data

2019-05-28 Thread Simon John
I am trying to save data to db after all the three from have submited and still getting and error, any work around -- 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

linking HTML form with database directly without ModelForm

2019-05-28 Thread Fatukasi Kayode
*fase.html* Email address: Phone: the models.py contains email and phone number also -- 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: ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Dean Karres
Thanks to the responders. I was unaware of formsets / midelformsets. I am reading about them now. Cheers -- 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

Re: ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Kiran Capoor
y > state > zip > email > phone > > I have a ModelForm that goes with this. > > This is sufficient for nearly all the cases I am trying to deal with. > However, there are a few special cases in which a person needs to list two > or more addresses; two or more email

Re: ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Chetan Ganji
ng for some advice. I have a basic Profile model. It looks > something like: > > Profile: > first_name > middle_name > last_name > birthday > address_line1 > address_line2 > city > state > zip > email > phone > > I have a ModelForm that goes wit

ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Dean Karres
Hi I am looking for some advice. I have a basic Profile model. It looks something like: Profile: first_name middle_name last_name birthday address_line1 address_line2 city state zip email phone I have a ModelForm that goes with this. This is sufficient for nearly all the cases I am trying

ModelForm FileField Not Effecting the CSS

2019-03-25 Thread Irfan Khan
Hi, I have enquiry form developed in the MODELFORM, after rendering to the templates i defined the div tag in the put this form and applied the CSS effects.but the issue is all fields except fiel field are in the proper alignment, can any one please guide me to make this filefield also

Re: Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Michael Corey
08:48 PM UTC-5, Michael Corey wrote: >> >> I'm having trouble getting the verbose_name attribute of a model field to >> show up when rendering a ModelForm. instead, the label uses the pretty >> version of the field name, not the verbose_name. This occurs any time I >

Re: Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Tim Graham
isn’t declared directly on the form..." I think it would be: self.fields['who'].widget = forms.Textarea() On Friday, February 1, 2019 at 5:08:48 PM UTC-5, Michael Corey wrote: > > I'm having trouble getting the verbose_name attribute of a model field to > show up when rendering a

Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Michael Corey
I'm having trouble getting the verbose_name attribute of a model field to show up when rendering a ModelForm. instead, the label uses the pretty version of the field name, not the verbose_name. This occurs any time I specify a field type, and works properly (shows the verbose_name) if I don't

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
_name':request.user})* >>>>>>>>> if form.is_valid(): >>>>>>>>> form.save() >>>>>>>>> messages.success(request, 'Your entry has been saved. Relevant >>>>>>>>> persons will be informed of this ch

Re: Populate modelform field with username

2019-01-15 Thread Nebojsa Hajdukovic
'Your entry has been saved. Relevant >>>>>>>> persons will be informed of this change.') >>>>>>>> #(nevezano za populate) i ovaj message.success mi se isto javlja >>>>>>>> kao problem.. na performance appu mi bilježi lo

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
;>>>>> kao problem.. na performance appu mi bilježi login/logout umjesto samo >>>>>>> poruka nakon uspješnog spremanja. >>>>>>> return render(request, 'qif/performance.html', {"form" : form}) >>>>>>> >>>>>&

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
f/performance.html', {"form" : form}) >>>>>> >>>>>> Možda mi nešto na formi nedostaje? >>>>>> >>>>>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic < >>>>>> nebojsa.zero...@gmail.com> napisao je: >>&g

Re: Populate modelform field with username

2019-01-15 Thread Nebojsa Hajdukovic
t;>> >>>>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic < >>>>> nebojsa.zero...@gmail.com> napisao je: >>>>> >>>>>> Hey, based on your name I believe u speak our language, so will >>>>>> switch to that :

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
t;> to that : ) >>>>> >>>>> Ako hoces da na primer supplier_name bude automatski popunjeno kao >>>>> koristik samo dodaj ovako u views.py: >>>>> view: >>>>> def performance_view(request): >>>>> fo

Re: Populate modelform field with username

2019-01-15 Thread Nebojsa Hajdukovic
kao >>>> koristik samo dodaj ovako u views.py: >>>> view: >>>> def performance_view(request): >>>> form = PerformanceForm({'supplier_name':request.user}) >>>> if form.is_valid(): >>>> form.save() >>>> return re

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
ceForm({'supplier_name':request.user}) >>> if form.is_valid(): >>> form.save() >>> return render(request, 'qif/performance.html', {"form" : form}) >>> >>> уто, 15. јан 2019. у 09:51 Ivan Martić је >>> написао/ла: >>> >>>&g

Re: Populate modelform field with username

2019-01-15 Thread Nebojsa Hajdukovic
_name':request.user}) >> if form.is_valid(): >> form.save() >> return render(request, 'qif/performance.html', {"form" : form}) >> >> уто, 15. јан 2019. у 09:51 Ivan Martić је >> написао/ла: >> >>> Hi all, >>> >>> can som

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
view: > def performance_view(request): > form = PerformanceForm({'supplier_name':request.user}) > if form.is_valid(): > form.save() > return render(request, 'qif/performance.html', {"form" : form}) > > уто, 15. јан 2019. у 09:51 Ivan Martić је > написао/ла: > >>

Re: Populate modelform field with username

2019-01-15 Thread Nebojsa Hajdukovic
(): form.save() return render(request, 'qif/performance.html', {"form" : form}) уто, 15. јан 2019. у 09:51 Ivan Martić је написао/ла: > Hi all, > > can someone assist me. > I cant get the modelform field get populated with active username. > > Does any one have a

Populate modelform field with username

2019-01-15 Thread Ivan Martić
Hi all, can someone assist me. I cant get the modelform field get populated with active username. Does any one have a good advice? view: def performance_view(request): form = PerformanceForm(request.POST or None) if form.is_valid(): form.save() return render(request, 'qif/performance.html

RE: Cannot get this ModelForm view to save to the db, what am I doing wrong please

2018-12-10 Thread Matthew Pava
this ModelForm view to save to the db, what am I doing wrong please Cannot seem to get .save() to write to the db This is the model class Customer(models.Model): email = models.EmailField() postcode = models.CharField(max_length=10) def __unicode__(self): return self.email

Cannot get this ModelForm view to save to the db, what am I doing wrong please

2018-12-10 Thread MikeKJ
) super(Customer, self).save() This is the view: class RegisterForm(ModelForm): class Meta: model = Customer def register(request): form = RegisterForm(request.POST) if form.is_valid(): email = form.cleaned_data['email'] postcode

Re: unable to create modelform object in views

2018-11-22 Thread Thiago Oliveira
s import render,redirect > from django.urls import include > import datetime > from .forms import loginform,modelform > def hidemelogin(request): > if request.method == 'POST': > form=loginform(request.POST) > if form.is_valid(): >

unable to create modelform object in views

2018-11-22 Thread shiva kumar
views file from django.core.mail import send_mail from django.http import HttpResponse # Create your views here. from django.shortcuts import render,redirect from django.urls import include import datetime from .forms import loginform,modelform def hidemelogin(request): if request.method

Re: Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
itect wrote: > >> > >> Hi, > >> > >> We are using django 1.11 for our ecommerce site. > >> > >> We are facing an issue with modelform and many to many field in it as > follows: > >> > >> Lets say there are two models: > &

Re: Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Sanjay Bhangar
t;> We are using django 1.11 for our ecommerce site. >> >> We are facing an issue with modelform and many to many field in it as >> follows: >> >> Lets say there are two models: >> >> class A(models.Model): >>c = models.CharField() >&g

Re: Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
Would also add that the server CPU usage was hitting 100% due to the template loading issue. On Monday, October 29, 2018 at 4:48:54 PM UTC+5:30, Web Architect wrote: > > Hi, > > We are using django 1.11 for our ecommerce site. > > We are facing an issue with modelform and

Many to Many field in ModelForm - with tens of thousands of records

2018-10-29 Thread Web Architect
Hi, We are using django 1.11 for our ecommerce site. We are facing an issue with modelform and many to many field in it as follows: Lets say there are two models: class A(models.Model): c = models.CharField() class B(models.Model): a = models.ManyToManyField('A') Now if I

Re: How do I make a field optional to enter, in a django ModelForm?

2018-09-12 Thread Ryan Gedwill
if it is not. You could also do it the OOP way by inheriting your modelform with a new modelform, and overriding the field for the new one. For example in the regular modelform set required=True, then in the inherited version set required=False. I’d do it the JS/template tag way, and I most

How can I display an AutoField in a ModelForm?

2018-09-12 Thread Joel Mathew
Question: How can I display an AutoField in a ModelForm. I have a need where a Form is generated and displayed. Based on the input, I need to read the AutoField's value and search for it in my database. My form: class CheckinPatientMetaForm(ModelForm): class Meta: model

How do I make a field optional to enter, in a django ModelForm?

2018-09-12 Thread Joel Mathew
Scenario: I instantiate a ModelForm and pass it to a template which displays the form. When POST is submitted, code tries to search the database by any of the given inputs. I dont require all inputs to be entered as in the Model. I just need one (or more, if user desires to do an AND search

Django ModelForm Foreign Key Dropdown passes __str__ but stores fkey_id

2018-08-21 Thread HiMAnsHu
rom Rate model. Any help will be appreciated as from cleaned data I am getting *str* returned value instead of selected option id value (i.e. *str* from client model ). StackOverflow Link: https://stackoverflow.com/questions/51947018/django-modelform-foreign-key-dropdown-passes-str-but-stores-fkey

ModelForm: overriding is_valid()

2018-07-13 Thread clavierplayer
the primary key to find model objects, which any other time makes sense. I'm thinking the solution is to use a ModelForm, but I'm stuck on the same problem--I'm not sure how to accept a string from the user (instead of the primary key), do my own query, and fetch the required model object that way. I

Re: how to add radiobuttons to my ModelForm

2018-06-26 Thread Saloni Kalra
*template:* {% extends "posts/post_base.html" %} {% load bootstrap3 %} {% block post_content %} {% if not form.instance.pk %} Create Post {% else %} Update Post {% endif %} {% csrf_token %} {% bootstrap_form form %} {% endblock %} On Monday, 25 June 2018 23:47:07 UTC+5, alex eckert wrote:

Re: how to add radiobuttons to my ModelForm

2018-06-25 Thread alex eckert
Can you include your template code? The issue could be in there. On Sunday, June 24, 2018 at 10:15:50 AM UTC-5, Saloni Kalra wrote: > > I wish to add radio buttons fill in each parameter of my model and also to > convert it to integer on the backend. But somehow its not changing. Kindly > help.

how to add radiobuttons to my ModelForm

2018-06-24 Thread Saloni Kalra
I wish to add radio buttons fill in each parameter of my model and also to convert it to integer on the backend. But somehow its not changing. Kindly help. Thanks and regards, Saloni *Forms.py* class PostForm(forms.ModelForm): class Meta: fields =

Re: How to get the primary key of the underlying model in a ModelForm?

2018-05-30 Thread Mark Phillips
alf Of *Mark Phillips > *Sent:* Tuesday, May 29, 2018 4:15 PM > *To:* django users > *Subject:* How to get the primary key of the underlying model in a > ModelForm? > > > > I have a model, Document, and an associated DocumentForm(forms. > ModelForm), and a DocumentAdmin(ad

Admin site: pass data from AdminModel object to ModelForm object (or another way to pass data to "add" form)

2018-05-30 Thread Артур Скок
Globally, we need call "add" form for model in admin site, but with options selected by user: 1. user checks items in "changelist" of objects RepoFile 2. select action "create job" 3. redirect user to standard "add" form for new object DeviceCronJob where field download_files already checked by

RE: How to get the primary key of the underlying model in a ModelForm?

2018-05-29 Thread Matthew Pava
in a ModelForm? I have a model, Document, and an associated DocumentForm(forms. ModelForm), and a DocumentAdmin(admin.ModelAdmin). In the clean method of the DocumentForm, I need to get the document_id (ie primary key) of the underlying Document, but it is not included in the field set for that form. I need

How to get the primary key of the underlying model in a ModelForm?

2018-05-29 Thread Mark Phillips
I have a model, Document, and an associated DocumentForm(forms. ModelForm), and a DocumentAdmin(admin.ModelAdmin). In the clean method of the DocumentForm, I need to get the document_id (ie primary key) of the underlying Document, but it is not included in the field set for that form. I need

Bi-directional ManyToMany usage with ModelForm

2018-05-09 Thread Bernhard Miller
Hello, I'm currently implementing a django-based project that features users and user groups. The two are connected by a ManyToMany relationship. Using the generic django helpers (ModelForm, UpdateView, CreateView, ...) I would like to be able to edit this many to many connection from both

Re: unable to render initial data in ModelForm called through CreateView

2018-03-07 Thread furzihurzischleim
> Maybe you mean to be creating an UpdateView with this new information > about self.jobs? > > > > *From:* django...@googlegroups.com [mailto: > django...@googlegroups.com ] *On Behalf Of *furzihurzischleim > *Sent:* Wednesday, March 7, 2018 12:10 PM > *To:*

RE: unable to render initial data in ModelForm called through CreateView

2018-03-07 Thread Matthew Pava
: Wednesday, March 7, 2018 12:10 PM To: Django users Subject: Re: unable to render initial data in ModelForm called through CreateView thanks for the link, i was aware of that but was unable to find my error (that's why i turned to irc, and then to the list).. it is true self.jobs is set from

RE: unable to render initial data in ModelForm called through CreateView

2018-03-07 Thread Matthew Pava
/Django/1.11/django.views.generic.edit/CreateView/ From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of furzihurzischleim Sent: Wednesday, March 7, 2018 7:11 AM To: Django users Subject: Re: unable to render initial data in ModelForm called through CreateView

Re: unable to render initial data in ModelForm called through CreateView

2018-03-07 Thread furzihurzischleim
:) Invoice Form is "just" a normal Modelform - nothing fancy added. class InvoiceForm(forms.ModelForm): class Meta: model = Invoice fields = '__all__' def __init__(self,*args,**kwargs): print("Invoi

RE: unable to render initial data in ModelForm called through CreateView

2018-03-06 Thread Matthew Pava
To: django-users@googlegroups.com Subject: unable to render initial data in ModelForm called through CreateView hello list i ran into some weird stuff and neither i nor 2 gentle folks down at the irc-chat could find any obvious problems. task should have been easy: calculate some special initial

unable to render initial data in ModelForm called through CreateView

2018-03-05 Thread Gabriel Wicki
hello list i ran into some weird stuff and neither i nor 2 gentle folks down at the irc-chat could find any obvious problems. task should have been easy: calculate some special initial data and present it as initials in a form. the form is showed correctly, and the right values are printed in

Re: modelform selection options

2018-02-17 Thread sum abiut
Ok now i have written my view,py def payhistory(request): paynum=selection.objects.all() num=request.POST.get('dropdown') if request.method=='GET': form=paynumberform() else: select=selection.objects.get(num=num) #do someting return

modelform selection options

2018-02-15 Thread sum abiut
I have a model.py class selection(models.Model): select=( (A','A'), ('B','B'), ('C','C'), ) options=models.CharField(max_length=7,choices=select) and form.py class order(forms.ModelForm): class Meta: model=selection fields=('Pay_options,) I want to

modelform not loading from template

2018-02-08 Thread sum abiut
Hi, i have a hard time figuring out why this form in not loaded on the template. There is no error but the form is not loading. Please advise what i am missing here. view.py def addcontact(request): if request.method=='POST': form =ContactForm(request.POST) if

Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
*solved* forms.DateInput.input_type="date" forms.DateTimeInput.input_type="datetime-local" -- 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

Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
Hi,i tried that and got this. Double "type" (no override). -- 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

Re: modelform DateField rendering as text

2018-01-23 Thread Daniel Roseman
On Tuesday, 23 January 2018 07:17:48 UTC, Ruchit Bhatt wrote: > > Is there any bootstrap hack to fix this ?? > You don't need a hack, you can just set the type manually: self.fields['birth_date'].widget.attrs['type'] = 'date' -- DR. -- You received this message because you are subscribed

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,

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,

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:

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,

Re: Questions About ModelForm

2017-08-22 Thread James Schneider
cell has a radio button, and each succeeding > cell has information from the fields in the Document and DocumentOCR > tables. The user selects the document he/she wants to work on by clicking > on the appropriate radio button. > > Is there something in the ModelForm class that will crea

Questions About ModelForm

2017-08-20 Thread Mark Phillips
on by clicking on the appropriate radio button. Is there something in the ModelForm class that will create this table, or do I have to create the HTML for this table. From my reading, I gather I need to put the database query for the data set for the table in the view and pass that to the form

Re: ModelForm with field subset saving all fields

2017-07-29 Thread Tim Graham
ld come out of the box. > > My question is: Are there any considerations that I'm not aware of to > prevent saving the instance with the *update_fields* set to > *ModelForm.Meta.fields* in the base implementation of *ModelForm*? > -- You received this message because you are su

Problems with ModelForm which edits fields in 2 models

2017-07-28 Thread Uri Even-Chen
Hi friends, I have a problem with a form in Django 1.11.3. Here is the form: class ProfileNotificationsForm(forms.ModelForm): class Meta: model = User fields = ('notify_on_message', ) profile_model = get_site_profile_model(profile_model=None) profile_fields =

Re: ModelForm validation of foreign keys - extra database queries and performance bottleneck

2017-07-25 Thread johan de taeye
> > wrote: > > > I have a model that has a foreign key relation to a number of other > objects. > When saving an instance of this model from the admin (or a ModelForm), I > see plenty of extra and redundant database calls. > For a single record it wouldn't make much of a dif

Re: ModelForm validation of foreign keys - extra database queries and performance bottleneck

2017-07-25 Thread James Schneider
On Jul 24, 2017 4:09 AM, "johan de taeye" <johan.de.ta...@gmail.com> wrote: I have a model that has a foreign key relation to a number of other objects. When saving an instance of this model from the admin (or a ModelForm), I see plenty of extra and redundant database calls. For

ModelForm validation of foreign keys - extra database queries and performance bottleneck

2017-07-24 Thread johan de taeye
I have a model that has a foreign key relation to a number of other objects. When saving an instance of this model from the admin (or a ModelForm), I see plenty of extra and redundant database calls. For a single record it wouldn't make much of a difference, but when using the same ModeForm

ModelForm with field subset saving all fields

2017-07-20 Thread Cristina Botez
not aware of to prevent saving the instance with the *update_fields* set to *ModelForm.Meta.fields* in the base implementation of *ModelForm*? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

ModelForm not submitting data

2017-05-18 Thread Vipul Ujawane
def home(request): return render(request,'home.html') *#forms.py* class UploadForm(ModelForm): class Meta: model=Files fields=['file_name','files','subject','uploader_roll_no','uploader_email'] *#models.py* def get_file_path(instance,filename): return (settings.

Not able to see the dropdown field for Foreignkey ModelForm.

2017-05-18 Thread Vipul Ujawane
_str__(self): return (self.file_name) *#forms.py* class UploadForm(ModelForm): class Meta: model=Files fields=['file_name','files','subject','uploader_roll_no','uploader_email'] *#views.py* def check(request): if request.method == 'POST': form = Uplo

  1   2   3   4   5   6   7   8   9   10   >