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

2022-06-10 Thread Mike Dewhirst
27;ll 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

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
onvinced I have chosen the correct strategy. Hope I've explained the problem adequately. Thoughts appreciated Cheers 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 sign

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 prin

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 mes

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

2022-05-22 Thread Mike Dewhirst
r filing a bug I'm not sure what to say. For the moment I'm stuck with re_path and version 3.2.9 in production. Thanks again for listening and if you think I should post more code I'm happy to do that. Cheers Mike On 21/05/2022 11:38 pm, Jason wrote: https://docs.djangoproject.c

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

2022-05-21 Thread Mike Dewhirst
XI-D 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 righ

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

2022-05-20 Thread Mike Dewhirst
From: lavanya gowda Date: 21/5/22 13:43 (GMT+10:00) To: Django users Subject: Re: How can I work around the Django 3.2.10 cve release Hi mike and jason kindly help me to my query also i have shared my query in group  its emergencymy humble request :-please help me here i do have some co

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

2022-05-20 Thread Mike Dewhirst
ause I have to study the docs to make sense of it every time. If there is an easier way I'll do it! you can see the backport change here : https://github.com/django/django/commit/d4dcd5b9dd9e462fec8220e33e3e6c822b7e88a6 I looked at the tests and see they are actually looking for '\n

How can I work around the Django 3.2.10 cve release

2022-05-19 Thread Mike Dewhirst
t How can I fix the following error and move forward to 3.2.13? Many thanks Mike - - - - - - - - Exception Type: ValueError at /admin/chemical/chemical/29/change/payment/change/ Exception Value: Field 'id' expected a number but got '29/change/payment'. Environment:

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
Thank you Antonis and Michael - this is how it ended up ... Cheers Mike REC_FIELDS = [ "invoice", "amount_due", "gst_amount", "amount_paid", "amount_owing", "paid_by", "date_paid", ] CONS_FIEL

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
Sorry to have wasted your time. Thanks again. Mike Then, it seems to me that most of the times you don't need the "global" keyword in your code, because you aren't assigning to "receipt_fields". "receipt_fields" is a name that points to an array, and

Please criticise use of global keyword in Admin

2022-05-18 Thread Mike Dewhirst
. Many thanks Mike #admin.py for the billing app rec_fields = [ "company", "chemical", "invoice", "currency", "currency_amount", "gst_amount", "gst_rate", "gst_name",

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

2022-05-18 Thread Mike Dewhirst
BTW, you probably need to look at javascript or HTMX for updating parts of a page without reloading. Cheers and welcome! Mike Dias André, greetings. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Migrating ManyToManyField to bigint?

2022-05-16 Thread Mike Dewhirst
users Subject: Re: Migrating ManyToManyField to bigint? Hi Mike,Thanks for the reply. For future reference, it was pointed out to me that I missed both an explicit note in the documentation [1] and an issue tracking a potential change in the future [2].Do you have any suggestions as to the

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 * appl

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

Bug using Admin with Stripe - but whose is it?

2022-05-06 Thread Mike Dewhirst
calhost:8088/admin/chemical/chemical/20/change/payment/change/ Django Version: 3.2.13 Exception Type: ValueError Exception Value: Field 'id' expected a number but got '20/change/payment'. Exception Location: D:\Users\mike\envs\xxai\lib\site-packages\dja

Re: Using External HTML files in Django

2022-05-02 Thread Mike Dewhirst
On 3/05/2022 8:44 am, Hazho Human wrote: Why not serving that specific URL with Nginx or Apache? On Tue, 3 May 2022 at 03:15, Santhosh sridhar wrote: Hi, I have few html files which are not part of my django project templates directory. I want to render these html files as a

Re: Python Question re Executing a Script (Mike)

2022-05-01 Thread Mike Dewhirst
On 2/05/2022 10:31 am, Brent Hunter wrote: Hello Mike, Thanks for your reply.  My apologies, I should have provided more background information. I was recently running a Windows 10 machine and I believe it was running Python 3.8.  All I did was create a batch file titled Start-AIG.bat

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-14 Thread Mike Dewhirst
are trying to accomplish (except if extrastyle comes earlier than extrajs). On 14/04/2022 06.37, Mike Dewhirst wrote: On 14/04/2022 11:36 am, Mike Dewhirst wrote: Thanks Antonis OK - the

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
On 14/04/2022 11:36 am, Mike Dewhirst wrote: Thanks Antonis OK - the problem has two workarounds. One is to use Chrome. Two is https://code.djangoproject.com/ticket/33386 which suggests including some javascript to disable Firefox autocomplete ... $('form').attr('autocomplet

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
nction () { this.reset(); }); ... but this looks a bit like a sledgehammer. What might that do to other browsers? I guess I'll give that a try and see what happens. Cheers Mike On 13/04/2022 11:19 pm, Antonis Christofides wrote: It happens here as well as far as I can see (tested on a Debi

Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
to get things wrong. Has anyone seen this? 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 and be sure it came from me. Just ask and I'll send it t

Re: Calculated Fields

2022-04-10 Thread Mike Dewhirst
On 11/04/2022 2:48 pm, tech george wrote: Hello Mike, Unfortunately it's not calculating the fields as I wanted, instead it's calculating as below; reorder_level * unit_price + quantity Try using brackets like this ... self.total_price = (self.reorder_level + sel

RE: Calculated Fields

2022-04-10 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: tech george Date: 11/4/22 03:50 (GMT+10:00) To: django-users@googlegroups.com Subject: Calculated Fields Hello,I am trying to calculate fields directly from a model but no luck. I want to get total_price from quantity, re

Re: TypeError: Cannot call delete() after .distinct() in the Admin

2022-04-07 Thread Mike Dewhirst
Sorry - just found it in the docs M On 7/04/2022 5:05 pm, Mike Dewhirst wrote: How can I remove the 'Delete' option from Django Admin actions? Many thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import

TypeError: Cannot call delete() after .distinct() in the Admin

2022-04-07 Thread Mike Dewhirst
How can I remove the 'Delete' option from Django Admin actions? Many 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 and be sure it came from me

Tweak admin 'Action' to avoid Cannot call delete() after .distinct()

2022-03-20 Thread Mike Dewhirst
I am using tweaked querysets to populate the Admin and fully understand why this error occurs. I am using Actions to perform bulk operations on selected records so I do need the Action selector widget. How can I remove the 'Delete selected...' option? Thanks Mike TypeError

Re: How Important Is Writing Unit Tests For Django Applications?

2022-03-12 Thread Mike Dewhirst
d the unit tests the easier it is to refactor your view code. 3.    Do you use Coverage? You will see all the Django code is tested. Only your own code to test I do integration testing at a high level as well as down low. Really does wonders for refactoring confidence. YMMV Mike -- You rec

Re: The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

2022-03-01 Thread Mike Dewhirst
pment etc. I keep those credentials in separate files in a standard location on every server. That is only suitable for servers I control. Cheers Mike Thank you! -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: collectstatic files chown'ed by root

2022-02-14 Thread Mike Dewhirst
On 14/02/2022 10:14 pm, 'Tim' via Django users wrote: Hi all, I'm deploying Django 4 via docker-compose. For security reasons, the Dockerfile creates a non-root user before running the entrypoint.sh script (which does migrations, collectstatic and starts the server with gunicorn). All app file

Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Mike Dewhirst
: Re: Off topic slightly - Apache https redirect On Sunday, February 6, 2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:There seems to be a multitude of ways to redirect from http to https.Any pointers to the absolutely correct way?How about something like this?   ServerName example.com  ServerAlias

Off topic slightly - Apache https redirect

2022-02-06 Thread Mike Dewhirst
There seems to be a multitude of ways to redirect from http to https.Letsencrypt rewrote my conf for port 80 traffic to https but when a customer used http://mysite.com it brought up the Apache "this is working" page.Any pointers to the absolutely correct way?ThanksMike--(Unsigned mail from my

FIXED [Was: Django docs failing]

2022-02-02 Thread Mike Dewhirst
The internet seems to be self healing! On 3/02/2022 3:47 pm, Mike Dewhirst wrote: The following error occurs when searching the docs for a term. It looks like the content delivery network node in Sydney Australia has had a certificate renewal glitch. Error 503 certificate has expired

Django docs failing

2022-02-02 Thread Mike Dewhirst
The following error occurs when searching the docs for a term. It looks like the content delivery network node in Sydney Australia has had a certificate renewal glitch. Error 503 certificate has expired certificate has expired Guru Mediation: Details: cache-syd10147-SYD 1643862123 79021947

Django docs failing with search docs - certificate has expired

2022-02-02 Thread Mike Dewhirst
Error 503 certificate has expired certificate has expired Guru Mediation: Details: cache-syd10147-SYD 1643862123 79021947 Varnish cache server -- Signed email is an absolute defence against phishing. This email

RE: Models

2022-01-21 Thread Mike Dewhirst
Not safely. You would need to script everything behind the scenes - including migration.A safer approach might be to use a generic table which contains the necessary meta information (char, int etc) as data alongside the actual data in each row. I would also consider booking sessions with a psyc

RE: Permissions Model Inefficiency Killing DB

2021-11-24 Thread Mike Dewhirst
Do you think this is a consequence of permission complexity?I have instinctively avoided individual permissions for purely management reasons and stuck to user membership of auth groups (roles) and given permissions exclusively to groups.That postpones lookups to when they are needed.I can't im

RE: django admin

2021-10-10 Thread Mike Dewhirst
Try manage.py collectstatic--(Unsigned mail from my phone) Original message From: Baraka Nzavi Date: 11/10/21 07:32 (GMT+10:00) To: Django users Subject: django admin hello guys...what leads to the admin interface misbehaving in that the styling does not show -- You rece

Proposed bug in Admin

2021-10-04 Thread Mike Dewhirst
6.9 Python Path: ['/var/www/ssds', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages'] Server time:Mon, 04 Oct 2021 07:26

Re: Strange ValueError in Safari on iOS

2021-10-01 Thread Mike Dewhirst
involved in any of that, it is purely a browser/staticfiles exchange.Is something else is generating the  `/admin/chemical/chemical/29/img/icon-yes.svg/change/` URL in your admin?  It is possible that the filename may be a coincidence.HTH, DavidOn Sat, Oct 2, 2021 at 10:47 AM Mike Dewhirst wro

Re: Strange ValueError in Safari on iOS

2021-10-01 Thread Mike Dewhirst
47 AM Mike Dewhirst wrote:In the error message below that "icon-yes.svg" is named in django/contrib/admin/static/admin/css/base.css ul.messagelist li { display: block; font-weight: 400; font-size: 13px; padding: 10px 10px 10px 65px; margin: 0 0 10px 0;

Strange ValueError in Safari on iOS

2021-10-01 Thread Mike Dewhirst
ASH = True which was set after much trial and error long ago so I'm not keen to try and remember all that experiment with it again. Thanks for any help Cheers Mike ValueError at /admin/chemical/chemical/29/img/icon-yes.svg/change/ Field 'id' expected a number but got '29

UnreadablePostError at /

2021-09-27 Thread Mike Dewhirst
le before doing that. Thanks for any help Cheers 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 and be sure it came from me. Just ask and I'll send it to you.

Re: Django admin - how to change breadcrumbs 'Home' into 'Main menu'

2021-08-26 Thread Mike Dewhirst
solution at the moment. I'll look a bit deeper. On Thursday, 26 August 2021 at 16:50:11 UTC+1 Nigel Copley wrote: haven't tried it but you could potentially just override the "/admin/base.html" template in your templates directory On Tuesday, 24 August 2021 at

Re: Django admin - how to change breadcrumbs 'Home' into 'Main menu'

2021-08-26 Thread Mike Dewhirst
rited by child pages. On Tuesday, 24 August 2021 at 02:02:14 UTC+1 Mike Dewhirst wrote: We are using 'Home' in a different, more public, part of the site and have to adjust that first item in the Admin breadcrumbs to 'Menu' or 'Main menu' in order to k

RE: Deploying django in plesk

2021-08-25 Thread Mike Dewhirst
Try manage.py collectstatic --settings=path-to-settingsLook up collectstatic in the docsMike--(Unsigned mail from my phone) Original message From: frank galan Date: 26/8/21 05:09 (GMT+10:00) To: Django users Subject: Deploying django in plesk Hi everybody.I've already deplo

Django admin - how to change breadcrumbs 'Home' into 'Main menu'

2021-08-23 Thread Mike Dewhirst
ve to override an awful lot of templates with ... {% translate 'Home' %} It looks impossible to do elegantly. I shudder at scripting a global search and replace. Is this worth putting in the effort to make 'Home' a setting - if that is even possible. If so, how do I get sta

RE: roles and permissions

2021-08-13 Thread Mike Dewhirst
Have you looked at ...https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html--(Unsigned mail from my phone) Original message From: Amit Vaghani Date: 13/8/21 23:28 (GMT+10:00) To: Django users Subject: roles and permi

url_conf workaround causes warning

2021-08-11 Thread Mike Dewhirst
quot;about": "/about",     "contact": "/contact",     "support": "/support",     "manager": ismanager(request),     }     cont["channel"] = f"{channel}.html"     else:     templ = &qu

Re: Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst
On 26/07/2021 7:56 pm, Markus Holtermann wrote: Hi Mike, Last time I checked, when you set `instance.pk = None` and then do `instance.save()`, Django will create a new instance. Markus Thanks for responding. I wasn't sufficiently explicit in my subject line nor explanation of the

Re: Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: Markus Holtermann Date: 26/7/21 20:04 (GMT+10:00) To: Django Users Subject: Re: Is there a quick and easy way to copy a model instance Hi Mike,Last time I checked, when you set `instance.pk = None` and then do

Is there a quick and easy way to copy a model instance

2021-07-26 Thread Mike Dewhirst
t the moment I'm just copying it one field at a time. Thanks for any hints Cheers 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 and be sure it came from me. Ju

Re: [WARNING - NOT Solved] SVG widget for the Admin

2021-07-25 Thread Mike Dewhirst
On 9/06/2021 12:44 pm, Mike Dewhirst wrote: Do not use this solution. The Svg_AdminTextareaWidget code below deletes data on saving. I think the reason might be that on saving it tries to save the image instead of the image source code. I'm now digging deeper and will report back. I

[Solved]: Unit testing migrations [Was: Related model 'company.user' cannot be resolved]

2021-07-07 Thread Mike Dewhirst
On 7/07/2021 9:56 am, Mike Dewhirst wrote: It seems I have to meddle with history and persuade the testing harness that my custom user model has been in the company app from the beginning of time. See story below. Upside is that testing will (might) start working again. Downside is I'

Unit testing migrations [Was: Related model 'company.user' cannot be resolved]

2021-07-06 Thread Mike Dewhirst
It seems I have to meddle with history and persuade the testing harness that my custom user model has been in the company app from the beginning of time. See story below. Upside is that testing will (might) start working again. Downside is I'll go mad. Any ideas? Thanks Mike On 6/07

Related model 'company.user' cannot be resolved

2021-07-05 Thread Mike Dewhirst
x27;,     name='company',     ),     migrations.RemoveField(     model_name='userprofile',     name='user',     ),     migrations.DeleteModel(     name='User',     ),     migrations.DeleteModel(     name='UserProfile&#

Re: Admin TypeError - Cannot call delete() after .distinct()

2021-07-02 Thread Mike Dewhirst
after .distinct() https://code.djangoproject.com/ticket/32682 might be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote:Trying to delete a record in the

Re: Admin TypeError - Cannot call delete() after .distinct()

2021-07-02 Thread Mike Dewhirst
ht be the root cause, which was fixed end of April and part of the 3.2.1 release, doesn't seem like its been backported to 3.1On Friday, July 2, 2021 at 2:03:28 AM UTC-4 Mike Dewhirst wrote:Trying to delete a record in the Admin list view by checking the checkbox and selecting the delete

Admin TypeError - Cannot call delete() after .distinct()

2021-07-01 Thread Mike Dewhirst
Trying to delete a record in the Admin list view by checking the checkbox and selecting the delete action and clicking [Go] the following 500 error happened. It seems to be all within the Admin so I'm not sure how to proceed from here. Thanks for any hints Mike Traceback (most recent

Re: DRF | Django | Up votes | Down Votes

2021-06-25 Thread Mike Dewhirst
HE lmbo pop l9m6oo9k--(Unsigned mail from my phone) Original message From: DJANGO DEVELOPER Date: 26/6/21 04:38 (GMT+10:00) To: Django users Subject: Re: DRF | Django | Up votes | Down Votes Ryan Thank you so much. I will give it try. and let you know about the resultsOn Fr

Re: Specifying a database connection for ManyToMany add()

2021-06-23 Thread Mike Dewhirst
ons without using 'add'. However, I don't know because I haven't looked at the docs or the Django source, whether you can use a callable for the 'through' table or even specify the db_alias for it. I have only ever used the default myself. HTH Mike -- Y

[WARNING - NOT Solved] SVG widget for the Admin

2021-06-08 Thread Mike Dewhirst
Do not use this solution. The Svg_AdminTextareaWidget code below deletes data on saving. I think the reason might be that on saving it tries to save the image instead of the image source code. I'm now digging deeper and will report back. Mike On 7/06/2021 6:00 pm, Mike Dewhirst

Re: Support for moving a model between two Django apps #24686

2021-06-07 Thread Mike Dewhirst
visit /admin since we do most of the operations from python manage.py shellOn Fri, 4 Jun 2021 at 11:42, Mike Dewhirst wrote:On 4/06/2021 2:28 pm, lalit suthar wrote: > We had a similar problem and we resolved it by moving all the models > into a separate internal python package. >

[Solved] SVG widget for the Admin

2021-06-07 Thread Mike Dewhirst
27;] = Svg_AdminTextareaWidget     return super().formfield_for_dbfield(db_field, request, **kwargs)     ... Cheers Mike On 7/06/2021 11:50 am, Mike Dewhirst wrote: On 6/06/2021 6:14 pm, Derek wrote: RE - "I've looked at the AdminTextareaWidget which is probably based on the TextInput bui

Re: SVG widget for the Admin

2021-06-06 Thread Mike Dewhirst
inForm() seems closest to your use case. Thanks for that. Unfortunately the answer at that link is ten years old and I think Django Admin must have moved on since then. I'm still trying to debug an inexplicable KeyError but I think I understand the approach. I'll keep trying Che

Re: SVG widget for the Admin

2021-06-06 Thread Mike Dewhirst
On 4/06/2021 5:15 pm, Derek wrote: Hi Mike The SVG is not going to display as SVG in a *form* - for that you'd need a widget, or perhaps just let users edit the text. OK - I'm outta my depth here. I've looked at the AdminTextareaWidget which is probably based on the Tex

Re: model configuration

2021-06-04 Thread Mike Dewhirst
e: 5/6/21 01:20 (GMT+10:00) To: Django users Subject: Re: model configuration Thank Mike.  I am sorry for all this code but I am including it to show the problem I can't resolve.  I have 3 apps, shipment, supplier, specie. This is the models for them.from django.db import modelsfr

Re: SVG widget for the Admin

2021-06-04 Thread Mike Dewhirst
On 4/06/2021 5:15 pm, Derek wrote: Hi Mike The SVG is not going to display as SVG in a *form* - for that you'd need a widget, or perhaps just let users edit the text. It will always be readonly.  Forever. Did you try displaying in the normal admin lists? This was my understandi

Re: Support for moving a model between two Django apps #24686

2021-06-03 Thread Mike Dewhirst
does the main menu of the Admin look like? On Friday, 4 June 2021 at 06:07:53 UTC+5:30 Mike Dewhirst wrote: I can see a ticket https://code.djangoproject.com/ticket/24686 <https://code.djangoproject.com/ticket/24686> which would likely solve my current need to merge tw

Re: model configuration

2021-06-03 Thread Mike Dewhirst
On 4/06/2021 1:39 pm, Mike Dewhirst wrote: On 4/06/2021 11:34 am, frank dilorenzo wrote: I have the following conditions. A supplier can have many shipments. A shipment can have many species. A shipment can have only one supplier. Species can belong to many shipments. supplier 1:n shipment

Re: model configuration

2021-06-03 Thread Mike Dewhirst
On 4/06/2021 11:34 am, frank dilorenzo wrote: I have the following conditions. A supplier can have many shipments. A shipment can have many species. A shipment can have only one supplier. Species can belong to many shipments. supplier 1:n shipment shipment n:m species No matter how I try I c

Support for moving a model between two Django apps #24686

2021-06-03 Thread Mike Dewhirst
I can see a ticket https://code.djangoproject.com/ticket/24686 which would likely solve my current need to merge two apps. Is the code OK to try out? Happy to test it. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you

Re: SVG widget for the Admin

2021-06-02 Thread Mike Dewhirst
mical/chemical/17/change/ Django Version: 3.2.3 Exception Type: FieldError Exception Value: Unknown field(s) (_ddstructure) specified for Chemical. Check fields/fieldsets/exclude attributes of class ChemicalAdmin. Exception Location: D:\Users\mike\envs\xxai\lib\site-packages\djan

Re: SVG widget for the Admin

2021-06-02 Thread Mike Dewhirst
() method. Ignore mt previous reference to "allow_tags" as this is deprecated.)DerekOn Wednesday, 2 June 2021 at 10:05:11 UTC+2 Mike Dewhirst wrote:On 1/06/2021 11:44 pm, Derek wrote: > You haven't defined where in the admin interface you want this image > to be displayed? 

Re: SVG widget for the Admin

2021-06-02 Thread Mike Dewhirst
ses. I was thinking a widget might be needed just for display. The svg code arrives complete with tags so really all it needs is a mechanism to persuade the admin it is safe to render as is. I haven't seen such a (probably insecure) "feature" previously. I've looked throug

SVG widget for the Admin

2021-05-31 Thread Mike Dewhirst
es in the Admin. At this stage all it displays is the svg source. What is the correct way to make the image appear in the Admin? Do I need a special field inheriting from TextField? Do I need a special widget? Is there a way to mark admin field values as safe? Thanks for any hints Mike --

Re: Please need a solution urgently for django.db.utils.DatabaseError

2021-05-29 Thread Mike Dewhirst
m exc_value   File "D:\Bhathiya Admin\Python\lib\site-packages\django\db\backends\utils.py", line 84, in _execute     return self.cursor.execute(sql, params)   File "D:\Bhathiya Admin\Python\lib\site-packages\djongo\cursor.py", line 59, in execute     raise db_exe from e django.d

Re: Converting from AutoField to BigAutoField

2021-05-17 Thread Mike Dewhirst
On 18/05/2021 3:18 pm, Mike Dewhirst wrote: On 18/05/2021 3:14 pm, Pankaj Jangid wrote: I have an application from 3.1.x and in 3.2 we have to explicitly state this to make it compatible i.e. without any warning: DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' Now suppose I want

Re: Converting from AutoField to BigAutoField

2021-05-17 Thread Mike Dewhirst
On 18/05/2021 3:14 pm, Pankaj Jangid wrote: I have an application from 3.1.x and in 3.2 we have to explicitly state this to make it compatible i.e. without any warning: DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' Now suppose I want to change this to BigAutoField. What all changes I’ll hav

Admin sidebar for change page

2021-05-09 Thread Mike Dewhirst
happen I'm very happy to contribute - as directed! Cheers mike My project has a central table with many 1:n and n:m sub-tables. I mean lots of them. It takes forever to keep scrolling up and down the page to find the section of interest and then maybe scroll through some records in that

Re: Am I being hacked?

2021-05-07 Thread Mike Dewhirst
Thanks Stephen , I'll do some digging. Mike--(Unsigned mail from my phone) Original message From: "Stephen J. Butler" Date: 7/5/21 18:06 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: Am I being hacked? Unlikely. The local connection is in a high

Am I being hacked?

2021-05-07 Thread Mike Dewhirst
t; laddr is my laptop which was running the code. I presume raddr is the remote address because it looks like https://ipinfo.io/34.241.162.61 which is in Dublin in an Amazon DC. What do you think? Am I being hacked? Mike -- Signed email is an absolute defence against phishing. This email

Re: Admin layout getting too bulky - what to do?

2021-05-05 Thread Mike Dewhirst
g all the sections, not in a sidebar or drop-down menu as I would really like. I did it that way as a stepping stone. Thought testing name anchors might be a simple first step. Glad I didn't start from the other end and discover the disappearing top record at the finishing post! Cheers Mi

Re: Admin layout getting too bulky - what to do?

2021-05-04 Thread Mike Dewhirst
little deeper but first I have a related question for which I'll start another thread after I reach a probable dead end in my current digging. Cheers Mike I cannot understand your requirement statement "When that page opens for the record, the sidebar of links should change

Re: Admin layout getting too bulky - what to do?

2021-05-04 Thread Mike Dewhirst
inspace for that. What I mean is, I can't quite see how it would help. Cheers Mike Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com <mailto:ganji.che...@gmail.com> http://ryucoder.in <http://ryucoder.in/> On Mon, May 3, 2021 at 8:13 PM Mike Dewhirst <mailt

Re: Admin layout getting too bulky - what to do?

2021-05-03 Thread Mike Dewhirst
on that page. When a heading is clicked the page should relocate itself so that heading is at the top"  at all, sorry. Maybe a follow-up post with a picture (== 1000 words)?DerekOn Monday, 3 May 2021 at 08:57:25 UTC+2 Mike Dewhirst wrote:OK - I've now looked at some Django Admin templa

Re: Admin layout getting too bulky - what to do?

2021-05-02 Thread Mike Dewhirst
ng name anchors and construct a list of urls (including 'top' and bottom') for such a sidebar. And of course to understand how to make such a sidebar in the first place. Where might I begin my research? Thanks Mike On 2/05/2021 5:26 pm, Mike Dewhirst wrote: My project has a cent

Admin layout getting too bulky - what to do?

2021-05-02 Thread Mike Dewhirst
do a sidebar of links which take the user to specific sections? I have had a look at the contrib layout and it doesn't appear obvious what to do. Especially since they don't pay me enough to play with js ;-) Has this been solved before? Thanks for any hints Cheers Mike -- Signe

Re: Problem with get_absolute_url()

2021-04-26 Thread Mike Dewhirst
go to “audit/{id}/”,and intro URL pattern to “intro/{id}/”. On Mon, Apr 26, 2021 at 03:49 Mike Dewhirst wrote:This code in the chemical model indicates that I'm trying to display two different views of the same chemical which has certain data in a details 1:1 record class Che

Problem with get_absolute_url()

2021-04-26 Thread Mike Dewhirst
shows no matter which report_type is selected. Where am I going wrong? I have tried to get reverse() working by following along with ... https://docs.djangoproject.com/en/2.2/ref/models/instances/#get-absolute-url ... but to no avail. I think if I can get it working with specified urls I should

Bypass an Admin screen if there is only one candidate

2021-04-14 Thread Mike Dewhirst
eems a bit beyond me How to do that? 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 and be sure it came from me. Just ask and I'll send it to you. Your

RE: Do I really need Groups for permission management?

2021-04-11 Thread Mike Dewhirst
If you are using custom user, you can write methods which return booleans and which can be seen by the template. I wrote aasmall utility method is_member(groupname) which returns the boolean. I make liberal use of groups which work very well for me. In my custom user I can easily add a method to

Re: Unique and null

2021-04-07 Thread Mike Dewhirst
ue se fía en el SEÑOR, y cuya confianza es el SEÑOR. (Jeremías 17:7 RV2000)El mié, 7 abr 2021 a las 16:52, Mike Dewhirst () escribió:No. PostgreSQL.I checked that post. And googled the answer. Postgres follows the SQL standard and permits multiple nulls in a unique column.I should have done

Re: Unique and null

2021-04-07 Thread Mike Dewhirst
esday, 7 April 2021 at 08:07:35 UTC+2 Mike Dewhirst wrote:I have just made a CharField unique and Django detects duplicates nicely but seems to ignore multiple instances where the field value is null.     arn = models.CharField(     max_length=MEDIUM,     unique=True,     null

Unique and null

2021-04-06 Thread Mike Dewhirst
? 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 and be sure it came from me. Just ask and I'll send it to you. Your email software can handle signing. -

Re: calling self.clean() before super.save()

2021-04-05 Thread Mike Dewhirst
2021 6:33:54 PM CDT, Mike Dewhirst wrote: Is it sensible to generally call self.clean() in a model's save() method prior to calling super().save()Until now I have been calling clean() deliberately prior to calling save() but I have a lot of models where save() pre-processes data just prior to

calling self.clean() before super.save()

2021-04-04 Thread Mike Dewhirst
save(*args, **kwargs) I feel as though it would more robust to pre-process the data, then call self.clean() and finally make the super call. Thanks for any advice. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import

<    1   2   3   4   5   6   7   8   9   10   >