Simple and generic application for Django projects to attach and handle links for any object
Project description
django-generic-links
Simple app to attach links to any Django model. Compatible with Django 4+ and Python 3.9+
Features
- Model Admin
- Generic inline admin
- A template tag to get all links for a given model instance
Installation
Installing django-generic-links
is fairly easy. You can...
pip install django-generic-links
...or, you can clone the repo and install it the old fashioned way.
git clone git://github.com/matagus/django-generic-links.git
cd django-generic-links
pip install -e .
then add generic_links
to your settings.py
:
INSTALLED_APPS = (
# ...
"generic_links",
)
and then run the migrations!
# python manage.py migrate
Usage
Using django-generic-links models
Imagine you have a music app in your project where you save and manage artist's data. So you have an Artist model
.
And you'd like to store and display links for each artist, say her facebook page, her youtube artist page and her
last.fm profile page:
Generic Links Inline Admin
Since a GenericLink
instance will be associated to another object you usually
wish to show an inline model admin form in that model form.
Using django-generic-links templatetags
Now imagine you have an artist page. You're passing artist
object using template
context and you want to get all the links for it:
Development / Contributions
Running Tests
hatch run test:test
will run the tests in every Python + Django versions combination.
Development commands
hatch shell
Want to help?
If you'd like to help, write example code, contribute patches, document things on the wiki your help is always appreciated! Just fork the project, clone your repo, commit, push and send me a pull request
License
django-generic-links
is released under an BSD License - see the LICENSE
file
for more information.
Acknowledgements
Tools used in building this package:
- Cookiecutter and cookiecutter-djangopackage for rendering this package.
- Carbon for those beautiful code snippets.
Posts I learned from:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_generic_links-0.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8025002ed9002b10ba2e951c3e1d06d67ad0ae0d9dbd39bdbb1faf8b9fe2a63 |
|
MD5 | 82e11fd404c33b65815373d1e6ad75cf |
|
BLAKE2b-256 | ca23d0d5aa16e1eaddb546a15cdff5222360e63db7c4d3c4c66bd1dfddeae8cf |
Hashes for django_generic_links-0.9.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509c8133fdfe64d73c68e768d1954fb0887d7fec4b33d3d43b9f6428be581eed |
|
MD5 | f456a9bbfa36cf9c2fccc57cd6f0b6a0 |
|
BLAKE2b-256 | 4f1fb8cee0c537dc781528eb4cff8b6a229805f863a575e560c21c70db6cf303 |