Replies

This profile is from a federated server and may be incomplete. Browse more on the original instance.

webology, to random
@webology@mastodon.social avatar
adamchainz,
@adamchainz@fosstodon.org avatar

@webology get well soon 💚

adamchainz, to django
@adamchainz@fosstodon.org avatar

🆙 django-upgrade 1.18.0 is out, with support for Django 5.1 (currently in alpha) and a fixer for the argument rename in CheckConstraint:

https://github.com/adamchainz/django-upgrade?tab=readme-ov-file#django-51

adamchainz,
@adamchainz@fosstodon.org avatar

@stuartm Yes it’s nice that Django is stable and reliable, though I’d also be happy to see some more mass-refactorable changes to make things more ergonomic :)

pganssle, to random
@pganssle@qoto.org avatar

Do they have this specific brand and flavor of yogurt outside of Spain? I think it is basically Oikos Triple Zero, but this particular flavor is super good (it has little chunks of banana in it), and doesn’t compare to the banana cream flavor we have in the States.

adamchainz,
@adamchainz@fosstodon.org avatar

@pganssle They have it in Portugal 😜 and yes it’s yummy.

anze3db, to random
@anze3db@fosstodon.org avatar

Is it just me or is the emoji picker on MacOS just unusable sometimes? It drives me crazy when this happens 🙈

video/mp4

adamchainz,
@adamchainz@fosstodon.org avatar

@siddhantgoel @anze3db Same for me, of all the apps I use. 🤷

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

🔍 Terminal Tip: Instant Source Viewer! 🐍

Below I defined a function called pys (you can add it to your .zshrc).

Now you can peek at Python source code from the command line like this:

$ pys module [object]

E.g.
$ pys collections
$ pys collections Counter

adamchainz,
@adamchainz@fosstodon.org avatar
CodenameTim, to django
@CodenameTim@fosstodon.org avatar

I'm looking for some help running a GitHub organization dedicated to supporting community-maintained third-party #Django packages.

I've written up an introduction here: https://www.better-simple.com/django/2024/05/22/looking-for-help-django-commons/

You can join here: https://github.com/django-commons/membership

adamchainz,
@adamchainz@fosstodon.org avatar

@CodenameTim Nice one, very nice.

carlton, to django
@carlton@fosstodon.org avatar

> Custom tags may now set extra data on the Parser object that will later be made available on the Template instance. Such data may be used, for example, by the template loader, or other template clients.

That looks handy, at least partially 😜

https://docs.djangoproject.com/en/dev/releases/5.1/#templates

adamchainz,
@adamchainz@fosstodon.org avatar

@carlton I guess you’re rather partial to the feature?

adamchainz,
@adamchainz@fosstodon.org avatar

@carlton good to see the template engine isn’t static.

adamchainz, to random
@adamchainz@fosstodon.org avatar

♦️ Yay, my force push blog post was featured in this week’s @pythonbytes ! 🥳

https://pythonbytes.fm/episodes/show/384/force-push-lightly

adamchainz,
@adamchainz@fosstodon.org avatar

@sabderemane @pythonbytes Your blog is still valid and you’re allowed to collect tips that others have as well :)

adamchainz, to python
@adamchainz@fosstodon.org avatar

🐍♦️ Use Git to pass pytest a list of all modified test files:

pytest $(git diff --name-only '/test_.py')

Adjust the pathspec (Git’s “glob” syntax) if you have a different test file naming convention.

adamchainz,
@adamchainz@fosstodon.org avatar

@cfbolz yeah that would be sick, theoretically possible in a plugin.

adamchainz, to random
@adamchainz@fosstodon.org avatar

♦️ There is a safer alternative to 'git push --force'!

🫸 Use --force-with-lease and --force-if-includes to restrict force pushes so that they don’t unintentionally overwrite commits pushed by others.

Explained in my post: https://adamj.eu/tech/2023/10/31/git-force-push-safely/

adamchainz,
@adamchainz@fosstodon.org avatar

@zolyguy the best day to learn is yesterday, the second best is today!

adamchainz,
@adamchainz@fosstodon.org avatar

@hjwp yes it reads the reflog :)

Nothing is ever gone in Git until it’s expired from the reflog

SebastianM6L, to django
@SebastianM6L@mastodon.social avatar

Why isn't

Model.objects.get_or_none()

a thing in ?

That would save some boilerplate code or am I wrong?

Because if there is a chance that there is no entry for the query get()will raise a DoesNotExist exception that you have to catch.

get_or_none()would be cleaner in my opinion.

adamchainz,
@adamchainz@fosstodon.org avatar

@SebastianM6L Many duplicate closed tickets asking about this:

https://duckduckgo.com/?t=ffab&q=site%3Acode.djangoproject.com+get_or_none&ia=web

Also, I’ve seen several packages implement it. I think it could be a worthwhile forum discussion, at laest to gather more opinions. I suggest you start a thread on https://forum.djangoproject.com :)

adamchainz,
@adamchainz@fosstodon.org avatar

@SebastianM6L Yeah it’s hard to dive into such a long-running project. We’re all here to help. Ping me with your forum thread 😀

jack, to django
@jack@social.jacklinke.com avatar

I finally got around to upgrading my main project from Django 4.2 to Django 5.

I allocated several hours this evening for the arduous process of making sure I got everything right, and before I got started I figured I'd give django-upgrade (by @adamchainz) a try this time around.

No more than 15 minutes later my project was running on Django 5, tested good, and pushed to production.

Wait, what?!?! 😲

Super impressed with how easy django-upgrade made it ❤️

https://pypi.org/project/django-upgrade/

adamchainz,
@adamchainz@fosstodon.org avatar

@jack Great to hear.

Which fixer was the most helpful? There are none for Django 5.0 but maybe the 4.1 or 4.2 ones fixed some deprecations that you hadn’t addressed…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • cisconetworking
  • rosin
  • mdbf
  • Youngstown
  • love
  • slotface
  • khanakhh
  • ngwrru68w68
  • kavyap
  • Durango
  • thenastyranch
  • DreamBathrooms
  • magazineikmin
  • provamag3
  • tacticalgear
  • cubers
  • ethstaker
  • InstantRegret
  • osvaldo12
  • GTA5RPClips
  • everett
  • normalnudes
  • modclub
  • tester
  • anitta
  • Leos
  • JUstTest
  • All magazines