Re: Dictionary not rendering in a html table in a Template

2021-05-15 Thread Benny M
I feel like I missed something in this exchange. The template setup looked as though it was designed to loop though a list of dictionaries. As a result, based on the code provided, it should have produced two rows of data? Was that not the case? Benny On May 15, 2021, at 5:25 PM, Walter

Re: Building reports in Django / Python

2021-04-24 Thread Benny M
to do is move away from excel to another solution - but I can’t seem to find any... Med vänliga hälsningar, Andréas 24 apr. 2021 kl. 22:13 skrev Benny M :  This is a great use of management commands. I use that combined with a cron job to generate reports on a schedule. The management command

Re: Building reports in Django / Python

2021-04-24 Thread Benny M
This is a great use of management commands. I use that combined with a cron job to generate reports on a schedule. The management command allows you to use Django’s ORM for polling data, and there’s excel packages out there (can’t think of a name off the top of my head), but even to that point,

Finding unsupported bytestring

2021-04-07 Thread Benny M
Hi folks, We’re finally making our move out of 1.x Django and one of the changes we’ve ran into is the removed support for bytestring in some places: https://docs.djangoproject.com/en/2.0/releases/2.0/#removed-support-for-bytestrings-in-some-places

Re: DJANGO AWS: Failed to load resource: the server resp....403 (Forbidden)

2021-02-04 Thread Benny M
> Well, still its first time I read him being sarcastic or kind of fed up.Its > hilarious 藍. Sometimes hyperbole is the perfect solution. The smart ones realize they’re being lazy and make it a point to try some due diligence next time. It worked on me. Soon as I started figuring out my own

Re: test client vs jinja?

2021-02-04 Thread Benny M
Hi Roy, I haven’t been through this personally, but it strikes me as odd that the test can’t read the request context. On the surface it would stand to reason that if the test can’t read it, then the page wouldn’t render on browser request. Can you post an example of one of your failing tests

Re: DJANGO AWS: Failed to load resource: the server resp....403 (Forbidden)

2021-02-04 Thread Benny M
Lightning, I think what Kasper means to say is that there are a few reasons why AWS isn’t authorizing your request, and the likelihood that Django is somehow involved in that error is pretty much zero. HTTP 403 means that some authorization/permission isn’t sufficient for the server to

Re: how to split in multiple file class models.py?

2021-02-01 Thread Benny M
Not a problem at all, Andréas. Gave me a chuckle. Best, Boney On Feb 2, 2021, at 1:45 AM, Andréas Kühne wrote:  Sorry, BENNY M. Apologies. Regards, Andréas Den tis 2 feb. 2021 kl 08:44 skrev Andréas Kühne mailto:andreas.ku...@hypercode.se>>: So, Boney M's assumption here is c

Re: how to split in multiple file class models.py?

2021-02-01 Thread Benny M
Just a thought, I haven’t tested this: you might be able to trick access to subdirectories by importing those models in the top-level models/__init__.py - now that I think about it, you might have to do that with all the models... so your __init__ file would say something like: ``` from .car

Re: Django rext framework join multiple table without nested data

2021-02-01 Thread Benny M
If your using a values_list command, try adding the `flat=True` argument. Or you could set the depth on your Meta parameters: https://www.django-rest-framework.org/api-guide/serializers/#specifying-nested-serialization Benny On Feb 1, 2021, at 6:17 AM, narendra...@gmail.com wrote: i have a

Re: Classifieds page loading is to slow

2021-02-01 Thread Benny M
You could try caching your results, or even store them in the table, or related table. If the ads location doesn’t change, there doesn’t seem to be a need to call the api every single time. Additionally, if the results aren’t needed right away, you could queue the job of calling the api, such

Re: Classifieds page loading is to slow

2021-01-16 Thread Benny M
query speed. - Benjamin On Jan 14, 2021, at 10:44 PM, Benny M mailto:chibe...@outlook.com>> wrote: Slow loading can be sometimes be caused by non-optimized or overly complex queries. Look into prefetch_related and select_related for starters. https://docs.djangoproject.com/en/3.1/ref/mode

Re: Classifieds page loading is to slow

2021-01-14 Thread Benny M
Slow loading can be sometimes be caused by non-optimized or overly complex queries. Look into prefetch_related and select_related for starters. https://docs.djangoproject.com/en/3.1/ref/models/querysets/ Django Debug Toolbar is also a great packages for examining the interaction between

Re: Compatibility List

2020-12-30 Thread Benny M
P.S. > > Effectively 2.2 is as far as you need to go for the time being because it is > an LTS release. Might make a convenient initial goal. Should be pain-free. > Unfortunately that’s not an option. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Compatibility List

2020-12-30 Thread Benny M
Thanks for your response, Mike. I was using “changelog” and “release notes” interchangeably; sorry for the confusion. My question is more about packages that extend Django’s capabilities (i.e. django_csp, django_rq, etc.) as opposed to Django itself. Thankfully Django has great release notes,

Compatibility List

2020-12-30 Thread Benny M
Hi all, I have a project that’s doing a rather sizable jump from 1.11.29 to 3.1. I’m aware of the internal gotchas (enforced on_delete, settings syntax, etc) - but I was curious if anyone knows of a package compatibility list exists? Something like caniuse but for django-focused packages. Right

Re: How can I host my django project on my pc for someone to see it outside my WIFI network

2020-12-23 Thread Benny M
I’m going to second Kasper on this. There’s enough affordable options out there that self hosting to a “safe enough” degree would be the more expensive route to go. I did this myself for a little while - had a makeshift cloud service for myself right up until I had a dev-ops friend take a

Re: MultipleChoiceField form bug?

2020-12-22 Thread Benny M
Oh this worked out beautifully! Not sure why it hadn’t occurred to me to call super().__init__ before hand. And manipulating self.fields was the farthest thing from my mind. As for using ModelMultipleChoiceField - that’s ultimately what I went with for the project, but I couldn’t let go of

Re: MultipleChoiceField form bug?

2020-12-22 Thread Benny M
; Hi, > > On Dec/22/2020, Benny M wrote: > >> I’ve ran into some unexpected behavior while testing a ModelForm with >> a MultipleChoiceField and am trying to determine if this is a bug, or >> if maybe I’m doing something out of the ordinary. > > I think that I mig

MultipleChoiceField form bug?

2020-12-22 Thread Benny M
Hi all, I’ve ran into some unexpected behavior while testing a ModelForm with a MultipleChoiceField and am trying to determine if this is a bug, or if maybe I’m doing something out of the ordinary. In the form, I’m generating the MultipleChoiceField choices on the fly. e.g. `OPTIONS =