Re: Preview of Form

2021-05-29 Thread Jim Illback
If I understand you correctly, you have an add (or update) form and you want to see what those fields would look like in a preview display (like a paper form equivalent). I would use an add/update form to input the data fields. At the bottom have 2 buttons: one would do the add/update without

Re: Assistance for deploying django app to heroku

2021-04-24 Thread Jim Illback
I didn’t see a “createsuperuser" command. Was that done or is it part of your fixtures.json load? Jim On Apr 24, 2021, at 8:04 AM, Ejike Enyinnaya mailto:ejike.chib...@gmail.com>> wrote: Good day Kasper, Thanks for your response. The git commands I put in the email was just to give a

Re: I have created a application in which i want to filter table between dates (from and to date) but i am not getting desired out put... Please guide me

2021-02-16 Thread Jim Illback
Neha, try changing your template for loop from: {% for results in formdata %} To: {% for results in search %} The name of your queryset in your context (d = {'search': search, 'fd': fd, 'td': td}) is search, not formdata. Also, I’d recommend improving your names. Things like “data” and

Re: Show FK as input instead of drop down in admin

2021-01-27 Thread Jim Illback
I think Kevin’s issue is that it takes a huge amount of runtime to create the FK’s select HTML tag - Django having to go through 1M rows before displaying the page. This issue is true in UpdateView CBVs as well. Changing the situation slightly - I’m talking about just primary keys from here

Re: Multiple submit for same form refresh the page

2020-05-09 Thread Jim Illback
’): … Good luck! Jim Illback > On May 9, 2020, at 6:15 AM, Nirantar Kulkarni wrote: > > html template > name="sub_form"> > {% csrf_token %} > {{name}} >"wordcloud">WordCloud >&qu

Re: Directly Accessing Dictionary Values

2019-11-21 Thread Jim Illback
Check out this URL and the embedded Django link in the answers: https://stackoverflow.com/questions/1700661/how-to-access-array-elements-in-a-django-template. On Nov 20, 2019, at 10:25 AM, Andrew Stringfield mailto:loneso...@gmail.com>> wrote: I have not! I did see something about that on a

Re: Directly Accessing Dictionary Values

2019-11-20 Thread Jim Illback
Have you tried for the first element, and so forth? Of course, you have to keep track of the number of entries. > On Nov 20, 2019, at 5:57 AM, Andrew Stringfield wrote: > > Okie-dokie. Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "Django

Django 2.2.2 having problems with daylight savings time

2019-11-08 Thread Jim Illback
at 01:18:34? The -08 timezone designation proves that easily. Isn’t this a bug in Django? Is it limited to just version 2.2.2? Thanks for any help with this issue, Jim Illback -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: New user question: Where to put non-form validation code?

2019-07-24 Thread Jim Illback
chosen this seemingly “inversion” of processing - first models’ processes, then forms’? And, perhaps more importantly, where should this either/or logic should be placed so it will take effect? Thanks very much, Jim Illback On Jul 13, 2019, at 11:48 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Jim Illback
I think you can also add to your class (right under your template_name… for example) this statement: permission_required = ‘appname.permission_name' This will limit to logged on users (as below), and also to users who possess this permission. Jim On May 28, 2019, at 9:55 AM, Joe

Re: Error during template rendering

2019-05-23 Thread Jim Illback
This error comes when there is a {% url %} tag that is not set up properly - like the views.py line highlighted below. So, I suspect you have such a tag say tied to a button on the html page, but it isn’t included in this thread. There’s another error in the code not related to your reverse

Re: Error during template rendering

2019-05-23 Thread Jim Illback
Below, post is a DB row, not an ID as the URL.py requires. Change the view as: return render(request, ‘blog/post_details.html’, {‘pk’: posts[‘id’]}) Jim On May 23, 2019, at 11:10 AM, Rock N Roll Mühlbacher mailto:chmuhlbache...@gmail.com>> wrote: Am Donnerstag, 23. Mai 2019 20:06:31 UTC+2

Re: Is it possible to value based on another aggregation?

2019-05-21 Thread Jim Illback
Sorry this is late. I’d use the annotate to get the Max of one FK. Then, do a query on the other FK table with inverted order_by and use the [0] notation to just retrieve the latest row. It is 2 queries, but FK processes are indexed and should be fast. Hope this helps. Jim Illback On Apr 23

Re: formfield_overrides doesn't work

2019-05-12 Thread Jim Illback
etterthancomplex.com/2015/12/04/package-of-the-week-django-widget-tweaks.html. I hope this is useful for you. Jim Illback On May 12, 2019, at 3:03 PM, Tim Johnson mailto:t...@akwebsoft.com>> wrote: * Joe Reitman mailto:jreitma...@gmail.com>> [190512 13:34]: Tim, I found this in

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
Op 24 aug. 2018, om 21:28 heeft Jim Illback mailto:subaru...@hotmail.com>> het volgende geschreven: Vijay, your suggestion worked. I had tried this previously but it was using a FBV and it didn’t work. But with this CBV app, it works perfectly. Thanks. Matthew, I’ll definitely keep you

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
system will still have to load all 37K values. I guess I’m missing something in your explanation. From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> [mailto:django-users@googlegroups.com] On Behalf Of Jim Illback Sent: Friday, August 24, 2018 1:16 PM To: Django users

Re: Django performance issue that's troubling

2018-08-24 Thread Jim Illback
r as I know, it doesn't need to (if the entry already exists in the database and you are just editing it), you just need to set up the fields that you want to be editable by the user On Fri, Aug 24, 2018 at 2:06 PM Jim Illback mailto:subaru...@hotmail.com>> wrote: Vijay, think of this i

Re: Django performance issue that's troubling

2018-08-23 Thread Jim Illback
model with thousands of records? like rendering a select combo box with thousands of choices? On Thu, Aug 23, 2018 at 5:30 PM Jim Illback mailto:subaru...@hotmail.com>> wrote: I have a Django app in development that performed perfectly with about 20 client records. Each client could have one or

Django performance issue that's troubling

2018-08-23 Thread Jim Illback
I have a Django app in development that performed perfectly with about 20 client records. Each client could have one or more support records and there are 40 potential support records, connected to the client with a ForeignKey (client_id). Then, I loading about 37K client records. Search

Re: Django DateField

2018-07-05 Thread Jim Illback
Add another field, say asap = model.BooleanField(default=False), sort by asap, date in reverse. The field asap True values will be sorted first, then the asap False will be sorted by date. You may want to ensure asap = False only if date is not None. On Jul 5, 2018, at 10:05 AM, 'dtdave' via

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-30 Thread Jim Illback
alue(s) needed in __init__() ... That is pretty much it - simple if you have the proper documentation on how to initialize forms. Jim On Apr 27, 2018, at 11:39 AM, Jim Illback <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: Absolutely agree. The “instance” (your no

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
django-users@googlegroups.com<mailto:django-users@googlegroups.com> [mailto:django-users@googlegroups.com] On Behalf Of Jim Illback Sent: Friday, April 27, 2018 11:33 AM To: Django users Subject: Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values I also need to have the spe

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
.instance.pk) I hope that helps! From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> [mailto:django-users@googlegroups.com] On Behalf Of Jim Illback Sent: Friday, April 27, 2018 11:16 AM To: Django users Subject: Re: Dynamically altering a (ForeignKey) ModelChoiceField

Re: Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-27 Thread Jim Illback
it is displayed? Thanks for any help to answer this question. Jim Illback On Apr 25, 2018, at 10:41 AM, Jim Illback <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: I wondered if anyone has had to alter the queryset behind a model form’s foreign key field which presents as a

Dynamically altering a (ForeignKey) ModelChoiceField’s values

2018-04-25 Thread Jim Illback
I wondered if anyone has had to alter the queryset behind a model form’s foreign key field which presents as a model choice field? Briefly, I have a client attribute table with the foreign key to a chore/time table. For an add of the client attribute table, I want to limit entries to unassigned

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
n around and comment out that same code, uncomment the real code shown above, and run migrations again. It works, but it seems a bit awkward. Has anyone else had this issue? Or am I doing something wrong? Thanks much, Jim Illback On Aug 18, 2017, at 1:21 AM, James Bennett <ubern...@gmail.c

Re: A lot of Problems with Migrating (conceptual)

2017-08-18 Thread Jim Illback
anyone else had this issue? Or am I doing something wrong? Thanks much, Jim Illback On Aug 18, 2017, at 1:21 AM, James Bennett <ubernost...@gmail.com<mailto:ubernost...@gmail.com>> wrote: On Thu, Aug 17, 2017 at 1:03 PM, Antonis Christofides <anto...@djangodeployment.

Re: Django form needs pagination and saved data - how????

2017-07-31 Thread Jim Illback
Super advice - thanks very much, James! Appreciate your help. Jim On Jul 30, 2017, at 5:55 PM, James Schneider <jrschneide...@gmail.com<mailto:jrschneide...@gmail.com>> wrote: On Jul 30, 2017 4:50 PM, "Jim Illback" <subaru...@hotmail.com<mailto:subaru...@hotmail.

Re: Django form needs pagination and saved data - how????

2017-07-30 Thread Jim Illback
house? On Jul 30, 2017, at 4:51 AM, James Schneider <jrschneide...@gmail.com<mailto:jrschneide...@gmail.com>> wrote: On Jul 28, 2017 5:56 PM, "Jim Illback" <subaru...@hotmail.com<mailto:subaru...@hotmail.com>> wrote: I use the latest versions of Djang

Django form needs pagination and saved data - how????

2017-07-28 Thread Jim Illback
} } return hold; } } function strToArray(txt) { var array = []; var i = 0; var j = 0; var len = txt.length; for (i=0; i < len; i++) { if (txt[i] == ",") { array.push(txt.substring(j, i)); j = i+1; } } return array; } {% endblock content %} Thanks for any h