Re: New feature request - Run only a random subset of tests.

2024-02-17 Thread Jason Johns
agreed about this is a unittest/pytest specific focus, not django. This is pretty straightforward to do with pytest, can have a custom flag and then randomize the test collection. With unittest, not sure. On Monday, February 12, 2024 at 11:36:57 AM UTC-5 Jörg Breitbart wrote: > I also think th

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread Jörg Breitbart
I also think that your requirements are too specific to be added to django. You are prolly better suited by creating your own test picking abstraction for this, e.g. by writing custom test suite aggregates or using unittest.TestLoader.discover and going into tests of interest by your own logic

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’d be against this. I think this approach would be counterproductive in most cases due to the high probability of a false positive. Including it as a core feature is not necessary when it can be added through a third party package. On Mon, Feb 12, 2024, at 2:22 PM, אורי wrote: > Hi, > > Also,

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread אורי
Hi, Also, sometimes I just want to see how many tests are in a specific module, without running them. So I can just run `./tests_manage_all_sites_with_all_warnings.sh test speedy.net --test-only 0 --test-all-languages` which gives me the number of tests in speedy.net, or any module I need. There i

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread אורי
Hi Jörg, All our tests are tested anyway with GitHub Actions. The idea is to run a subset of tests locally to catch 90% of the problems before I commit and wait 40 minutes for all the tests to run. It works most of the time. Of course the whole tests should be run before deploying to production, b

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread Jörg Breitbart
Adding to my last comment: If you are looking for a more tailored unit testing with low test pressure and still high reliability - maybe coverage.py can give you enough code insights to build a tailored test index db to only run affected tests from current code changes. I am not aware of test

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread Jörg Breitbart
@Uri May I ask, whats the idea behind running a random subset of tests only? Wouldn't a Monte Carlo approach be highly unreliable, e.g. lure ppl into thinking everything is ok, but in reality the random test selection did not catch affected code paths? I mean for tests - its all about reliabi

New feature request - Run only a random subset of tests.

2024-02-12 Thread אורי
Django developers, I created https://code.djangoproject.com/ticket/35183 and was asked to start a discussion on the DevelopersMailingList. I'm requesting a new feature request - Run only a random subset of tests. tests - add a new argument "--test-only" (int, >=0) and If run

Re: Feature request: making gettext more robust

2023-08-25 Thread Wim Feijen
Hi Gergely, What helps for me is Django rosetta, https://django-rosetta.readthedocs.io/ . It makes filtering on untranslated or fuzzy translations very easy. Best regards, Wim PS Sorry for the late response. Op zaterdag 17 juni 2023 om 16:01:04 UTC+2 schreef Shai Berger: > Hi Gergely, > > On

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-06 Thread Ryan
Thanks. Would this just be for myself or would it be considered to merge into Django core? On Sat, Aug 5, 2023 at 9:22 PM Curtis Maloney wrote: > On Sat, 5 Aug 2023, at 06:47, Ryan Gartin wrote: > > You are correct state_id is not a field on the model, state is, and using “ > state” in the field

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-05 Thread Curtis Maloney
On Sat, 5 Aug 2023, at 06:47, Ryan Gartin wrote: > You are correct state_id is not a field on the model, state is, and using > “state” in the field lists works. > > I would like to propose that if ‘state_id’ is a valid property on the > queryset (and in the database) that is should be serialize

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-05 Thread Vansh NaiK
How toh hack account On Saturday, 5 August 2023 at 02:17:12 UTC+5:30 Ryan Gartin wrote: > You are correct state_id is not a field on the model, state is, and using “ > state” in the field lists works. > > I would like to propose that if ‘state_id’ is a valid property on the > queryset (and in

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-04 Thread Ryan Gartin
You are correct state_id is not a field on the model, state is, and using “ state” in the field lists works. I would like to propose that if ‘state_id’ is a valid property on the queryset (and in the database) that is should be serialized. It is my preference that a serialized JSON property (to

Re: Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-03 Thread Curtis Maloney
Hi Mike, On Fri, 4 Aug 2023, at 06:03, Ryan Gartin wrote: > I came across this issue calling the following and FK fields with _id are > ignored: > serialize('json', , fields=['title', 'state_id']). I think the problem you've run into here is "state_id" is not a Field on your model; it's wh

Feature Request: Allow Serialize Foreign Keys as Ids

2023-08-03 Thread Ryan Gartin
I came across this issue calling the following and FK fields with _id are ignored: serialize('json', , fields=['title', 'state_id']). State is a ForeignKey on my queryset. I can perform fields=['title', 'state'] and I get serialization correctly of {'state': int}. However, if I specify fie

Re: Feature request: making gettext more robust

2023-06-17 Thread Shai Berger
Hi Gergely, On Fri, 16 Jun 2023 16:46:31 +0200 Gergely Kalmár wrote: > > I'm still thinking that it should be possible for Django to wrap > gettext in a way that allows us to raise exceptions. It seems silly > to me that we could not control this core aspect of the process. > I think indeed i

Re: Feature request: making gettext more robust

2023-06-16 Thread Gergely Kalmár
gt; that can be used to examine the translation files and return the texts that >> are not translated? >> >> -Original Message- >> From: django-developers@googlegroups.com < >> django-developers@googlegroups.com> On Behalf Of Michiel Beijen >> Sent: Friday

Re: Feature request: making gettext more robust

2023-06-16 Thread אורי
legroups.com> On Behalf Of Michiel Beijen > Sent: Friday, June 16, 2023 1:44 AM > To: django-developers@googlegroups.com > Subject: Re: Feature request: making gettext more robust > > > On 15 Jun 2023, at 16:15, Tobias Kunze wrote: > > > > On 23-06-15 04:29:59, Gergely

RE: Feature request: making gettext more robust

2023-06-16 Thread Matthew Pava
that are not translated? -Original Message- From: django-developers@googlegroups.com On Behalf Of Michiel Beijen Sent: Friday, June 16, 2023 1:44 AM To: django-developers@googlegroups.com Subject: Re: Feature request: making gettext more robust > On 15 Jun 2023, at 16:15, Tobias Kunz

Re: Feature request: making gettext more robust

2023-06-15 Thread Michiel Beijen
> On 15 Jun 2023, at 16:15, Tobias Kunze wrote: > > On 23-06-15 04:29:59, Gergely Kalmár wrote: >> It seems that gettext is currently quite permissive – it falls back to the >> default language whenever a translation file is missing or if the requested >> message ID is missing from the translat

Re: Feature request: making gettext more robust

2023-06-15 Thread Jure Erznožnik
The behaviour is the same on Android. iOS makes it more straight-forward because you HAVE TO have all translations in all languages you support. LP, Jure On 15. 06. 23 16:15, Tobias Kunze wrote: On 23-06-15 04:29:59, Gergely Kalmár wrote: It seems that gettext is currently quite permissive –

Re: Feature request: making gettext more robust

2023-06-15 Thread Tobias Kunze
On 23-06-15 04:29:59, Gergely Kalmár wrote: >It seems that gettext is currently quite permissive – it falls back to the >default language whenever a translation file is missing or if the requested >message ID is missing from the translation file. This can lead to errors >slipping through easily.

Feature request: making gettext more robust

2023-06-15 Thread Gergely Kalmár
Hello all, It seems that gettext is currently quite permissive – it falls back to the default language whenever a translation file is missing or if the requested message ID is missing from the translation file. This can lead to errors slipping through easily. Consider this example from the doc

Re: Feature Request: New parameter for render_to_string() to render part of a template using a selector

2023-06-12 Thread Dan Swain
Carlton Gibson has addressed my feature request: https://github.com/carltongibson/django-template-partials On Friday, July 15, 2022 at 8:21:52 PM UTC-4 Dan Swain wrote: > With the growing uptake of technologies like HTMX, I would like to see an > additional parameter added to render_to_

Feature Request: Customisation of constraint error messages in forms

2022-09-19 Thread David Sanders
Hi folks, Please note this is partly an extension of some discussion in PR 16054 asking whether single-field unique or check constraints should raise field errors as opposed to non-field errors . As part of Django's new con

Re: Feature Request (have sample implemenation): ALL subquery

2022-08-24 Thread David Sanders
I'm no expert on how PG optimises queries but NOT EXISTS appears to produce the desired execution plan. My original rationale was to improve the readability and "solution accessibility" for lack of a better term. This all came about because a colleague couldn't figure out how to do it as a Djan

Re: Feature Request (have sample implemenation): ALL subquery

2022-08-24 Thread charettes
Hello David, Do you know if ALL provides any performance benefits over NOT EXISTS? Given we already support Employee.objects.filter( ~Exists(Employee.objects.filter( manager=OuterRef("pk"), join_date__gt=OuterRef("join_date") ) ) If it's not the case I'm not sure addi

Feature Request (have sample implemenation): ALL subquery

2022-08-24 Thread David Sanders
Hi folks! I have a piece of low hanging fruit I'd like to suggest and contribute: ALL subqueries. Here's the PG docs on ALL subqueries but basically it causes the subquery expression to evaluate to true o

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Improving the docs sounds good. I think it would also be worth renaming engines to backends, and EngineHandler to BackendHandler, or similar. Yes it would require a deprecation cycle, but I also imagine 99% of projects would be unaffected. On Tue, Aug 23, 2022 at 8:39 PM Peter Thomassen wrote:

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-23 Thread Peter Thomassen
Hi Carlton, On Mon, Aug 22, 2022 at 6:21 AM Carlton Gibson wrote: The current get_default() behaviour was only added to allow folks manually creating `Template("My String")` instances to continue to operate with multiple Django backends defined (#27359) — the initial assumption there was that an

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-22 Thread Carlton Gibson
Hi Peter. I agree with you that the documentation isn't that clear here. *"Why are there two template classes?", "Why does one take a dict and the other a Context?"* — that comes up. 🙂 I don't think your suggestion itself it that unreasonable, but I'm wary about expanding the API here, at lea

Re: Feature request: LiveServerTestCase to store HTML source and image of the website when test case fails

2022-08-14 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi Kazooie LiveServerTestCase is a bit more lightweight than tools for using specific drivers. It doesn't tie into Selenium, or Playwright, or any other particular web browser library. Therefore I don't think there's going to be any way for LiveServerTestCase to know what the current page is, in o

Feature request: LiveServerTestCase to store HTML source and image of the website when test case fails

2022-08-14 Thread Kazooie
Hey, Would it be possible to add a feature to LiveServerTestCase class to take a screenshot of the web page and store the HTML somewhere in case of test failure? I had to recently do this for one of my projects. This can be helpful when debugging stuff for example when test fails in CI pipelin

Feature Request: get_default_backend() in django.template.Engine

2022-08-11 Thread Peter Thomassen
Hi, We're trying to create a template from string using DjangoTemplates.from_string() of the default template backend, which wraps the result of Engine.from_string() to construct an instance of the Template class defined in the backend definition file: django/template/backends/django.py#30 Th

Re: Feature Request: New PostgreSQL ArrayField

2022-08-11 Thread Liamine Cheridi
Hello, thanks a lot for your answers. I am very embarrassed to say that I went a bit too fast in my testing of nested ArrayField, and it turns out that it actually fits my use case. def test_nested_array_accepts_1D_array(self): instance = NestedIntegerArrayModel(id=1, field=[1, 2, 3]) in

Re: Feature Request: New PostgreSQL ArrayField

2022-08-10 Thread Adrian Torres
Hi Liamine, I think there's various solutions you could try before going the custom field route: * You could try just using the 2D version and use some sentinel value for the date (NULL?) to treat the case where you just want an array of N prices. * You could try using django-polymorphic [1] wh

Re: Feature Request: New PostgreSQL ArrayField

2022-08-10 Thread Jacob Rief
Hello Liamine, Django offers a JSONField which can be used to store an array. You can use it to store a list of prices. What's the benefit of using an array instead of JSON? – Jacob -- You received this message because you ar

Feature Request: New PostgreSQL ArrayField

2022-08-10 Thread Liamine Cheridi
Hello to all, at Pricemoov we’re using Postgresql arrays ( https://www.postgresql.org/docs/15/arrays.html) to store prices of a given product. More precisely, a given product can have either: - standard: N prices (1d array) - cale

Re: Feature Request: New parameter for render_to_string() to render part of a template using a selector

2022-07-16 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’m also -1. There are many ways to “partially render” a template. I covered one in the Django-htmx docs mention one: https://django-htmx.readthedocs.io/en/latest/tips.html#partial-rendering . The proposal to render the full template and then throw away most of the result is a particularly wastefu

Re: Feature Request: New parameter for render_to_string() to render part of a template using a selector

2022-07-16 Thread Ken Whitesell
I'm going to chime in as a -1 here. It does not seem to me that you can guarantee that you have the correct element(s) unless you actually render the complete template. Once you've rendered that template, then you can use tools like BeautifulSoup to extract the elements desired and ignore the

Re: Feature Request: New parameter for render_to_string() to render part of a template using a selector

2022-07-16 Thread charettes
Don't you have to render the template in the first place if you want to extract a fragment of it? If that's the case then shouldn't render_to_string be left unchanged and libraries interested in this feature build something on top of it to achieve what they're after? Given render_to_string is c

Feature Request: New parameter for render_to_string() to render part of a template using a selector

2022-07-15 Thread Dan Swain
With the growing uptake of technologies like HTMX, I would like to see an additional parameter added to render_to_string(). In my rewritten definition of render_to_string() below (taken from the docs), I have named the parameter “part”. In rendering portions of a template for responses to ajax ca

Re: [Feature Request] extra_context -> dataclass

2022-04-06 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Template contexts are namespaces, for which a dictionary is an ideal type. If you want type safety with dicts, you can use TypedDict in type hints. You haven't presented any advantage to using dataclasses, plus it doesn't seem that inconvenient to add your own wrapper that calls asdict(). On Wed,

[Feature Request] extra_context -> dataclass

2022-04-06 Thread Arthur
Hi all! Currently django views do not accept dataclasses as context. I stumbled about this because I wanted to do something like this: @cached_property def extra_context(self): data = MyDataClass(...) ... return data Unfortunately, this is unpacked by get_context_data and throws a

Re: Feature Request: customize redirectable status codes in test client

2022-03-19 Thread Clemens Wolff
Yes, I have implemented a subclass to get the functionality I need: currently I'm wrapping the get method in my subclass to inject the custom logic of checking for a 202. It works ok. I just was snooping around the framework code and figured that supporting this functionality would be even easier i

Re: Feature Request: customize redirectable status codes in test client

2022-03-06 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Sorry - I understood your proposal. I meant - have you already tried the more circuitous route of creating your own subclass with the Django of today? Any change to Django can only go out in the next major release, then you have to upgrade, so it might practically be a year before you can use it.

Re: feature request: admin dark theme as an option in settings.py

2022-03-02 Thread Carlton Gibson
Hi Michael. The easiest thing to do here is override the CSS file at: django/contrib/admin/static/admin/css/dark_mode.css So, most often, put a `admin/css/dark_mode.css` in a project level folder defined by `STATICFILES_DIRS`. https://docs.djangoproject.com/en/4.0/howto/static-files/#configuring-

Re: Feature Request: customize redirectable status codes in test client

2022-02-20 Thread Clemens Wolff
Thanks for the reply. Indeed, HTTP 202 isn't a redirect, but quite a few APIs use it as a "work in progress" indicator with a Location header to point to the resource to be created. This isn't a standard, just something I found in the wild a fair few times. One documented instance I stumbled ac

Re: Feature Request: customize redirectable status codes in test client

2022-02-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
202 is not a redirect, and I can’t find any standard that says where the “next” URL can be found. So I don’t think there is a strong argument to make the test client “follow” it or allow _handle_redirects to support it. You’re free to subclass the test client in your own project to add support - ha

Feature Request: customize redirectable status codes in test client

2022-02-20 Thread Clemens Wolff
Hi Django Developers, I'd like to discuss a change to the Django test client to enable customizing the list of status codes that are considered as redirectable when a GET request is made with `follow=True` (see docs in [1]). Specifically, I suggest moving the `redirect_status_codes` property in t

feature request: admin dark theme as an option in settings.py

2022-02-18 Thread Michael Fischer
Hi! We recently updated to Django==3.2.12 and were very please to find that dark theme is now supported in the admin. But, it seems this is only if the user's desktop settings are set to dark theme. It would be really great if this could be application-specific, so that the admin page always

Feature Request: Add through_defaults as argument for m2m_changed signal

2021-12-17 Thread Shmuel Treiger
Use case: In English: I have many policies, each of which has a status from a table of statuses and is not unique to that policy. I associate these policies to my many domains through the many_to_many table. Domains can have many policies, but only one of each type of policy. Likewise, the sa

Re: Feature Request: Provide an option to disable static files caching during development

2021-10-25 Thread Jason Johns
https://docs.djangoproject.com/en/3.2/ref/contrib/staticfiles/#django.contrib.staticfiles.storage.ManifestStaticFilesStorage Are you using this? basically, it converts static asset filenames from `styles.css` to `styles.2932y382.css` and other random-seeming hashes in the filename. Useful for

Re: Feature Request: Provide an option to disable static files caching during development

2021-10-25 Thread Bharat Chauhan
Hi, That won't work because this is related to static files and how browsers implement caching for static files. This is a good article on this: https://engineering.fb.com/2017/01/26/web/this-browser-tweak-saved-60-of-requests-to-facebook/ Basically, browsers won't revalidate the cache unless

Re: Feature Request: Provide an option to disable static files caching during development

2021-10-23 Thread Roxane Bellot
Hi Wouldn't the setting "CACHE_MIDDLEWARE_SECONDS" do what you are looking for ? Regards, Le vendredi 22 octobre 2021 à 15:53:44 UTC+2, Bharat Chauhan a écrit : > Really, no one is interested in making the developer experience a little > less frustrating? > > It's literally two lines of code

Re: Feature Request: Provide an option to disable static files caching during development

2021-10-22 Thread Bharat Chauhan
Really, no one is interested in making the developer experience a little less frustrating? It's literally two lines of code and will eventually save hours trying to refresh the cache by opening dev tools, which, btw, isn't even possible on mobile. Besides, Django's dev server is not meant to b

Re: Feature Request: Provide an option to disable static files caching during development

2021-09-27 Thread laym...@gmail.com
I'm +1 on this. In my experience teaching Django at university, this always confuses students: "why are my changes not reflected in the browser?" Having static files caching disabled when DEBUG=True would be very useful. Thanks for bringing this up! Sage On Monday, 27 September 2021 at 20:17:

Feature Request: Provide an option to disable static files caching during development

2021-09-27 Thread Bharat Chauhan
Hello, I recently opened a ticket (#33148 ) but it was closed as duplicate of (#32891 ) which itself is marked "wontfix". The reasoning provided by Carlton Gibson for this is: > *I don't think this is th

Re: Feature request : Load signals automatically

2021-09-14 Thread cheeri...@gmail.com
If you make signals autoload, you obscure what is happening. In the case of models and apps, they are so essential and tightly coupled to the framework itself that we can eschew the boilerplate for linking them together. The developer experience is almost universally better as a result. I don't

Re: Feature request : Load signals automatically

2021-09-14 Thread Aymeric Augustin
Hello, I'd like to to chime in quickly as I'm responsible for this boilerplate (see this talk , slide 33). This is really a question of convention vs. configuration. Django tends to prefer configuration over convention, because there's v

Re: Feature request : Load signals automatically

2021-09-14 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I've replied on the forum. On Tue, 14 Sept 2021 at 13:21, Roxane Bellot wrote: > > > Hi guys ! > > First of all, i’m new here, so if this issue has already been discussed or > if here is not the place to talk about it (I also opened a forum post >

Fwd: Feature request : Load signals automatically

2021-09-14 Thread Roxane Bellot
Hi guys ! First of all, i’m new here, so if this issue has already been discussed or if here is not the place to talk about it (I also opened a forum post ) please don’t hesitate to tell me. Also, please be aware English is not my

Re: Feature Request: Nested Natural Join Query

2021-09-10 Thread Ken Whitesell
Yes, such a query can be written, so no change to the ORM is required for this. However, this isn't the right mailing list for providing direct assistance. If you need help constructing such a query, please visit one of the appropriate support venues. https://docs.djangoproject.com/en/3.1/faq/

Feature Request: Nested Natural Join Query

2021-09-10 Thread Mani Mozaffar
Hello, Imagine this case: Model A ——> Model B(many to many to A) -> Model C (many to many to B) -——->Model D (many to many to C) To get a query set of objects D which are connected to an object like A.id=1 , we can do a query like this: Select * from A natural join B natural join C nat

Re: Feature Request: Allow passing no-op filters to QuerySet's bulk_update() when updating tables with partitions

2021-07-25 Thread opqpop
into this pk filter that bulk_update >> uses, because my table is partitioned on orig_city_id and passing the >> partition filter helps scale up when updating a lot of records: >> https://github.com/django/django/blob/d8c90d4c22cb218f1c170eba086c53d3dff7fbc0/django/db/models/query.py#L56

Re: Feature Request: Allow passing no-op filters to QuerySet's bulk_update() when updating tables with partitions

2021-07-22 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
n updating a lot of records: > https://github.com/django/django/blob/d8c90d4c22cb218f1c170eba086c53d3dff7fbc0/django/db/models/query.py#L569 > > What are folks thoughts on this feature request? > > Currently I copy pasted bulk_update and tweaked it with a simple change to > work (

Feature Request: Allow passing no-op filters to QuerySet's bulk_update() when updating tables with partitions

2021-07-12 Thread opqpop
into this pk filter that bulk_update uses, because my table is partitioned on orig_city_id and passing the partition filter helps scale up when updating a lot of records: https://github.com/django/django/blob/d8c90d4c22cb218f1c170eba086c53d3dff7fbc0/django/db/models/query.py#L569 What are folks thought

Re: Add feature request for django permissions.

2021-06-12 Thread wael muhammed
e > > في السبت، 12 يونيو 2021 في تمام الساعة 11:27:39 ص UTC+3، كتب ‪wael > muhammed‬‏ رسالة نصها: > >> ? What is yours opinion could I make a pull request >> >> في السبت، 12 يونيو 2021 في تمام الساعة 9:40:48 ص UTC+3، كتب ‪wael >> muhammed‬‏ رسالة نصها:

Re: Add feature request for django permissions.

2021-06-12 Thread Ken Whitesell
ا: could this <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id> want feature request. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itsel

Re: Add feature request for django permissions.

2021-06-12 Thread wael muhammed
gt;> >> could this >> <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id> >> >> want feature request. >> > -- You received this message because you are subscribed to the Google Groups "Django developers (Contribut

Re: Add feature request for django permissions.

2021-06-12 Thread wael muhammed
? What is yours opinion could I make a pull request في السبت، 12 يونيو 2021 في تمام الساعة 9:40:48 ص UTC+3، كتب ‪wael muhammed‬‏ رسالة نصها: > > could this > <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id> > > want featur

Add feature request for django permissions.

2021-06-11 Thread wael muhammed
could this <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id> want feature request. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe

Re: Feature request: Extend Storage.save() to directly save strings/bytes

2021-02-19 Thread guettli
Adam Johnson schrieb am Donnerstag, 18. Februar 2021 um 10:04:01 UTC+1: > Hi > > If you're mocking away the storage class to speed up your tests, instead > try this in-memory storage class which implements the complete API: > https://github.com/waveaccounting/dj-inmemorystorage . Then you don

Re: Feature request: Extend Storage.save() to directly save strings/bytes

2021-02-18 Thread Mariusz Felisiak
Related ticket: https://code.djangoproject.com/ticket/32452 -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-develop

Re: Feature request: Extend Storage.save() to directly save strings/bytes

2021-02-18 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi If you're mocking away the storage class to speed up your tests, instead try this in-memory storage class which implements the complete API: https://github.com/waveaccounting/dj-inmemorystorage . Then you don't need any mocks. As to adding the shortcut - if the only thing it will help with is

Feature request: Extend Storage.save() to directly save strings/bytes

2021-02-17 Thread guettli
To save strings/bytes you need to use ContentFile up to now: path = default_storage.save('path/to/file', ContentFile(b'new content')) Docs: https://docs.djangoproject.com/en/3.1/topics/files/#storage-objects Things would be bit easier, if save() would support strings/bytes directly. This way

Re: Feature request: wigets attribute for ModelFormMixin class

2021-02-17 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
ed as wontfix): > https://code.djangoproject.com/ticket/24589 > https://groups.google.com/g/django-developers/c/34HJqx48h6Y/m/Nm3UMTK4BgAJ > > On Wednesday, February 17, 2021 at 9:53:07 AM UTC-5 jonask...@gmail.com > wrote: > >> >> # Feature request: wigets attribute fo

Re: Feature request: wigets attribute for ModelFormMixin class

2021-02-17 Thread Tim Graham
This has been proposed before (closed as wontfix): https://code.djangoproject.com/ticket/24589 https://groups.google.com/g/django-developers/c/34HJqx48h6Y/m/Nm3UMTK4BgAJ On Wednesday, February 17, 2021 at 9:53:07 AM UTC-5 jonask...@gmail.com wrote: > > # Feature request: wigets attribu

Feature request: wigets attribute for ModelFormMixin class

2021-02-17 Thread Jonas Kiefer
# Feature request: wigets attribute for ModelFormMixin class ### Status quo The `ModelFormMixin` class currently implements the `fields` attribute by it self and pass it to the `modelform_factory`: ```python class ModelFormMixin(FormMixin, SingleObjectMixin): """Provide a

Re: Feature request: Template tag like stateless component in JSX React

2021-01-29 Thread Curtis Maloney
On Fri, 29 Jan 2021, at 19:18, Aztec Rabbit wrote: > Curtis - This is nested block right? what i want is like tag include (can be > called more than once) but with children. Correct. And that's more or less what nested block does; The difference from include is sniplates takes a template and rip

Re: Feature request: Template tag like stateless component in JSX React

2021-01-29 Thread Jure Erznožnik
Aztec, Just look in the dynamicforms/templates folder: all templates for input fields are built using this tag in its various forms. There's plenty of examples there. And yes, it's exactly what you asked for. LP, Jure On 29. 01. 21 09:18, Aztec Rabbit wrote: Curtis - This is nested block rig

Re: Feature request: Template tag like stateless component in JSX React

2021-01-29 Thread Aztec Rabbit
Curtis - This is nested block right? what i want is like tag include (can be called more than once) but with children. Jure - I've read the documentation, can you give me a sample code? I am confused Hmmm, but i think this feature is very useful (for card, container, wrapper, and anythink with

Re: Feature request: Template tag like stateless component in JSX React

2021-01-28 Thread Jure Erznožnik
Source is here (https://github.com/velis74/DynamicForms/blob/master/dynamicforms/templatetags/dynamicforms.py - see at end of file), documentation will follow shortly as we near 1.0 release (right now it's pretty pathetic, but it is there at readthedocs), but there are examples & unit tests includ

Re: Feature request: Template tag like stateless component in JSX React

2021-01-28 Thread Curtis Maloney
I did something like this in django-sniplates https://sniplates.readthedocs.io/en/latest/tags.html#the-nested-widget-tag -- C On Thu, 28 Jan 2021, at 17:33, Aztec Rabbit wrote: > Hi, > > I think template tag like in JSX is very useful, for example: > > > card.html > > > {{ title }} > {{

Re: Feature request: Template tag like stateless component in JSX React

2021-01-28 Thread Aztec Rabbit
Is there a link to the documentation or source code to the library you created? And can i know why it is not accepted? On Thursday, January 28, 2021 at 9:34:03 PM UTC+7 jure.er...@gmail.com wrote: > We have just created a tag like that in our dynamicforms library. It's > called "extendtemplate

Re: Feature request: Template tag like stateless component in JSX React

2021-01-28 Thread Jure Erznožnik
We have just created a tag like that in our dynamicforms library. It's called "extendtemplateblock". Feel free to use or copy, but it doesn't look like it's going to be accepted in Django itself. We tried to keep API similar to the "include" tag, so it should be easy to use. You can choose t

Feature request: Template tag like stateless component in JSX React

2021-01-28 Thread Aztec Rabbit
Hi, I think template tag like in JSX is very useful, for example: > card.html {{ title }} {{ component.children }} > index.html {% component './card.html' with title='Foo' %} Bar {% endcomponent %} -- You received this message because you are subscribed to the Google Groups "Django

Re: Feature request: Possibility to declare transactions as read only

2020-07-01 Thread Adam Johnson
Christian, FYI you can do this already for all new connections with something like this in an apps.py: from django.db.backends.signals import connection_created @connection_created.connect def transactions_readonly(*, connection, **kwargs): with connection.cursor() as cursor: cursor.e

Re: Feature request: Possibility to declare transactions as read only

2020-07-01 Thread Szeles Andor
Hello Simon and Christian, good point, making a particular connection read only would be even better than using a modified atomic. This way, if I really do need to use a read only transaction, I could just simply wrap my view inside an atomic decorator like @transaction.atomic(using='readonly')

Re: Feature request: Possibility to declare transactions as read only

2020-07-01 Thread Christian González
Am 01.07.20 um 20:28 schrieb charettes: Do you think that allowing a readonly boolean flag[0] to be specified in OPTIONS per connection like we do for isolation level[1] could work for your use case? From my experience this particular problem is usually dealt with by using database routers

Re: Feature request: Possibility to declare transactions as read only

2020-07-01 Thread charettes
Hello Andor, I think it would make sense to add this feature to Django but I'm not convinced per-atomic block granularity is the best API to expose this rarely used pattern. For example, how should this option behave when nesting atomic block and mixing readonly values or disabling usage of sa

Feature request: Possibility to declare transactions as read only

2020-07-01 Thread Andor
Greetings Django developers, I'd like to explicitly declare some of my database transactions as read only to enable certain optimizations, but after inspecting the documentation, forums and source code, it seems this feature is missing. As far as I understand, https://docs.djangoproject.com/en

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-23 Thread Mehmet Ince
Hi Ahmad, > On 23 Mar 2020, at 13:23, Ahmad A. Hussein wrote: > > I completely agree with what has already been said by everyone here; > moreover, this is a battery missing from Django in my opinion. It would make > Django more "batteries-included" if this was part of core rather than third >

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-23 Thread Ahmad A. Hussein
I completely agree with what has already been said by everyone here; moreover, this is a battery missing from Django in my opinion. It would make Django more "batteries-included" if this was part of core rather than third party-libraries. If you need help with documentation, I can definitely th

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-20 Thread Adam Johnson
I personally am in favour of including this in Django at this point. It seems like a desirable feature, it has circulated the community since 2008 (!), and there are at least two community packages implementing the pattern. No one on this thread is explicitly against it ever happening. I'm in fav

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-20 Thread Tobias Bengfort
Hi Mehmet, On 19/03/2020 09.49, Mehmet Ince wrote: > To be honest, I’m kind a confused about how to proceed. Should I > continue with settings to control it or subclass of Auth middleware ?  Remember that many people on this mailing list (me included) are people just like you, so we can only give

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-20 Thread Hanne Moa
The oldest code at https://djangosnippets.org that fixes this is from 2008 so I guess something like this have been considered trivial to build yourself ever since then, and hence why it's never been added. Here are some alternatives: https://djangosnippets.org/search/?q=login+required I've been

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-19 Thread Fabio Caritas Barrionuevo da Luz
> I'm surprised nobody has mentioned django-stronghold in this discussion which does exactly what you're looking for. Same here. django-stronghold has been working well in my projects for me for years. https://github.com/mgrouchy/django-stronghold Em quinta-feira, 19 de março de 2020 07:

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-19 Thread Matt Magin
Hi all, I'm surprised nobody has mentioned django-stronghold in this discussion which does exactly what you're looking for. It's implemented as a middleware, with two settings for exclusions -- A list of named url's or a list of regex's to match url's against. This works well, and managing the e

Re: [Feature Request] Having an middleware to be able to force authentication on views by default

2020-03-19 Thread Mehmet Ince
Hi Alasdair, > On 16 Mar 2020, at 12:59, Alasdair Nicol wrote: > > Hi, > > Creating Django settings is often discouraged, so perhaps it would be better > to create a subclass of AuthenticationMiddleware instead of adding a setting. > Then users would update MIDDLEWARE to enable the new functi

  1   2   3   4   5   6   >