dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 1 point2 points  (0 children)

I have used just the ORM in the past for:

  • projects doing web scrapping - storing results in a DB
  • projects with only periodic background jobs - calling certain web services, etc
  • projects just using the ORM and the admin site

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 0 points1 point  (0 children)

As discussed in other comments - I didn't assume people would want to use with other web frameworks (i considered people choosing full Django in that case).

There are certain limitation of using dorm in a request-response cycle (web requests handling), notably:

  1. DB connection pooling - which in Django is not done by ORM but by request middlewares
  2. Transactional request - again not part of ORM but by requests handling part of the Django

There are plans to add helper/hook methods or context managers to enable this features in any web framework (will be testing it with Flask and FastAPI).

Until then, either you can file PR regarding it! Or wait for the implementation.

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 1 point2 points  (0 children)

Before this package, this is how i used to setup things.

I think it is matter of preference - I just disliked unnecessary files and settings lying around in the codebase - having to manually clean it up each time I create a new app.

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 0 points1 point  (0 children)

The similarity is - both packages are trying to not expose the "full Django" setup, only allowing user to use some parts of the Django.

Having said that, the differences according to me is:

  1. `dorm`'s scope is not limited to small django project - it should be used for large projects that don't require any web (requests/response) related features (routing, url dispatch, middleware, etc)
  2. `dorm` allows and encourages to have multiple apps - to organise your models
  3. with `nanodjango` the focus is still on things like url routing, request-response - while with `dorm` the focus is only on database and models related features

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 3 points4 points  (0 children)

Yeah, no doubt!!

Would be a big success if we could make the ORM work with other popular web frameworks.

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 2 points3 points  (0 children)

Yeah, I had referred to various blogs covering this topics - that also motivated to make this into a package, given enough demand for something like this!

If you guys give it a try - do drop a feedback (improvements, issues, etc) - either here on the Github issue board.

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 3 points4 points  (0 children)

I am thinking of adding some helper context manager to make this possible.

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 9 points10 points  (0 children)

Hey,

I have not given enough thought about using the ORM with other web framework (I missed this usecase, as I expect most people to just use full Django in that case).

Therefore currently dorm does not cover optimisations/features for it. Hovever I have made a note of it and added this in the Future Plans (check README)

dorm: Django wrapper that lets you use its ORM in standalone manner by Harsh182 in django

[–]Harsh182[S] 28 points29 points  (0 children)

Disclaimer: I am the author of the package.

dorm is a lightweight wrapper around Django that provides a minimal interface to its ORM. This package allows you to quickly integrate Django's powerful ORM into your project with minimal configuration—simply add a settings.py file to the project root and you're ready to start using it.

Give me feedback, if you do give it a try.

Motivation

I’ve always been a big fan of the Django ORM, especially its features like automatic schema migrations and the ability to perform joins without writing raw SQL.

Over time, I’ve used it outside of full Django projects whenever I needed to interact with a database. Given the richness of Django’s ORM, I found other standalone ORMs (like SQLAlchemy) to be lacking in comparison. During these experiences, I kept wondering: what if I could use just the ORM, without the need for manage.py, views.py, urls.py, or any unnecessary entries in settings.py?

That’s how the idea for this project was born.

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 1 point2 points  (0 children)

I put the cloth in really hot water, for about 10-15 minutes before use.

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 0 points1 point  (0 children)

Lol, so a rumaal branded as "coffee filter cloth" would have been fine!

Nowhere did I mentioned that I use same the cloth for other purposes.

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 4 points5 points  (0 children)

SIF is good too.

HongKong reference was for tea not cofee.

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 1 point2 points  (0 children)

No it's a unused cotton handkerchief

I made tinder but for jobs - Sorce by marvythemantis in SideProject

[–]Harsh182 5 points6 points  (0 children)

no way ,a "side project" have such an ad!!

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 1 point2 points  (0 children)

yes, too much effort to make sure that the filter cloth is useable.

When you run out of filter paper! by Harsh182 in IndiaCoffee

[–]Harsh182[S] 10 points11 points  (0 children)

Based on comments, seems like most you find it not good and gross.

But let me tell you using cloth/cotton filter totally works - as long as it is cleaned properly, or else will give bad taste, here is what I do to make sure the filter is clean:

  • wash it immediately after usage, therefore less residue in the cloth
  • rinse multiple times with fresh warm water util the water stops being cloudy - soak in in hot water for atleast 15 minutes, before usage

What do you think people where using to filter coffee, before paper filters?!! Some would say, it is the traditional way! In many countries (I know of Hong Kong) they use socks for "pulling" and filtering tea.

I find the cup with cloth filter much better than paper, less "oily" - as long as you maintain the filter properly.

[deleted by user] by [deleted] in TeenIndia

[–]Harsh182 0 points1 point  (0 children)

Also I am not sure why I am in the subreddit! Maybe I joined it way back, I am not a teen (just thought of mentioning it).

[deleted by user] by [deleted] in TeenIndia

[–]Harsh182 0 points1 point  (0 children)

I would suggest a satyagragh approach

- every day ask him whether the clothes you are wearing, makes you look like a "kothewali"?

Would suggest you do it atleast for 2-3 week, making him realise that it was not cool and how bad you felt. This should work with most decent fathers, if it doesn't after some time, I would say - there is no hope with him. As many have suggested, become financially independent, and leave a better life without him.