Should there be a default lockfile location for SerializeMixin?

2021-05-20 Thread 'Mike Lissner' via Django developers (Contributions to Django itself)
I spent the day today making the tests for my project run in parallel. As 
part of that, I had my first encounter with the SerializeMixin, which you 
can use in conjunction with the `--parallel` flag to ensure that certain 
tests don't run at the same time. It's neat, in theory:

https://docs.djangoproject.com/en/3.2/topics/testing/advanced/#enforce-running-test-classes-sequentially

One thing I found kind of lacking about it is that it didn't easily solve 
my main problem. What I wanted to do was to just mark meddlesome tests to 
run serially. To do that though is kind of tricky. The way I eventually did 
so was to set lockfile as:

lockfile = Path(__file__).parents[1] / "settings.py"

I didn't find many others using SerializeMixin online (searching Github and 
Google), which surprised me, and I didn't see any other solutions like mine 
when I looked either. It sort of felt like an under-used tool.

The way it works now, you use the SerializeMixin in your test class, and 
then you set up a property on the class called `lockfile`, that points to a 
file that is used to lock the tests so none others can run at the same 
time. 

The docs show an example that has `lockfile = __file__`, which I thought I 
could just sprinkle into my meddlesome tests to fix them. Unfortunately, 
that just locks different classes within a single tests.py file, so I had 
to do the solution above. 

A couple thougths:

1. Should we tweak the docs to show something like the above, that would 
make the solution there easier to just drop in?

2. Would it be crazy to upgrade the SerailzeMixin so that if lockfile is 
left out, it finds some standard file in every django project and uses that 
for the locking? If it worked that way, switching to parallel tests would 
just mean using the `--parallel` flag, identifying tests that failed, and 
mixing in the SerializeMixin into each of those tests. It'd be much easier. 
Currently if the property is missing, you get a ValueError.

Thoughts? 

Mike


-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/70ac0aec-f1a5-4bdb-876d-582e75168820n%40googlegroups.com.


making TemplateView.template_name point to a file NOT in the templates directory.

2021-05-20 Thread Sharif Mehedi
I do not have a django-admin project and using django views (along with 
other django submodules) in my python app, so, i do not have a directory 
structure like django projects has and I never had a templates directory in 
my app. The way we configured it, serving from templates directory is out 
of the question.

I want to know, if there's an easy solution in making django take a 
template_name as (django.views.generic.base).TemplateView.template_name 
that is (simply said) outside the templates directory.

TIA
Regards,
Sharif

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/082f893b-5f32-4641-a786-7b1dff51ce4an%40googlegroups.com.


Re: GSoC Proposal: (Migrations) Adapt schema editors to operate from model states instead of fake rendered models.

2021-05-20 Thread Manav Agarwal
Hello everyone,
I am so very thankful to everyone who helped me out with my project idea 
and proposal. The proposal is accepted and I will give my best to 
accomplish as I have promised.
On Thursday, April 8, 2021 at 7:17:58 AM UTC+5:30 Manav Agarwal wrote:

> Hey Carlton.
>
> I have submitted the proposal.
> Also, Your suggestion of adding tests with the introduction of a new 
> central registry seems great and I have implemented the same in phase 1.
> Also, I already added all the points suggested by Simon Charette from the 
> discussion(
> https://groups.google.com/g/django-developers/c/_ohBzsuomqw/m/cEI8eoK7BQAJ
> ).
> Last but not least, I will try to make my proposal more clear in the 
> coming week till the deadline. 
> I understand that as the proposal is detailed you will have to sit down 
> with it more fully but you don't have time for the same and It's totally 
> fine.
>
> Thank You for your suggestions that always help a lot.
>
>
> On Wed, Apr 7, 2021 at 7:09 PM Carlton Gibson  
> wrote:
>
>> Hi Manav. 
>>
>> You should definitely submit. Your proposal is quite detailed, so I'd 
>> need to sit down with it more fully than I have time to comment on this 
>> week. 
>> (But that's OK — even if your implementation idea needs revision, THAT 
>> you've considered it is important.) 
>>
>> Having said that: 
>>
>> * You have "testing & docs" tacked on at the end in your schedule. 
>> Identify the phases and include time to write the tests as you go. In phase 
>> 1, how will you know that your central registry is correctly tracking model 
>> relationships unless you write tests? (You won't...)
>>
>> * Maybe you did this already but, review the points Simon Charette made 
>> in the thread on this topic last year: 
>> https://groups.google.com/g/django-developers/c/_ohBzsuomqw/m/cEI8eoK7BQAJ 
>> — There are large parts of a solution to this problem there. It would be 
>> good if on review your proposal uses Simon's suggestions. 
>>
>> Please do use this week to make your proposal as good as you can and 
>> submit. (I can't see that I'll have capacity to review another draft, but 
>> equally you should have enough to go on now.) 
>>
>> I wish you luck! 
>>
>> Kind Regards,
>>
>> Carlton
>>
>>
>> On Wednesday, 7 April 2021 at 08:13:54 UTC+2 dpsma...@gmail.com wrote:
>>
>>> Thank You Carlton for the feedback.
>>>
>>> As per your suggestion, I have increased the clarity of the proposal 
>>>  
>>> with some code and implementation. I will try to maximize the clarity as 
>>> much as possible.
>>>
>>> Till then, May you please suggest, that Shall I share my proposal as a 
>>> draft at GSoC Portal .
>>>
>>> Also, it would be great if you may suggest the possible improvement 
>>> areas in the proposal 
>>> , or 
>>> does it seems fine?
>>>
>>> Regards
>>> Manav Agarwal
>>>
>>> On Tue, Apr 6, 2021 at 7:09 PM Carlton Gibson  
>>> wrote:
>>>
 Hi Manav. 

 Sorry for the late reply. 

 Your proposal looks very good, and your previous contributions are 
 noticed. 
 You’ve obviously taken time to look at it in depth. 

 I think just going over it this week as time allows to maximise clarity 
 is worth it. That’s always time well spent. (Generally there are a lot of 
 applications, so making yours stand out as focused and to the point both 
 demonstrates your capacity and makes the reviewer’s job easier.) 

 I hope that helps. 

 Kind regards, Carlton 

 On Mon, 5 Apr 2021 at 05:12, Manav Agarwal  wrote:

> Link for the proposal - 
> https://gist.github.com/manav014/9b0feb734e4d140eef1913340602d2ae
>
> On Monday, April 5, 2021 at 8:41:32 AM UTC+5:30 Manav Agarwal wrote:
>
>> I have added the proposed solution in the proposal. 
>> I request fellow developers to please help me with their respective 
>> suggestions, thoughts or feedback, so that I may develop a better and 
>> practical proposal.
>>
>> Regards,
>> Manav Agarwal
>>
>> On Friday, April 2, 2021 at 3:09:46 AM UTC+5:30 Manav Agarwal wrote:
>>
>>> Hello everyone,
>>> My name is Manav. I’m a Computer Science and Engineering junior at 
>>> Dr. A.P.J. Abdul Kalam Technical University in India.
>>> I started contributing to Django in October 2020 and have solved 
>>> many issues on trac 
>>> 
>>> .
>>> I read through the GSoC Idea List and the Migration topic stood out 
>>> for me. I found the idea to adapt schema editors to operate from model 
>>> states instead of fake rendered models really interesting.
>>> I am working on this for the last 1 month and I have made myself 
>>> familiar with 

Re: IRC changes

2021-05-20 Thread Mariusz Felisiak
See the Libera.Chat documentation  for 
different ways to connect.

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/74d39ffe-7916-489c-bbcc-775ed7421e2fn%40googlegroups.com.


IRC changes

2021-05-20 Thread Mariusz Felisiak

Hi y'all,

    Today we've switched from Freenode[1] to Libera.Chat. As a 
side-effect the #geodjango channel was renamed to #django-geo to match 
the Django project namespace.


    Please join new channels!

Best,
Mariusz

[1] https://gist.github.com/joepie91/df80d8d36cd9d1bde46ba018af497409

--
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/da4fcf47-1c2d-db46-942f-7d7f17faed94%40gmail.com.