Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Django proxy models for markdown extensions of Message #13514

Open
timabbott opened this issue Dec 11, 2019 · 4 comments
Open

Use Django proxy models for markdown extensions of Message #13514

timabbott opened this issue Dec 11, 2019 · 4 comments

Comments

@timabbott
Copy link
Sponsor Member

timabbott commented Dec 11, 2019

We have several extra fields we add to Django Message objects when doing Bugdown rendering (e.g. potential_attachment_urls, mentions_wildcard, etc.). Currently, it's a bit of a hack, in that these values we attach to the Message object aren't part of its class definition..

One reasonable approach for typing this flow (enforced to some extent by how python-markdown is architected) would be to define a BugdownMessage class using Django's Proxy Models feature (https://docs.djangoproject.com/en/3.0/topics/db/models/#proxy-models).

While we're at it, _md_engine.zulip_db_data could probably be made a TypedDict so it can be typed nicely.

@neiljp FYI

@zulipbot
Copy link
Member

zulipbot commented Dec 11, 2019

Hello @zulip/server-markdown, @zulip/server-refactoring members, this issue was labeled with the "area: markdown", "area: refactoring" labels, so you may want to check it out!

@EydenVillanueva
Copy link

Hello, is anyone working on this? Can I claim it ?

@Kushal-kothari
Copy link

@zulipbot claim

@zulipbot
Copy link
Member

Hello @Kushal-kothari!

Thanks for your interest in Zulip! You have attempted to claim an issue without the labels "help wanted", "good first issue". Since you're a new contributor, you can only claim and submit pull requests for issues with the help wanted or good first issue labels.

If this is your first time here, we recommend reading our guide for new contributors before getting started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants