Re: Increasing iteration count for the PBKDF2 password hasher

2024-05-23 Thread Mike Dewhirst
On 23/05/2024 6:12 pm, Shaheed Haque wrote: Hi, As happens from time-to-time, I see the 5.1 alpha recently announced has increased the iteration count for the PBKDF2 password hasher (from 720k to 870k), and the putative release notes for 5.2 mention a further increase (to 1M). I assume

Re: Does migrate --fake updates django_migrations?

2024-03-23 Thread Mike Dewhirst
On 23/03/2024 12:39 am, Jean-Baptiste Pressac wrote: Hello, The doc says about migrate --fake: /Marks the migrations up to the target one (following the rules above) as applied, but without actually running the SQL to change your database schema. / But what is the operations behind this

Re: Django web site is not opened though runserver us running

2024-03-06 Thread Mike Dewhirst
On 7/03/2024 3:02 pm, ram.mu...@gmail.com wrote: Hi, Hoping someone can provide some clue on this? I think you'll find most people are reluctant to click on unsolicited web links no matter how innocent they appear to be. Perhaps you can describe the problem, tell us what you have tried and

RE: How to send email from django without authenticate smtp server

2024-03-05 Thread Mike Dewhirst
Why don't you use TLS so your connection with the server is encrypted? Port 25 is a bit ancient.--(Unsigned mail from my phone) Original message From: Praveen Chaudhary Date: 5/3/24 04:50 (GMT+10:00) To: django-users@googlegroups.com Subject: How to send email from django

RE: How to send email from django without authenticate smtp server

2024-03-05 Thread Mike Dewhirst
Why don't you use TLS so your connection with the server is encrypted? Port 25 is a bit ancient.--(Unsigned mail from my phone) Original message From: Praveen Chaudhary Date: 5/3/24 04:50 (GMT+10:00) To: django-users@googlegroups.com Subject: How to send email from django

Re: Data model design questio: graph in database

2024-02-26 Thread Mike Dewhirst
On 26/02/2024 8:00 pm, Sébastien Hinderer wrote: I will thus need to find a way to disable in the admin interface the possibility to work directly on the Vertex and Edge classes, but I expect the documentation will tell me how to achieve this. In fact you need to enable the classes you want -

Re: Data model design questio: graph in database

2024-02-25 Thread Mike Dewhirst
Re-reading your question perhaps I was too brief in my earlier response. Let me assume all your actual edges and vertices are objects of child classes. I also assume your base Edge and Vertex classes are abstract for inheritance purposes only. It doesn't matter whether instances of edges and

Re: Data model design questio: graph in database

2024-02-25 Thread Mike Dewhirst
SebYour assumption is too pessimistic. The class name of the (child) instance will always be returned from obj.__class__If instead your method returned the type(obj) you would see the base class name instead of the child class name.Perhaps you need to establish some tests which assert what you

Re: Data model design questio: graph in database

2024-02-24 Thread Mike Dewhirst
On 24/02/2024 7:20 am, Sébastien Hinderer wrote: Dear all, Using the mailing list rather than the forum because, like many visually impaired people, I find mailing lists way easier to use than forums, I hope the list is still active. I need to store in database and manipulate graphs of which

Re: HttpResponse works but HttpResponseRedirect does not

2024-01-02 Thread Mike Dewhirst
quot;output.csv"' return responseLe mar. 2 janv. 2024 à 05:45, Mike Dewhirst a écrit : I wonder if someone can point out my mistake? The following code happily downloads a constructed text file ...     csv = make_csv(context['result'])     # This do

HttpResponse works but HttpResponseRedirect does not

2024-01-01 Thread Mike Dewhirst
I wonder if someone can point out my mistake? The following code happily downloads a constructed text file ...     csv = make_csv(context['result'])     # This downloads a csv file to the user desktop     return HttpResponse(     csv,     headers={     'Content-Type':

Re: logging admin accesses

2023-12-19 Thread Mike Dewhirst
I was saying Django's inspectdb will write them for you.M--(Unsigned mail from my phone) Original message From: Larry Martell Date: 20/12/23 00:51 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: logging admin accesses On Mon, Dec 18, 2023 at 7:23 PM Mike Dewhirst

Re: logging admin accesses

2023-12-18 Thread Mike Dewhirst
els ... just having the model declarations should not require a migration. Haven't checked that myself. On Mon, Dec 18, 2023 at 5:26 PM Mike Dewhirst wrote: Those many-to-many relations most certainly can have models and all of mine always do. It is more explicit to do so but m

Re: logging admin accesses

2023-12-18 Thread Mike Dewhirst
I have not see django-simple-history - thanks for the pointer - will check it out.>> On Fri, Dec 15, 2023 at 9:02 PM Mike Dewhirst wrote:>>>> Just thinking about it again ... you could look at the Admin source to see how it is working now and perhaps find a way to include the mis

Re: logging admin accesses

2023-12-15 Thread Mike Dewhirst
) Original message From: Mike Dewhirst Date: 16/12/23 12:38 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: logging admin accesses You seem to be asking for a full history 'system'. I think the Admin history exists to show a bit of history with a link to go back to the change

Re: logging admin accesses

2023-12-15 Thread Mike Dewhirst
) To: django-users@googlegroups.com Subject: Re: logging admin accesses On Thu, Dec 14, 2023 at 5:49 PM Mike Dewhirst wrote:Top posting because of phone email client.Have you seen the Admin history? Might be already logged for you.Thanks, this is useful, but it does not seem to be logging

RE: logging admin accesses

2023-12-14 Thread Mike Dewhirst
Top posting because of phone email client.Have you seen the Admin history? Might be already logged for you.Mike--(Unsigned mail from my phone) Original message From: Larry Martell Date: 15/12/23 06:44 (GMT+10:00) To: django-users@googlegroups.com Subject: logging admin

Re: htmx progress indicator problem - might be caching

2023-12-02 Thread Mike Dewhirst
On 2/12/2023 5:42 pm, Mike Dewhirst wrote: I'm now thinking/wondering if a htmx timed execution - say every one or two seconds - might call a view which monitors a singleton being updated by the main view kicked off by the form's submit button. Well that almost worked! I can update

Re: Select Boxes and Database

2023-12-02 Thread Mike Dewhirst
On 3/12/2023 7:27 am, David Merrick wrote: Hi. I can put an item from the database into a select box ie Countries of the World. What I want to know is saying, having chosen New Zealand from the select box, how do I display all the cities of New Zealand in another select box. The database has

Re: htmx progress indicator problem - might be caching

2023-12-01 Thread Mike Dewhirst
initial htmx post to return without being blocked. The htmx endpoint for the progress bar can then check completed count for the task group. On Thursday, November 30, 2023 at 3:42:39 AM UTC Mike Dewhirst wrote: On 29/11/2023 9:56 pm, Thomas Couch wrote: Not sure if it's related

Re: htmx progress indicator problem - might be caching

2023-11-29 Thread Mike Dewhirst
n parallel with the submit button click. Many thanks for taking an interest. Cheers Mike On Tuesday, November 28, 2023 at 2:26:20 AM UTC Mike Dewhirst wrote: I'm trying but failing to get htmx to deliver a progress indication. The task is creating records in the database for each i

htmx progress indicator problem - might be caching

2023-11-27 Thread Mike Dewhirst
I'm trying but failing to get htmx to deliver a progress indication. The task is creating records in the database for each item in a list provided by the logged in user. The view with the submit button collects the list and does the database insertion. I added a "progress" property to the

Re: Management command scheduling options

2023-10-25 Thread Mike Dewhirst
On 25/10/2023 11:49 pm, Adam Stein wrote: On Wed, 2023-10-25 at 08:24 -0400, Larry Martell wrote: On Wed, Oct 25, 2023 at 5:35 AM Mike Dewhirst wrote: Ahmedrufai I looked at APScheduler and like Celery it is too much of a sledgehammer for my tiny problem. I ended up using cron to launch

Re: Management command scheduling options

2023-10-25 Thread Mike Dewhirst
On 25/10/2023 11:24 pm, Larry Martell wrote: On Wed, Oct 25, 2023 at 5:35 AM Mike Dewhirst wrote: Ahmedrufai I looked at APScheduler and like Celery it is too much of a sledgehammer for my tiny problem. I ended up using cron to launch the command each day. It works perfectly. My task now

Re: Management command scheduling options

2023-10-25 Thread Mike Dewhirst
customized interval you require. It's a game changer and a quick win for Windows based OS as they don't support the use of Celery or any other Linux based schedulers without WSL.Do let me know if you're interested in my implementation, I'm open to show you.Regards On Mon, Oct 23, 2023, 11:09 AM Mike

Re: Management command scheduling options

2023-10-23 Thread Mike Dewhirst
on a new server? Mike You could also use something like https://apscheduler.readthedocs.io/en/3.x/ if you wanna something OS independent. El lun, 23 oct 2023 a las 7:08, Mike Dewhirst () escribió: Django docs suggest cron or Windows scheduler for running management commands. I

Management command scheduling options

2023-10-23 Thread Mike Dewhirst
Django docs suggest cron or Windows scheduler for running management commands. I would like instead to build an internal Django based scheduler - because after migrating to a new server, setting up the new cron task will be forgotten. Is there a daily (approximately) event in a Django

RE: Strange bug with Firefox

2023-10-14 Thread Mike Dewhirst
I've seen that behaviour too. The solution is to use Chrome if you want to view source. I assume Mozilla's caching design is somewhat aggressive and ignores the URL's view source prefix. Mike--(Unsigned mail from my phone) Original message From: 'Simon Connah' via Django users

RE: Postgres connection error

2023-10-08 Thread Mike Dewhirst
There is a step missing somewhere if migrations has incorrect permissions.If Django is correctly installed - as it seems to be - then your settings must be deficient somewhere. The first migration ought to create Django's own tables etc even if you haven't written any of your own models.I would

Reference data while testing - interesting

2023-10-05 Thread Mike Dewhirst
I have an interesting testing problem which requires someone smarter than me. I want to prove correctness of multiple outcomes from multiple regulatory computations based on, among other things, international lists of assessed chemicals and their hazards. Hazards include both human health

Re: Reference data while testing

2023-10-03 Thread Mike Dewhirst
: On Mon, Oct 2, 2023 at 11:30 PM Mike Dewhirst wrote: This is probably in the docs so please drop me a link if you can. My project has fifteen or more tables of reference data which determine how the software behaves and therefore is critical to unit testing. Fixtures

Reference data while testing

2023-10-02 Thread Mike Dewhirst
This is probably in the docs so please drop me a link if you can.My project has fifteen or more tables of reference data which determine how the software behaves and therefore is critical to unit testing.Fixtures are unworkable and I  need to respond to the actual reference data.How can i do

RE: Splitting views.py and urls.py into a directory rather than single files

2023-09-18 Thread Mike Dewhirst
I like the following method because it lets me start a project with a single file of views per app and then later when it grows, split it into named files in a 'views' directory - without needing to adjust other code which imports them.1. Create a views directory in the app dir2. Create

Re: What to learn after Django, Node.js or React?1

2023-09-10 Thread Mike Dewhirst
On 10/09/2023 4:40 pm, abu yahya Diab wrote: Hi guys, I'm a django developer(junior), do you advice me to learn Node.js, or React to be full Stack developer. Neither. At least not before you have looked at HTMX Thanks. Abdulrahman -- You received this message because you are subscribed to

Re: Road Map for a newbie

2023-08-18 Thread Mike Dewhirst
questions then writes me... Good luck Mike Dewhirst schrieb am Fr., 18. Aug. 2023, 02:24: On 17/08/2023 7:24 pm, Tesfaye Yimam wrote: Hello all, This is my second day of learning Django. I am comfortable with python (the basics and the OOP). I wanted to have some gui

Re: Case-insensitive non-deterministic collation

2023-08-17 Thread Mike Dewhirst
On 18/08/2023 12:34 pm, Vitor Freitas wrote: Hi Mike, On Tue, Aug 15, 2023 at 4:30 AM Mike Dewhirst wrote: Found a great article by Adam Johnson written in February ... https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation

Re: Road Map for a newbie

2023-08-17 Thread Mike Dewhirst
On 17/08/2023 7:24 pm, Tesfaye Yimam wrote: Hello all, This is my second day of learning Django. I am comfortable with python (the basics and the OOP). I wanted to have some guidance from this community to learn Djanog by taking small steps in a consistent way. Any one who has a road-map,

Re: Timezone issue in when storing in DB

2023-08-15 Thread Mike Dewhirst
On 16/08/2023 12:35 pm, Madhusudhan Reddy wrote: Hi All, I am trying to store the date with the timezone. for example, my servers are in Mumbai, when my servers are trying to get the time of America/Detroit. it is not able to get proper time pytz is deprecated. You should consider using

Re: AWS Polly w/ strictly Django and Javascript

2023-08-15 Thread Mike Dewhirst
On 15/08/2023 7:26 am, Lightning Bit wrote: Hello, how could one go about integrating AWS Polly voices onto a website utilizing only Django, HTML, CSS, and Javascript? I do not want to use "node.js" or "react". Look closely at htmx.org -- You received this message because you are

Re: Case-insensitive non-deterministic collation

2023-08-15 Thread Mike Dewhirst
Found a great article by Adam Johnson written in February ... https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/ Covers all the bases. Thank you Adam Cheers Mike On 7/08/2023 12:28 pm, Mike Dewhirst wrote: On 6/08/2023 9:17 pm, Chetan Ganji

Re: Case-insensitive non-deterministic collation

2023-08-09 Thread Mike Dewhirst
My tests stopped working so I have decided to abandon case-insensitive fields and do it all manually. Thanks everyone. Cheers Mike On Monday, August 7, 2023 at 12:29:28 PM UTC+10 Mike Dewhirst wrote: > On 6/08/2023 9:17 pm, Chetan Ganji wrote: > > Thanks Chetan > > I have

Re: Case-insensitive non-deterministic collation

2023-08-06 Thread Mike Dewhirst
ing = ['name'] def __str__(self): return self.name Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Sun, Aug 6, 2023 at 12:32 PM Mike Dewhirst wrote: On 5/08/2023 7:58 pm, Chetan Ganji wrote: Hi Mike RE: The primary use case is to establish c

Re: Case-insensitive non-deterministic collation

2023-08-06 Thread Mike Dewhirst
://ryucoder.in On Sat, Aug 5, 2023 at 1:35 PM Mike Dewhirst wrote: The following warning triggered a bit of research which looks like a significant amount of study will be required to find the collation needed ... django.contrib.postgres.fields.CICharField is deprecated. Support

Case-insensitive non-deterministic collation

2023-08-05 Thread Mike Dewhirst
The following warning triggered a bit of research which looks like a significant amount of study will be required to find the collation needed ... django.contrib.postgres.fields.CICharField is deprecated. Support for it (except in historical migrations) will be removed in Django 5.1.    

Re: Need to trigger action on 4th Saturday of the month

2023-07-25 Thread Mike Dewhirst
On 25/07/2023 10:47 pm, M Cain wrote: User application permits registration for upcoming events.  User wants the registration page to be open on 4th Saturday of every month at 9am ET as the events are very popular with limited capacity and made available on first come first serve basis.

Re: how to convert to Django 3 or 4

2023-06-02 Thread Mike Dewhirst
On 3/06/2023 11:57 am, john fabiani wrote: aware there is no longer the "patterns" urlpatterns = [     ... ] It is just a list nowadays. -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically

Re: how to convert to Django 3 or 4

2023-06-02 Thread Mike Dewhirst
On 3/06/2023 7:20 am, john fabiani wrote: Hi everyone, I am tasked with updating/upgrading a very old Django web site - I believe it is 1.7.  I need convert and need what is required. Thanks in advance. I need to convert the following: Because all your urls are regular expressions, you

Re: Run Python Code on Front-End

2023-05-22 Thread Mike Dewhirst
On 23/05/2023 10:22 am, Muhammad Juwaini Abdul Rahman wrote: How can one run Python code from the backend that triggers on the front-end upon clicking a button on a certain page? Have a close look at htmx. It doesn't run Python but will replace any targeted HTML element with output from

Re: Is programming in Django intellectually satisfactory

2023-04-26 Thread Mike Dewhirst
On 26/04/2023 10:18 am, Julius Chesoni wrote:  Hi guys, I find programming in the abstract very interesting and full of intellectual benefits similar to those acquired from Mathematics. However, when it comes to programming languages I find the practice of programming very tiresome since there

University chemical management system

2023-03-31 Thread Mike Dewhirst
Does anyone know of an existing Django based chemical inventory management system for a large university? Thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature

Re: how i use django in blockchain.

2023-03-23 Thread Mike Dewhirst
On 23/03/2023 6:02 pm, Shubham Lahane wrote: im currently working on my BE project. my project topic is 'secure EFIR using Blockchain'. actually im working on wesbite that is decentralized in nature. once user fill the FIR form, in backend smart contracts will run and i want to show

RE: Need help

2023-02-21 Thread Mike Dewhirst
https://explore.transifex.com/django/django-docs/Might helpM--(Unsigned mail from my phone) Original message From: Emmanuel Wilfried Ilboudo Date: 22/2/23 13:08 (GMT+10:00) To: Django users Subject: Need help Hi all !!! I would like to have the Django documentation in

Re: deleting a user model that extends abstractuser

2023-02-03 Thread Mike Dewhirst
On 4/02/2023 7:58 am, d07 wrote: I am trying to delete a user object that belongs to a User class that extends AbstractUser. The extending class looks something like this: class User(AbstractUser):     name = CharField("Name", blank=True, max_length=255)     def __str__(self):         return

Re: Uptime all the time

2023-01-22 Thread Mike Dewhirst
On 23/01/2023 5:12 am, j harvey wrote: I am looking for ideas on how to keep my app running all the time, even when uploading data that will replace the current data. Some of these tables will have a million rows or more. Ideas? Almost a question for the PostgreSQL users list - assuming that

Re: ModelAdmin

2023-01-04 Thread Mike Dewhirst
list filters that appear in the right sidebar of the change list page of the admin. For more reference: https://docs.djangoproject.com/en/4.1/ref/contrib/admin/filters/ For this topic related join our WhatsApp group: https://bit.ly/3oJtfcf Regards, Satyajit On Thu, Jan 5, 2023 at 9:09 AM Mike

Re: ModelAdmin

2023-01-04 Thread Mike Dewhirst
On 5/01/2023 5:43 am, Mario St-Gelais wrote: Hello group, first post here. Quick question.  Can capabilities of ModelAdmin such as list_filter or search_fields be used outside of the admin interface? Have you looked at htmx?

Re: Card-Payment Integration.

2023-01-02 Thread Mike Dewhirst
On 3/01/2023 3:12 pm, Harshwardhan Waghela wrote: Other Then Stripe ? Speak to your favourite bank and see what they offer. That's what I did before going to Stripe. Otherwise google for local gateway providers. On Monday, 2 January 2023 at 18:05:34 UTC+5:30 Mike Dewhirst wrote: I

RE: Card-Payment Integration.

2023-01-02 Thread Mike Dewhirst
I use Stripe. It works well.Mike--(Unsigned mail from my phone) Original message From: Harshwardhan Waghela Date: 2/1/23 22:40 (GMT+10:00) To: Django users Subject: Card-Payment Integration. Can Anyone Can Suggest me of Card-Payment Integration(means Visa,

Re: Apache and mod_wsgi with django

2023-01-01 Thread Mike Dewhirst
On 2/01/2023 1:44 pm, pankaj palmate wrote: Hi i am using Apache with mod_wsgi.i want to serve 5000 users at a time.how many processes and threads should I use in order to serve 5000 connections concurrently...in wsgi daemon process ? I can't answer the question because it is above my

RE: Django deployment on local host

2022-12-14 Thread Mike Dewhirst
The essential difference between local and remote is how you access the website.You need all the same resources including web server, database server etc but you might need a local DNS so local users can find the server by name.You can always test using hosts files on the test machines so they

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Mike Dewhirst
hink I have the brainspace to identify the actual cause. My best strategy (I think) is to restart on redeployment and wait for for Apache to self-heal. If it is Apache's fault. Thanks for jumping in Cheers Mike On Sunday, December 11, 2022 at 5:45:40 PM UTC-5 Mike Dewhirst wrote: On 12/1

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Mike Dewhirst
. On Saturday, December 10, 2022 at 9:34:42 PM UTC-5 Mike Dewhirst wrote: Server Version: Apache/2.4.52 (Ubuntu 2022.04) OpenSSL/3.0.2 mod_wsgi/4.9.0 Python/3.10 Server MPM: event Server Built: 2022-09-30T04:09:50 Apache *seems* to hang onto something and eventually crashes after I

Apache2 hates my Django deployment method

2022-12-10 Thread Mike Dewhirst
Server Version: Apache/2.4.52 (Ubuntu 2022.04) OpenSSL/3.0.2 mod_wsgi/4.9.0 Python/3.10 Server MPM: event Server Built: 2022-09-30T04:09:50 Apache *seems* to hang onto something and eventually crashes after I reload it after deploying a Python file. That is either scripted (delete site and

Re: Django model design best practice guidance

2022-12-08 Thread Mike Dewhirst
On 9/12/2022 3:04 am, Joshua Corlin wrote: Ive not used this field before so if it is im having a hard time wrapping my head around how this would work in this use case. Many-to-many is simple to conceptualise if you realise it is not a field in the table you think it is. It is actually a

Re: ALLOWED_HOSTS error

2022-11-21 Thread Mike Dewhirst
On 22/11/2022 11:54 am, Lakshyaraj Dash wrote: Put only domain names in allowed hosts Thank you - that makes me feel better. Can you tell me why the error is appearing? Is it some sort of hacking attempt? On Tue, Nov 22, 2022, 06:22 Mike Dewhirst wrote: My Django log is full

ALLOWED_HOSTS error

2022-11-21 Thread Mike Dewhirst
My Django log is full of these errors ... ERROR /usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py TIME: 2022-09-28 00:13:17,204 MSG: exception.py:response_for_exception:99 Invalid HTTP_HOST header: '111.222.333.444'. You may need to add '111.222.333.444' to

RE: Possible bug in runserver

2022-11-11 Thread Mike Dewhirst
Try using the inline argument --settings when executing runserver--(Unsigned mail from my phone) Original message From: Matteo Sani Date: 12/11/22 05:38 (GMT+10:00) To: Django users Subject: Possible bug in runserver Hello, I wanted to run Django runserver with custom

RE: Can't Load Django Dev Sever

2022-11-10 Thread Mike Dewhirst
Try visiting http://localhost:8000 insteadNo guarantees and I'm not going to test it myself ;-)--(Unsigned mail from my phone) Original message From: James Date: 11/11/22 16:13 (GMT+10:00) To: Django users Subject: Can't Load Django Dev Sever Hello,I can't connect to my

Re: Move apps to different folders or to a root folder

2022-11-06 Thread Mike Dewhirst
On 7/11/2022 2:40 am, Nick Chang wrote: Hello community, I am trying to organize my Django project's structure as the number of apps is growing. So I am attempting to move an app in the sub-folder that contains its model definitions. The app used to be named `.foo

Re: secret api keys

2022-10-26 Thread Mike Dewhirst
On 27/10/2022 3:32 pm, Mike Dewhirst wrote: Not a dumb question but frequently asked. There are two approaches - one is to export your secrets as environment vars and read them from there. The other is to keep them in disk files and read them as required. In both cases the idea is to keep

secret api keys

2022-10-26 Thread Mike Dewhirst
Not a dumb question but frequently asked. There are two approaches - one is to export your secrets as environment vars and read them from there. The other is to keep them in disk files and read them as required. In both cases the idea is to keep secrets out of your code and thus out of your

Re: Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-24 Thread Mike Dewhirst
19:27 (GMT+10:00) To: Mike Dewhirst Subject: Re: Update from 3.9 to 3.10.8 and uninstall 3.9 Thank you, that was quick.. My problem is/are the technical terms such as path and environment . It took me about 10 hours, (I am retired so have time), to upgrade to Spyder 5.3.3 because the input

Sanity check please

2022-10-23 Thread Mike Dewhirst
In the Django Admin I have a model central to a bunch of FKs and M:Ms plus a lot of processing on saving. This is my solution which seems to work but frightens me a bit. class Chemical(models.Model):     # lots of fields     def save(self, *args, **kwargs):    

Re: On button click need to call a python function...

2022-10-18 Thread Mike Dewhirst
On 18/10/2022 5:04 pm, Saswat Mahapatra wrote: Hi , I am new to django. On button click I need to call a python function which returns 2 values. If both the values are the same then I need to display the same image in 2 places on the web page or else a different image. How to call the

Looking for a Django firm

2022-09-12 Thread Mike Dewhirst
Hi all - I'm looking for a Django outfit with an interest in chemistry or customers in the chemical industry in Australia. Possible opportunity. Best to respond off list and there will be an NDA. Cheers Mike -- You received this message because you are subscribed to the Google Groups

RE: What do you do with large project and forms?

2022-08-30 Thread Mike Dewhirst
1. Create a forms directory2. Create ../forms/__init__.py3. Move your forms.py into the forms directory4. In ./__init__.py write from .forms import (  FormThis,  FormThat,  EtcForm,)This gives you unchanged forms calling from wherever ... from appname.forms import etc5. When all that is working

How to enable/disable a hyperlink based on the clock

2022-08-23 Thread Mike Dewhirst
I want to provide a link to join a regular Zoom webinar but enable/disable it just like a garden sprinkler. Enable at noon on Friday, disable fifteen minutes later. Repeat for next Friday. It feels like I need some sort of push. I'm not a js person. Perhaps I should be looking at htmx? Any

Model switching - how to avoid saving twice

2022-08-15 Thread Mike Dewhirst
Django 3.2 Admin I have a model with two 1:n models and need to convert one type of model into the other. I know this sounds mad but it is a specialised document management to-do system. It has Note models and Link models connected to the main model. When converting a Note into a Link the

Re: Need help on reducing cognitive complexity

2022-07-21 Thread Mike Dewhirst
On 21/07/2022 3:52 pm, Sencer Hamarat wrote: Hi everyone, I have a code block with high cognitive complexity below:     @staticmethod     def in_circle_check(obj_type, item, uuid, item_is_array=False): Partly because the args seem weird. Try writing a docstring which says what the method

RE: remove django polymorphism

2022-07-16 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: Joseph Amiri Date: 17/7/22 05:41 (GMT+10:00) To: Django users Subject: remove django polymorphism hey all.i have models like this :class basemodel(polymorphism):...class teachers(basemodel):...class

Re: How to hash fields and detect changes in a record

2022-06-14 Thread Mike Dewhirst
On 14/06/2022 11:20 pm, Ryan Nowakowski wrote: Summing the ordinal of the characters won't catch transposition: >>> chars = 'ab' >>> sum([ord(c) for c in chars]) 195 >>> chars = 'ba' >>> sum([ord(c) for c in chars]) 195 Better to use a real hash algorithm if you're trying to detect changes. 

Re: How to hash fields and detect changes in a record

2022-06-12 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: Ryan Nowakowski Date: 13/6/22 07:09 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: How to hash fields and detect changes in a record On Sat, Jun 11, 2022 at 12:13:16AM +1000, Mike Dewhirst wrote:> On 10

Re: How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
just convert all the chars in all the fields I'm interested in into integers and sum them into my "hash" field. Should be quick and easy! Cheers Mike On 11/06/2022 12:13 am, Mike Dewhirst wrote: On 10/06/2022 11:24 pm, Ryan Nowakowski wrote: On Fri, Jun 10, 2022 at 05:52:48PM +

Re: How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
On 10/06/2022 11:24 pm, Ryan Nowakowski wrote: On Fri, Jun 10, 2022 at 05:52:48PM +1000, Mike Dewhirst wrote: The use case is auto-deletion of out-of-date records if they have not changed. That might sound weird but it is the solution I have come to for a particular problem. My software

How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
The use case is auto-deletion of out-of-date records if they have not changed. That might sound weird but it is the solution I have come to for a particular problem. My software analyses chemical properties and writes note records containing advice, each with a FK to the chemical. When

Re: migrations problem in django

2022-06-01 Thread Mike Dewhirst
On 2/06/2022 3:00 am, Paras Kashyap wrote: TypeError: Field.__init__() got an unexpected keyword argument 'max_lenght' You have probably seen this already ... should be 'max_length' Please someone tell me how to fix this error, this error occurs when i try to make migrations -- You received

Re: POS Printer

2022-05-31 Thread Mike Dewhirst
Paul I agree with @Dev. Nice. And generous. I'm saving this email into my 'keep'. Cheers Mike On 1/06/2022 3:22 am, Paul Kudla (SCOM.CA Internet Services Inc.) wrote: ok a few zillion requirements You need something that will generate a pdf file and then send it to a printer / email etc

Re: How To expertise Django templates Language(DTL)

2022-05-23 Thread Mike Dewhirst
On 24/05/2022 4:30 am, waqar khan wrote: How To expertise Django templates Language(DTL) Kindy help me, i am intermediate DTL , any budy suggest link , you  tube video or books. This is likely your best bet ... https://docs.djangoproject.com/en/4.0/topics/templates/ -- You received this

Re: How can I work around the Django 3.2.10 cve release

2022-05-22 Thread Mike Dewhirst
ce_view, name="invoice_view") wonder if this works for you. also, this might be worth opening a bug ticket about, since this seems like a regression. On 21/05/2022 11:04 am, Mike Dewhirst wrote: On 20/05/2022 11:21 pm, Jason wrote: are you using re_path

Re: How can I work around the Django 3.2.10 cve release

2022-05-21 Thread Mike Dewhirst
25 Date: 21/5/22 18:02 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: How can I work around the Django 3.2.10 cve release Hey why don't you use django v4 for your projects? On Fri, 20 May, 2022, 08:43 Mike Dewhirst, wrote:My billing (Stripe) mechanism is working right up until

Re: How can I work around the Django 3.2.10 cve release

2022-05-20 Thread Mike Dewhirst
return Response(serializer.data)iam hardly trying from few days please guys help me out On Saturday, May 21, 2022 at 6:35:30 AM UTC+5:30 Mike Dewhirst wrote: On 20/05/2022 11:21 pm, Jason wrote: are you using re_path for the url in question? Thanks for respond

Re: How can I work around the Django 3.2.10 cve release

2022-05-20 Thread Mike Dewhirst
none of my urls end that way. Cheers mike On Thursday, May 19, 2022 at 11:14:25 PM UTC-4 Mike Dewhirst wrote: My billing (Stripe) mechanism is working right up until Django 3.2.9 - which is where I'm stumped at the moment. Django 3.2.10 https://docs.djangoproject.com/en/3.2

How can I work around the Django 3.2.10 cve release

2022-05-19 Thread Mike Dewhirst
My billing (Stripe) mechanism is working right up until Django 3.2.9 - which is where I'm stumped at the moment. Django 3.2.10 https://docs.djangoproject.com/en/3.2/releases/3.2.10/ indicate a URL with a trailing newline can bypass upstream access control based on URL paths. Sadly, I am not

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
: return [ ( "Detail for this Invoice/Receipt", { 'fields': self.get_fields(request, obj) } ) ] On 20/05/2022 9:08 am, Mike Dewhirst wrote: On 19/05/2022 11:39 pm, Antonis Christ

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
ll work way better:     def get_queryset(self, request):     qs = super().get_queryset(request)     request.receipt_fields = REC_FIELDS[:]     ... Regards, Antonis On 19/05/2022 05.33, Mike Dewhirst wrote: The code below appears to work perfectly but it worries me because I have never used the global

Please criticise use of global keyword in Admin

2022-05-18 Thread Mike Dewhirst
The code below appears to work perfectly but it worries me because I have never used the global keyword before. Is there a generous guru who will criticise the code constructively for me please? The use case is Admin review of payment gateway receipt records. Users in the manager group can

Re: PHP website | a way to refresh the page without reloading

2022-05-18 Thread Mike Dewhirst
On 19/05/2022 4:23 am, Dias André wrote: Good afternoon! I'm new to programming and I'm making a website in php, I would like to know if there is a way for my website to update without reloading the page and always going to the top of it. sry for the english When I was new to web programming

Re: Migrating ManyToManyField to bigint?

2022-05-16 Thread Mike Dewhirst
[2] https://code.djangoproject.com/ticket/32674On Sunday, May 15, 2022 at 10:26:18 AM UTC+2 Mike Dewhirst wrote: On 14/05/2022 11:44 pm, Jeremy Lainé wrote: Hi! I'm currently looking at how to migrate all my models from AutoField to BigAutoFiel

Re: Migrating ManyToManyField to bigint?

2022-05-15 Thread Mike Dewhirst
On 14/05/2022 11:44 pm, Jeremy Lainé wrote: Hi! I'm currently looking at how to migrate all my models from AutoField to BigAutoField. For all the explicitly defined models the process seems pretty straightforward: * change DEFAULT_AUTO_FIELD to BigAutoField * generate migrations *

Re: Bug using Admin with Stripe - but whose is it?

2022-05-06 Thread Mike Dewhirst
OK - don't worry about this for the time being. The problem is obviously where I haven't yet looked. So I'm now going to simplify every bit of code/html/css following the successful acquisition of the Stripe token to see if it suddenly starts working. M On 6/05/2022 6:07 pm, Mike Dewhirst

  1   2   3   4   5   6   7   8   9   10   >