@CodenameTim@fosstodon.org avatar

CodenameTim

@CodenameTim@fosstodon.org

Gardener, homebrewer, bread baker and hot sauce maker. Assister with Django Debug Toolbar.
Jazzband | DEFNA | he/him

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

CodenameTim, to django
@CodenameTim@fosstodon.org avatar

Coming back at update_or_create for round 2!

If you call update_or_create where the instance already exists and the defaults passed in are already the values on the instance, do you ever want it to actually re-save the instance?

I'm running into the case where I'd prefer it to not update the instance if it doesn't need to. I'm guessing I'm overlooking some race condition problem though.

#Django

CodenameTim,
@CodenameTim@fosstodon.org avatar

@fallenhitokiri That would be a tough one. I'd argue that since nothing else is being updated, you wouldn't want that timestamp being touched.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@fallenhitokiri And that's probably the nail in the coffin for the argument to change it.

BUT.

I'd argue the savings of not issuing an update > the heartbeat example. Especially considering you could replace it with update_or_create(id, {'updated': timezone.now()}) whereas you have to re-implement update_or_create to get that performance optimization.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@webology I'm realizing that this problem is only a major problem when using django-simple-history where it creates a historical record on every save. These empty saves add up if they occur on a regular basis.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@fallenhitokiri I see two reasons for the updated timestamp column. One is for a heartbeat like you described. The other is for a last modified. In that latter case, if nothing has been modified, it's more confusing to have that timestamp changed.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@ryanhiebert @webology Welp, maybe I should create that issue on the repo for a library specific utility function.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@ryanhiebert @webology Pretty sure bulk_create with update_conflicts is an upsert for postgres now.

mahryekuh, to random
@mahryekuh@fosstodon.org avatar

Open source contributors, what did you wish you knew when you started contributing? Or is there something that kept you from contributing for too long?

I am asking for a presentation, which I will give in two weeks.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@mahryekuh smallish, regular contributions go a long way.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@mahryekuh For me it was the idea that small changes didn't make an impact, so it wasn't worth the high effort to get started and do them.

derwaro, to django
@derwaro@fosstodon.org avatar

When having a #Django App deployed to #fly.io @flydotio what's the best way to read the actual Django logs? Store them in volumes? Or stream them to some S3? I get a 500 response in the browser sometimes and want to see the actual stacktrace.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@derwaro Have you considering installing Sentry?

josh, to random
@josh@joshthomas.dev avatar

Wrote about cracking the case of the missing time zone data. Where did it go? Did I cause it or was it an upstream bug?

(Spoiler: it was me..)

https://joshthomas.dev/blog/2024/debugging-a-no-time-zone-found-error-while-using-the-official-playwright-docker-image/

CodenameTim,
@CodenameTim@fosstodon.org avatar

@josh Yikes, that's a gnarly one to untangle. Nice write-up!

I laughed at:
> It had been just long enough since making the Playwright change that I had completely forgotten that the call was coming from inside the house.

CodenameTim, to django
@CodenameTim@fosstodon.org avatar

Google Summer of Code projects have been announced and had four projects accepted!

https://summerofcode.withgoogle.com/programs/2024/organizations/django-software-foundation-8o

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

All right, here's a fun Django question:

You start a simple project, using SQLite locally. You write a model, then call makemigrations, then call migrate.

At what point is the db.sqlite3 file created?

CodenameTim,
@CodenameTim@fosstodon.org avatar

@ehmatthes I would have assumed migrate, but I'm guessing makemigrations because it needs to check the django_migrations table to determine which migrations have been applied.

_chrismay, to random
@_chrismay@fosstodon.org avatar

After a month and a half of working nearly full-time looking for a job, I accepted an offer today.

I'm worn out and looking forward to a little time off before I start something I'm better at. 🙂

CodenameTim,
@CodenameTim@fosstodon.org avatar

@_chrismay Congratulations Chris! That's always a challenge and a relief.

HamaBarhamou, to random French
@HamaBarhamou@mastodon.social avatar

Energizing the Web with Django: Open Source Contributions and Innovations in Web Development

At the launch of our python Niger community on April 28

https://www.linkedin.com/feed/update/urn:li:activity:7190993668915281920/

image/jpeg
image/jpeg
image/jpeg

CodenameTim,
@CodenameTim@fosstodon.org avatar

@HamaBarhamou congratulations on the successful launch! What were your personal highlights?

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

📣 Native Django alerting package
📄 Get notified for changes to arbitary queries
🔗 https://softwarecrafts.co.uk/100-words/day-79
,,,

CodenameTim,
@CodenameTim@fosstodon.org avatar

@nanorepublica I think there's room for this. While applications shouldn't have this (it assumes some level of lack of data integrity), it's probably in most systems > 5 years old. I look at this as a data driven version of https://deadmanssnitch.com/

CodenameTim, to random
@CodenameTim@fosstodon.org avatar

I was just reminded of the most difficult language I had to learn. https://en.wikipedia.org/wiki/VHDL

Looking at it now, I get more of it, but trying to learn that syntax at the same time I was learning Java was challenging.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@immibis Well then. I'm glad I'm not a Verilogger!

Edit: Not that there's anything wrong with Verilog. The syntax is unusual the point of being obscure to an uninitiated person.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@immibis You're illuminating massive blindspots of mine from college!

CodenameTim,
@CodenameTim@fosstodon.org avatar

@immibis I barely understand what a simulation language is today. Much less so when you remove 16 years of programming knowledge.

CodenameTim,
@CodenameTim@fosstodon.org avatar

@satya Actually learn VHDL 😅

carlton, to django
@carlton@fosstodon.org avatar

Thinking about this:

> Django apps should use as little code as possible; they should lack boilerplate. Django should take full advantage of Python’s dynamic capabilities, such as introspection.

https://docs.djangoproject.com/en/5.0/misc/design-philosophies/#less-code

CodenameTim,
@CodenameTim@fosstodon.org avatar

@carlton Sounds like the types debate was over before it began.

CodenameTim, to random
@CodenameTim@fosstodon.org avatar

I did not expect to hear Bowling For Soup on my Discover Weekly playlist today.

nedbat, to random
@nedbat@hachyderm.io avatar

My test suite has just one dot on the last line. What would you do?

  • Delete one test
  • Change the width of the terminal
  • Keep it as a visceral reminder of the uncomfortably chaotic nature of the universe
  • Write more tests
CodenameTim,
@CodenameTim@fosstodon.org avatar

@dabeaz @nedbat That's the best idea I'll see all week 👏

joni, to random
@joni@mastodon.yupgup.com avatar

More office progress 💚

image/jpeg

CodenameTim,
@CodenameTim@fosstodon.org avatar

@joni how does that room feel when there isn't bright sunlight? I want to paint my office a bold color, but I'm afraid it'll be overly dark when it's not bright out.

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