Re: In django template cannot get data from values_list() for select options dropdown

2024-09-27 Thread Abdul Qoyyuum Haji Abdul Kadir
Maybe change this: Province.objects.values_list("id", "province_name") to this: Province.objects.values_list("id") Although that doesn't explain the [] around 1. Are there multiple ids per province_name? On Fri, 27 Sept 2024 at 22:05, Cương Vũ Thế wrote: > Im django noob here so I would like t

In django template cannot get data from values_list() for select options dropdown

2024-09-27 Thread Cương Vũ Thế
Im django noob here so I would like to get your support. Thank you so much in advanced. *1. My model.py:* class Province(models.Model): province_name = models.CharField() class Employee(models.Model): first_name = models.CharField() province = models. ForeignKey(Province, on_delete=models.CAS

Unable to get a simple two level dependent dropdown working

2024-03-18 Thread 'Animesh Gupta' via Django users
Can someone help me understand what am I doing wrong in this django dependent dropdown code? My selection for the first dropdown menu is one of ("NetEng", "ITDE") and when I select, let's say "NetEng", an ajax call is made to the ajax function in the backend v

Django Admin Dropdown Filtering: Show Exam Class Related Students in Student Assign Field

2023-09-01 Thread Sabbir Hasan Munna
https://stackoverflow.com/q/77018469/9885741 -- 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 view this discussion o

django restrict choice options in dropdown according to the user type

2021-12-10 Thread Trippy Samurai
Hi, I have two user types usertype a and usertype b i have a form to update the task with fields name,info and status i have STATUS_CHOICES = ( ('A','A'), ('B','B'), ('C','C') ) the user type a should c only ('A','A&#x

Re: Select from the dropdown the object car that has the field is_active

2020-11-15 Thread Apolo Machine
Thanks a lot! that totally makes sense and works! El dom., 15 nov. 2020 a las 11:07, David Nugent () escribió: > On 15 Nov 2020, at 23:27, Apolo Machine wrote: > > > hello, i'm a newbie using django and i have a problem that cannot solve. > In my createview i need to sele

Re: Select from the dropdown the object car that has the field is_active

2020-11-15 Thread David Nugent
On 15 Nov 2020, at 23:27, Apolo Machine wrote: > > hello, i'm a newbie using django and i have a problem that cannot solve. > In my createview i need to select from the dropdown the object car that has > the field is_active = true, > how can i acomplish that? > &

Select from the dropdown the object car that has the field is_active

2020-11-15 Thread Apolo Machine
hello, i'm a newbie using django and i have a problem that cannot solve. In my createview i need to select from the dropdown the object car that has the field is_active = true, how can i acomplish that? class Car(models.Model): brand = models.charfield(...) is_a

Re: Dropdown

2020-11-09 Thread Derek
0 at 16:06:32 UTC+2 shubham...@gmail.com wrote: > How do you make a dropdown box in django -- 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 t

Re: Dropdown

2020-11-06 Thread Adithya Gowli
eshpande wrote: > > How do you make a dropdown box in django > > > > You don't use Django for that. That's plain HTML: > > https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select > > Kind regards, > > Kasper Laudrup > > -- > You

Re: Dropdown

2020-11-05 Thread Kasper Laudrup
Hi Shubham. On 05/11/2020 06.17, Shubham Deshpande wrote: How do you make a dropdown box in django You don't use Django for that. That's plain HTML: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select Kind regards, Kasper Laudrup -- You received this message becau

Dropdown

2020-11-05 Thread Shubham Deshpande
How do you make a dropdown box in django -- 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 view this dis

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

2020-06-19 Thread chaitanya orakala
AM chaitanya orakala < >> chaitu.orak...@gmail.com> wrote: >> >>> sure, I will do it by tomorrow >>> >>> >>> On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty >>> wrote: >>> >>>> Nice >>>> >>&g

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

2020-06-19 Thread chaitanya orakala
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 requi

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

2020-06-10 Thread chaitanya orakala
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, Jun 7, 2020 at 1:18 PM AMINE AZIZ wrote:

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

2020-06-10 Thread Balaji Shetty
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 c

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
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) >>>

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

2020-06-08 Thread Balaji Shetty
be display none, and with Jquery you can show it >> if user change value to yes dropdown (select) >> >> you will use id div of pupup to show it or hide it >> >> >> if (!$) { >> // Need this line because Django also provided jQuery and namespaced

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

2020-06-08 Thread chaitanya orakala
y 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 use id div of pupup to show it or hide it > > > if (!$) { > // Need th

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

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

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*

Django dropdown data display issues in the control

2020-05-01 Thread Ajeet Kumar Gupt
> Hi, > > I am a beginner in Django and want to developing one assignment in django. > > Now, I am created one model category and subcategory. Based on category > populate the data sub-category and data have saved like the below format. > > *Category = * Operations > > *Subcategory =* Category1,Cat

i18n: Miscellaneous as dropdown-menu

2020-04-29 Thread René Labounek
{% for language in languages %} {{ language.name_local }} ({{ language.code }}) {% endfor %} This works fine and I have not identified any error with the above mentioned code. Nevertheles, I would prefer implement it as working dro

Dropdown not working

2020-04-29 Thread Kushal Neupane
The dropdown is not working. Code: https://pastebin.com/VkyJQGjx -- 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...@googlegrou

Django dropdown data display issues in the control

2020-04-28 Thread Ajeet Kumar Gupt
Dear Team, I am a beginner in Django and want to developing one assignment in django. Now, I am created one model category and subcategory. Based on category populate the data sub-category and data have saved like the below format. *Category = * Operations *Subcategory =* Category1,Category2,Ca

Re: [Django] How to render a form 'n' number of times based on the dropdown selected integer in main Form

2019-12-15 Thread Dominick Del Ponte
the user input on integer field from the dropdown box in a > template, i need to display few more fields waiting for the user input. > Ex:If user selected an integer :3 i need to display another form 3 times > containing few fields [ text input fields,choice fields] in the same html > djang

[Django] How to render a form 'n' number of times based on the dropdown selected integer in main Form

2019-12-14 Thread Dilipkumar Noone
1.I have the below requirement in django to implement. a)I have a main form with a few fields [text input fields,choice fields ] b)Based on the user input on integer field from the dropdown box in a template, i need to display few more fields waiting for the user input. Ex:If user selected

Re: Django redirect to a view function after selecting an item from dropdown box

2019-09-13 Thread Nelson Varela
check the value of your form field in the post. Based on that value you van do stuff Op woensdag 11 september 2019 14:39:12 UTC+2 schreef Rudolph Louis Cabeltis: > > Hello, > > I am using Forms by Django. And that form has a select box with two > options. > After a user selected an option. I wou

Django redirect to a view function after selecting an item from dropdown box

2019-09-11 Thread Rudolph Louis Cabeltis
Hello, I am using Forms by Django. And that form has a select box with two options. After a user selected an option. I would like the user to do the function in the django view. Will I be able to do this without using AJAX or Javascript? Thank you. -- You received this message because you are

Re: search data from dropdown box

2019-06-29 Thread Charlotte Wood
You mean to print it out on a search page, or to actually make a drop down box appear? Charlotte Wood, MEd Educator (405) 578-5701 Zoom Meeting ID#: 4055785701 *Zoom URL:* https://epiccharterschools.zoom.us/j/2970513912 Classroom Google Site: https://sites.google.com/epiccharterschools.org/c

search data from dropdown box

2019-06-29 Thread Pradeep Singh
How to get the value from the drop down box ?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: Django Admin Multiple Models and Dropdown list

2018-09-18 Thread mab . mobile . 01
> > On Tue, Sep 18, 2018 at 12:18 PM, > > wrote: > >> I have the following models and admin files and I would like to be able >> to show the text representation of the ExpenseCategory category field in >> the dropdown list on the Admin page. However, the dropdown

Re: Django Admin Multiple Models and Dropdown list

2018-09-18 Thread Julio Biason
in the > dropdown list on the Admin page. However, the dropdown list is displaying > "ExpenseCategory Object(n)" instead of the actual text category such as > "Utilities", "Office Supplies" etc. > > I need to insert the ExpenseCategory pk in the Expenses

Django Admin Multiple Models and Dropdown list

2018-09-18 Thread mab . mobile . 01
I have the following models and admin files and I would like to be able to show the text representation of the ExpenseCategory category field in the dropdown list on the Admin page. However, the dropdown list is displaying "ExpenseCategory Object(n)" instead of the actual text catego

Re: Searchable dropdown from models

2018-08-29 Thread Mark Phillips
function withing the django framework. Hope this helps! Mark On Wed, Aug 29, 2018 at 1:02 PM, ah wrote: > Hi, > I am trying to create a searchable dropdown list based on Django's model. > I have a model M that has 6 objects [apple,orange,carrot,banana, > kiwi,peach]. > I want

Searchable dropdown from models

2018-08-29 Thread ah
Hi, I am trying to create a searchable dropdown list based on Django's model. I have a model M that has 6 objects [apple,orange,carrot,banana,kiwi,peach]. I want to create a view that will have a search box like a html datalist. when user types in "app" -- apple should show

Django ModelForm Foreign Key Dropdown passes __str__ but stores fkey_id

2018-08-21 Thread HiMAnsHu
in my client model from 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-

Re: Populate a select dropdown based on queryset

2018-03-30 Thread James Farris
On Wednesday, 28 March 2018 23:02:36 UTC+2, James Farris wrote: >> Hi, >> >> I'm trying to populate a 'vaccine' dropdown based on a 'species' of a pet. >> For example, if a pet is a 'dog' I want to display vaccines for a dog only. >>

Re: Populate a select dropdown based on queryset

2018-03-30 Thread Derek
You can use "smart selects": https://github.com/digi604/django-smart-selects Works for both normal forms and in the admin. On Wednesday, 28 March 2018 23:02:36 UTC+2, James Farris wrote: > > Hi, > > I'm trying to populate a 'vaccine' dropdown based on a &#

Populate a select dropdown based on queryset

2018-03-28 Thread James Farris
Hi, I'm trying to populate a 'vaccine' dropdown based on a 'species' of a pet. For example, if a pet is a 'dog' I want to display vaccines for a dog only. If a pet is a cat, I want to display a list of vaccines for cats only. How do I do this? I google

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-30 Thread Melvyn Sopacua
On vrijdag 26 januari 2018 22:25:55 CET eil...@themaii.org wrote: > well, you certainly got me correct! I'm fairly new to python - didn't do > much coding to learn. Trial by fire, sort of. and the original person who > put this together is now gone from the company and won't answer any > outstandin

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-26 Thread eileen
well, you certainly got me correct! I'm fairly new to python - didn't do much coding to learn. Trial by fire, sort of. and the original person who put this together is now gone from the company and won't answer any outstanding questions. Plus, I *think* he got most of the code from 3rd party s

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-26 Thread Melvyn Sopacua
There are a bunch of issues with this code: 1) Spell Physical correctly: > 2 - Phyiscal > if form.data['handicapped'] is 'Physical' or 'Mental': > handicapped = forms.ChoiceField(choices=[(x, x) for x in ('---', > 'Mental', 'Physcal')], required=False) Comparison of non

how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-24 Thread eileen
I need to create an edit box called handicapped with three drop down options on the display: 0 - none 1 - Mental 2 - Phyiscal and connect it to the handicapped field init(11) in the family database I know I have to do something like: if form['handicapped'].data == 1 or 2:

Hello all, try to make dropdown in form

2017-11-03 Thread JP
Hello all, any help would be appreciated, I think this is basic stuff but can find how to do it online So I made the class and the form and the view every thing works but the background color of the drop down menu in the form is black and txt is grey (white when mouse is over). I don t think

Re: Fwd: [django] Excluir un ítem de un dropdown en el admin de django

2017-06-20 Thread Melvyn Sopacua
On Tuesday 20 June 2017 02:24:20 Rafael E. Ferrero wrote: > The trouble it's because Firefighter class is a child of Person class > so the Firefighter item are in the two dropdowns and it shouldn't Are you sure a firefighter is a person? Or is it the person's job? Show your models, cause it's

Fwd: [django] Excluir un ítem de un dropdown en el admin de django

2017-06-19 Thread Rafael E. Ferrero
I have to make a parent relation between two people (brother/sister, father/mother, etc) in my projec. I have a Person class and a child class named Firefighter. What I need it's to indicate the parent relation between the selected Firefighter and the selected Person, for that I have two dro

Not able to see the dropdown field for Foreignkey ModelForm.

2017-05-18 Thread Vipul Ujawane
This is my code: *#models.py* class Subject(models.Model): departement_code=models.CharField(max_length=2,blank=False) subje

Re: Create navbar dropdown menu list with url tags

2016-07-12 Thread Prog Nauts
ok clear Il giorno mercoledì 6 luglio 2016 16:27:41 UTC+2, pythonc...@gmail.com ha scritto: > > Hi, > I have a model and whould like to create a dropdown menu from the fields > generated. > Unfortunately no dropdown list is showed: > > {% for

Re: Create navbar dropdown menu list with url tags

2016-07-07 Thread ludovic coues
"## {{ airlines|pprint }}" can't display a dropdown menu. It's a debug tool. It's supposed to show two # symbol so you know you are editing the right template then it should display a python representation of what airlines is. If things work as expected, you should have s

Re: Create navbar dropdown menu list with url tags

2016-07-07 Thread pythonconfused
eturn render(request, template, {}) Il giorno mercoledì 6 luglio 2016 16:27:41 UTC+2, pythonc...@gmail.com ha scritto: > > Hi, > I have a model and whould like to create a dropdown menu from the fields > generated. > Unfortunately no dropdown list is showed: > >

Re: Create navbar dropdown menu list with url tags

2016-07-06 Thread ludovic coues
try to add that ## {{ airlines|pprint }} If it show `## ''` in the page, airlines is not defined in the template context. 2016-07-06 12:21 GMT+02:00 : > Hi, > I have a model and whould like to create a dropdown menu from the fields > generated. > Unfortunately no d

Create navbar dropdown menu list with url tags

2016-07-06 Thread pythonconfused
Hi, I have a model and whould like to create a dropdown menu from the fields generated. Unfortunately no dropdown list is showed: {% for airline in alirlines %} {{ airline.airline }} {% endfor %} this is the model

Re: Using Django Smart Selects to populate a dropdown menu within a form

2016-01-29 Thread Rafael E. Ferrero
you must to use Ajax to populate the second dropdown Rafael E. Ferrero 2016-01-29 14:08 GMT-03:00 Andrea Pinna : > Dear all, > > I'm very unexperienced with Django but at the same time I'm trying hard to > learn as much as possible. > > In my website I have a form

Using Django Smart Selects to populate a dropdown menu within a form

2016-01-29 Thread Andrea Pinna
Dear all, I'm very unexperienced with Django but at the same time I'm trying hard to learn as much as possible. In my website I have a form with two dropdown menus, and I'd like to make the second (items) dependent by the first (categories). As an example, in the first dropdo

Re: Admin List Per Page Dropdown UI

2015-07-07 Thread Dean Christian Armada
This is not what I meant.. This will just set once the admin is loaded. What I want is I can manipulate the number records shown within the interface On Tuesday, July 7, 2015 at 7:34:23 PM UTC+8, larry@gmail.com wrote: > > On Tue, Jul 7, 2015 at 7:12 AM, Dean Christian Armada > > wrote: >

Re: Admin List Per Page Dropdown UI

2015-07-07 Thread Larry Martell
On Tue, Jul 7, 2015 at 7:12 AM, Dean Christian Armada wrote: > Hi Everyone, > > Is there an available option in the UI of Django Admin to manually select > how many records to be shown per page? https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_per_page

Admin List Per Page Dropdown UI

2015-07-07 Thread Dean Christian Armada
Hi Everyone, Is there an available option in the UI of Django Admin to manually select how many records to be shown per page? -- 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, sen

Re: django admin interface - how to enable adding new entries to foreign key-linked dropdown menu?

2014-10-09 Thread Russell Keith-Magee
Hi Eliezer, The trick is to add a ModelAdmin for Exercise. The obvious consequence of this is that you'll get a "top level" menu option to add exercises. However, a side effect is that everywhere that you have a model with a foreign key to exercise (like in your Segment inline), you'll get a litt

Re: How to implement chained/related dropdown lists in a page

2014-10-08 Thread Collin Anderson
I haven't done it much, but, yeah, ajax is probably best. Maybe something like might work: $('#id_category').change(function(){ var category = $(this).val() // not sure about this. the point is, get the selected id. $.get('/subcategory-options/?category=' + encodeURIComponent(category),

django admin interface - how to enable adding new entries to foreign key-linked dropdown menu?

2014-10-07 Thread Eliezer Kanal
I'm writing a rudimentary exercise app in django, with the following table structure: Routine Exercise Segment = = = routine_name exercise_name routine_id (fk) routine_id exercise_id exercise_id (fk) order duration * (fk) = foreign key In practice, this looks as follows:

How to implement chained/related dropdown lists in a page

2014-10-07 Thread Frankline
I am interested in knowing how other developers implement chained dropdown lists that are dependent on one another. As an example, I have a page/form that has two dropdown lists. When I select a value from the first select, I want the second dropdown to be populated by records related to the first

Re: admin generated form, change dropdown with selction from popup menu

2014-06-25 Thread Derek
day, June 25, 2014 6:11:27 AM UTC+1, Aeh. ABID wrote: >> >> When dropdown could hold a pretty long list which may slowdown the page >> load, how can I override the drop-down menu in the change-form to a >> "read-only input" that can be filled with value from pop

Re: admin generated form, change dropdown with selction from popup menu

2014-06-24 Thread Aeh. ABID
Is there a way to display a field value other than id in the textbox On Wednesday, June 25, 2014 6:11:27 AM UTC+1, Aeh. ABID wrote: > > When dropdown could hold a pretty long list which may slowdown the page > load, how can I override the drop-down menu in the change-form to a >

Re: admin generated form, change dropdown with selction from popup menu

2014-06-24 Thread Aeh. ABID
min%2F%23django.contrib.admin.ModelAdmin.raw_id_fields&sa=D&sntz=1&usg=AFQjCNGeFg4geueOcn3NGtKFN1NRYfpDyw> On Wednesday, June 25, 2014 6:11:27 AM UTC+1, Aeh. ABID wrote: > > When dropdown could hold a pretty long list which may slowdown the page > load, how can I overrid

admin generated form, change dropdown with selction from popup menu

2014-06-24 Thread Aeh. ABID
When dropdown could hold a pretty long list which may slowdown the page load, how can I override the drop-down menu in the change-form to a "read-only input" that can be filled with value from popup window. -- You received this message because you are subscribed to the Google Group

Re: Layered Dropdown List

2012-12-24 Thread CodingDaddy
;> Hi, >> >> Le 24 déc. 2012 à 08:43, CodingDaddy >> > >> a écrit : >> >> I would like to ask your advice on how I can implement layered dropdown >> list. >> Let's say I have three tables, one called Country, another called State, >>

Re: Layered Dropdown List

2012-12-24 Thread CodingDaddy
Ordoquy wrote: > > Hi, > > Le 24 déc. 2012 à 08:43, CodingDaddy > > a écrit : > > I would like to ask your advice on how I can implement layered dropdown > list. > Let's say I have three tables, one called Country, another called State, > and the ot

Re: Layered Dropdown List

2012-12-24 Thread carlos
maybe this app help you https://github.com/digi604/django-smart-selects Cheers On Mon, Dec 24, 2012 at 10:47 AM, Xavier Ordoquy wrote: > Hi, > > Le 24 déc. 2012 à 08:43, CodingDaddy a écrit : > > I would like to ask your advice on how I can implement layered dropdown > l

Re: Layered Dropdown List

2012-12-24 Thread Xavier Ordoquy
Hi, Le 24 déc. 2012 à 08:43, CodingDaddy a écrit : > I would like to ask your advice on how I can implement layered dropdown list. > Let's say I have three tables, one called Country, another called State, and > the other called 'City' > And you are adding informat

Layered Dropdown List

2012-12-24 Thread CodingDaddy
Hello, I would like to ask your advice on how I can implement layered dropdown list. Let's say I have three tables, one called Country, another called State, and the other called 'City' And you are adding information about a particular city in admin site. So I want to have a dro

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-18 Thread Melvyn Sopacua
On 17-8-2012 0:05, houmie wrote: > DealType class has a many to many relationship to sales_item. Therefore > using inline formsets wouldn't be possible. I have tried it and inlines > need foreign key. You *can* use the reverse bit of a ManyToManyField with inline formsets. The information on how

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread Kurtis Mullins
one. iw > ill look into the list you have sent me. > > On another note, Simone mentioned to extend the Formset in order to run my > own dropdown solution. > > I was just looking at the modelformset_factory class and - surpise > surprise - it accepts a formfield_callback par

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
Thanks Melvyn, To be honest I would be willing to purchase a widget if there was one. iw ill look into the list you have sent me. On another note, Simone mentioned to extend the Formset in order to run my own dropdown solution. I was just looking at the modelformset_factory class and

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread Melvyn Sopacua
On 17-8-2012 15:00, houmie wrote: > Yes, I know about overriding a widget. I could override a Charfield with > a TextArea. For simple stuff it makes sense. > Against which widget do I override the existing M2M widget though? If the one that Tomas linked doesn't work for you, you'll need to consu

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
Thanks Melvyn, Yes, I know about overriding a widget. I could override a Charfield with a TextArea. For simple stuff it makes sense. Against which widget do I override the existing M2M widget though? On 17/08/12 01:01, Melvyn Sopacua wrote: On 17-8-2012 1:05, Houman wrote: What I am tryin

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
Thanks Thomas. Just trying to apply the DropDownMultiple Widget that you have suggested. I have followed the instruction: |class MyForm(forms.ModelForm): categories = forms.Field(widget=DropDownMultiple) def __init__(self, *args, **kwargs): self.base_fields['categories'].widge

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Simone Federici
On 16/ago/2012, at 23:35, Houmie wrote: > The question might seem too simplistic, but it seems formsets can only work > with forms that have simple type fields such as charfield. > But has anyone tried to use a form with a dropdown and use that form to > instantiate a formset?

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Tomas Neme
DropDownMultiple widget http://djangosnippets.org/snippets/747/ -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. --

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Melvyn Sopacua
On 17-8-2012 1:05, Houman wrote: > What I am trying to achieve would be deal type having a m2m > relationship to sales items. I don't like the m2m widget, So change it. All ModelForm derivatives have a widgets argument that is a dictionary of fieldname => widget instance:

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Houman
Hi xavier, Apologies for the confusion. What I am trying to achieve would be deal type having a m2m relationship to sales items. I don't like the m2m widget, so I thought I use formsets with dropdowns in them. The idea is good, somce the user would choose how many dropdowns he wants and point

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Xavier Ordoquy
Hi Houman Le 17 août 2012 à 00:05, houmie a écrit : > DealType class has a many to many relationship to sales_item. Therefore > using inline formsets wouldn't be possible. I have tried it and inlines need > foreign key. DealType has a ForeignKey to Company which is what you're filtering wit

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread houmie
Hi Xavier, This wasn't the whole story. I actually have a DealType class: |class DealType(models.Model): deal_name= models.CharField(max_length=40) sales_item= models.ManyToManyField(SalesItem) price= models.DecimalField(decimal_places=2) | DealType class has a man

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Xavier Ordoquy
Hi, I'm not sure I understood what you're trying to do. If you want to display all the SaleItem linked to a company in a formset, then inlines are what you're looking for. You'll find the documentation about them there: https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#inline-forms

How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Houmie
The question might seem too simplistic, but it seems formsets can only work with forms that have simple type fields such as charfield. But has anyone tried to use a form with a dropdown and use that form to instantiate a formset? Let me give you an example why this fails: *Model:* class

Re: ForeignKey as dropdown list, get user's choice

2012-07-24 Thread Dmitry Zimnukhov
First you say that the field "is being rendered on the template as dropdown list", and then "it's not rendered as a classic html select" How is it rendered? Isn't html select a drop-down list? By the way models.ForeignKey is a model field, not a form field. How is

ForeignKey as dropdown list, get user's choice

2012-07-24 Thread mapapage
Hello! I have a form including a field: veh_id1 = models.ForeignKey(Vehicles)) that is being rendered on the template as dropdown list. Now I want according to the user's choice in that list some other fields of my form to be auto-completed and displayed on the template before the

Re: Checking if a dynamicallygenerated dropdown has a selected item

2012-07-23 Thread Sithembewena Lloyd Dube
Thanks Daniel :) Was just poring over the Formsets documentation now ... looks like what I need. I will update this thread with the results later. On Mon, Jul 23, 2012 at 10:09 PM, Daniel Roseman wrote: > On Monday, 23 July 2012 21:05:54 UTC+1, Lloyd Dube wrote: >> >> Hi all, >> >> I am not us

Re: Checking if a dynamicallygenerated dropdown has a selected item

2012-07-23 Thread Daniel Roseman
On Monday, 23 July 2012 21:05:54 UTC+1, Lloyd Dube wrote: > > Hi all, > > I am not using django forms for this. I did think along the lines of doing > the following: > - implement the Question form, override __init__ in the model to return > answers for that question, > - instantiate a form for e

  1   2   3   >