profile
viewpoint
Patrick Altman paltman Eldarion Nashville, TN http://paltman.com President @eldarion Open Source Hacker @pinax

ccollins/milkman 86

Django model object generation - no more fixtures!

jtauber/learning-greek 17

researching how to improve the way people learn Koine Greek

jtauber/homer-ngram 6

calculation and visualisation of repeating n-grams in Homer and beyond

jtauber/pyv6 6

a wild attempt to port xv6 to Python

jtauber/qmorph 4

tabular data querying and pivoting in Python3 (with examples particular to linguistic morphology)

paltman/clippy 3

Clippy is a very simple Flash widget that makes it possible to place arbitrary text onto the client's clipboard.

jtauber/oxlos2 2

(A reboot of) a Pinax-based platform for crowd-sourced collaborative corpus linguistics

paltman/celery 2

Distributed Task Queue (development branch)

paltman/django 2

Official clone of the Subversion repository.

startedbahmutov/cypress-and-jest

started time in 3 hours

startedmhx/dwarfs

started time in 17 hours

startedjordaneremieff/mangum-cli

started time in a day

issue commentjoerick/pyinstrument

Asyncio applications have a mysterious [SELF] function

Hmm interesting! So the async/await stuff does preserve profiler state to keep call trees clean. Good to know!

AggressivelyMeows

comment created time in a day

issue commentjoerick/pyinstrument

Asyncio applications have a mysterious [SELF] function

While attempting to figure this out, I found that PyInstrument only records the first await'ed task during the profile:

There should be the get_post function running with the _ but it just shows the time waster function.

AggressivelyMeows

comment created time in a day

issue commentjoerick/pyinstrument

Asyncio applications have a mysterious [SELF] function

But then wouldnt it collpase into the serve function time?

AggressivelyMeows

comment created time in a day

issue commentjoerick/pyinstrument

Asyncio applications have a mysterious [SELF] function

'Self time' is time spent inside the function that's not attributable to any children - so probably something that's happening inside the function directly. I'm not super familiar with async Python, but I think that if your code hit an await, you'd see the flow control return to the run loop in your sample, which doesn't look like what's happening here. Maybe the time really is spent inside the function serve?

AggressivelyMeows

comment created time in a day

issue openedjoerick/pyinstrument

Asyncio applications have a mysterious [SELF] function

The first function is labelled as [SELF] and i'm not sure how to interpret it. Is it how long the event loop took to get back to the function or something else?

For context, i'm creating a profiler before and closing it after every request in Sanic. Its a Flask-like asyncio powered web framework.

created time in a day

startedGavinJoyce/tailwindcss-question-mark

started time in a day

startedspulec/freezegun

started time in 2 days

issue closedpinax/django-mailer

Need to find matching MessageLogs by email address

I am trying to match MessageLog entries in the DB with an email address that it was sent to. In digging into this I can get the to addresses as:

In [61]: from mailer.models import MessageLog

In [62]: m = MessageLog.objects.get(pk=1)

In [63]: m.email.to
Out[63]: ['someone@example.com']

But, what I need to do is somehow match the email address recipient with an email address for a person in my "person model" so I can display them on a page. None of the numerous variations have worked and that seems to be because "log.to" is the result of a proplety / "function" and not an actual attribute of the model.

Any tips/pointers/code from anyone who might have already solved this?

closed time in 2 days

ebdavison

issue commentpinax/django-mailer

Need to find matching MessageLogs by email address

Thank you for that code. I was not able to get that much working before and when/if needed that will definitely come in handy. As to the separate model, I have started doing this but every once in a while I need to go back to the original message ID and stats returned from the SMTP server so will reserve the above code for an admin details sort of function.

This is VERY much appreciated.

ebdavison

comment created time in 2 days

startedjavve/list.js

started time in 2 days

created repositorymetcalfc/minecraft

created time in 2 days

startedgrofers/legend

started time in 2 days

startedandy-landy/traceback_with_variables

started time in 2 days

startedcrobertsbmw/deckofcards

started time in 2 days

push eventscaife-viewer/scaife-viewer

Jacob Wegner

commit sha 48515e14ce25a97c50d1707bcd0cf978b5d74793

force pip upgrade in CI

view details

push time in 3 days

PR opened scaife-viewer/scaife-viewer

Improve local resolver performance

Update to latest scaife-viewer-core:

  • Upgrade MyCapytain and improve resolver performance #32
  • Document RESOLVER_CACHE_LABEL setup #33
+19 -1

0 comment

3 changed files

pr created time in 3 days

create barnchscaife-viewer/scaife-viewer

branch : feature/resolver-perf

created branch time in 3 days

startedmhx/dwarfs

started time in 3 days

startedopenvinotoolkit/cvat

started time in 3 days

issue commentpinax/django-mailer

Need to find matching MessageLogs by email address

The only way to do it is as follows:

for log in MessageLog.objects.all():
    if "someone@example.com" in log.email.to:
        do_something()

This is very bad in terms of performance - you have to load all the MessageLog records from the DB to find the one you are interested in. There is no way to do the filtering in the DB, because we don't store that field separately. This is because MesssageLog is just not designed for this - it is designed with django-mailers needs in mind, not your use case.

The answer is "don't do this". If you need a list of all messages sent to a user, create your own model that has a foreign key to your 'person' model, and use this. At the same time as sending mail (with django-mailer or any other mail backend), you should store a record in this table, storing all the details you need. To populate this table initially you may be able to use the data in the MessageLog table. After this initial population, you shouldn't be using MessageLog at all.

ebdavison

comment created time in 3 days

startedJOJ0/synadm

started time in 4 days

startedphiresky/ripgrep-all

started time in 4 days

issue commentpinax/pinax-referrals

Pending Migration on v4.0.1

@PetrDlouhy @KatherineMichel Hi guys, in the commit d3411eed41fce6599f1de79f43cfb5f8f9266455, you modified field constraints but didn't make migrations for this change.

crawfordleeds

comment created time in 5 days

pull request commentpinax/pinax-referrals

Increase overridability

@PetrDlouhy @KatherineMichel Hi guys, in the commit d3411eed41fce6599f1de79f43cfb5f8f9266455, you modified field constraints but didn't make migrations for this change.

PetrDlouhy

comment created time in 5 days

issue openedpinax/django-mailer

Need to find matching MessageLogs by email address

I am trying to match MessageLog entries in the DB with an email address that it was sent to. In digging into this I can get the to addresses as:

from mailer.models import MessageLog
log = Messagelog.objects.get(pk=1)
to_emails = log.to

This returns a list of "to" addresses as:

$ print(to_emails)
['someone@example.com']

But, what I need to do is somehow match the email address recipient with an email address for a person in my "person model" so I can display them on a page. None of the numerous variations have worked and that seems to be because "log.to" is the result of a proplety / "function" and not an actual attribute of the model.

Any tips/pointers/code from anyone who might have already solved this?

created time in 5 days

startedcasey/just

started time in 5 days

fork justinabrahms/elfeed

An Emacs web feeds client

fork in 6 days

more