All Projects → edoburu → django-any-urlfield

edoburu / django-any-urlfield

Licence: Apache-2.0 License
An improved URL selector to choose between internal models and external URLs

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to django-any-urlfield

django-sqlalchemy
Django ORM built on top of SQLalchemy core 2.0 for seamless integration of SQLAlchemy with Django 4.1+ PostgreSQL 14+ only for now. [pre POC now]
Stars: ✭ 101 (+134.88%)
Mutual labels:  django-admin, django-field
django-admin-page-lock
Page Lock for Django Admin allows developers to implement customizable locking pages.
Stars: ✭ 13 (-69.77%)
Mutual labels:  django-admin
django-admin-shell
Django/Python shell for django admin site.
Stars: ✭ 62 (+44.19%)
Mutual labels:  django-admin
django-video-encoding
django-video-encoding helps to convert your videos into different formats and resolutions.
Stars: ✭ 108 (+151.16%)
Mutual labels:  django-field
django-quill
Easily use Quill.js in your django admin.
Stars: ✭ 54 (+25.58%)
Mutual labels:  django-admin
django-google-optimize
Django-google-optimize is a Django application designed to make running server side Google Optimize A/B tests easy.
Stars: ✭ 37 (-13.95%)
Mutual labels:  django-admin
django-code-generator
Generate code from your Django models for faster development
Stars: ✭ 35 (-18.6%)
Mutual labels:  django-admin
django-csv-export-view
Django class-based view for CSV exports
Stars: ✭ 17 (-60.47%)
Mutual labels:  django-admin
django-admin-actions
Display Django admin custom actions in changelist, changeview or per row in changelist.
Stars: ✭ 30 (-30.23%)
Mutual labels:  django-admin
django-lock-tokens
A Django application that provides a locking mechanism to prevent concurrency editing.
Stars: ✭ 19 (-55.81%)
Mutual labels:  django-admin
django admin chart js
An example repo showing how to add Chart.js to Django admin
Stars: ✭ 35 (-18.6%)
Mutual labels:  django-admin
PyShop
PyShop is an online Python Ecommerce website built with Django, SQLite and Bootstrap. A simple and lightweight ecommerce app easily deployable anywhere anytime with modules developed upon the inbuilt django admin.
Stars: ✭ 17 (-60.47%)
Mutual labels:  django-admin
django-streamfield
This is a simple realisation of StreamField's idea from Wagtail CMS for plain Django admin or with Grappelli skin.
Stars: ✭ 62 (+44.19%)
Mutual labels:  django-admin
django-learning-pathway
(Currently in development) Learning pathways for learning Django.
Stars: ✭ 35 (-18.6%)
Mutual labels:  django-admin
django-editorjs-fields
Django plugin for using Editor.js
Stars: ✭ 47 (+9.3%)
Mutual labels:  django-admin
django-yaaac
Ajax Autocomplete Django application
Stars: ✭ 13 (-69.77%)
Mutual labels:  django-admin
django-admin-confirm
AdminConfirmMixin is a mixin for ModelAdmin that adds confirmations to changes, additions and actions.
Stars: ✭ 34 (-20.93%)
Mutual labels:  django-admin
django-admin-autocomplete-list-filter
Ajax autocomplete list filter for Django admin
Stars: ✭ 68 (+58.14%)
Mutual labels:  django-admin
django-restful-admin
Django admin restful api
Stars: ✭ 51 (+18.6%)
Mutual labels:  django-admin
flask-djcelery
An example project for configuring Djcelery with Flask application and dynamically changing tasks via REST API and through django admin
Stars: ✭ 13 (-69.77%)
Mutual labels:  django-admin
https://readthedocs.org/projects/django-any-urlfield/badge/?version=latest

django-any-urlfield

The any_urlfield module provides an improved URL selector that supports both URLs to internal models and external URLs.

This addresses is a common challenge in CMS interfaces; where providing a URLField makes it hard to enter internal URLs, while providing a ModelChoiceField makes it too inflexible. This package provides the both of both worlds.

For more details, see the documentation at Read The Docs.

Screenshot

AnyUrlField, with external URL input.
AnyUrlField, with internal page input.

Installation

First install the module, preferably in a virtual environment:

pip install django-any-urlfield

Add the module to the installed apps:

INSTALLED_APPS += (
    'any_urlfield',
)

Usage

Add the field to a Django model:

from django.db import models
from any_urlfield.models import AnyUrlField

class MyModel(models.Model):
    title = models.CharField("Title", max_length=200)
    url = AnyUrlField("URL")

By default, the AnyUrlField only supports linking to external pages.

Register any model that the AnyUrlField should support linking to:

from any_urlfield.models import AnyUrlField
AnyUrlField.register_model(Article)

Now, the AnyUrlField offers users a dropdown field to directly select an article.

The default field is a django.forms.models.ModelChoiceField field with a django.forms.widgets.Select widget. This can be customized using the form_field and widget parameters:

from any_urlfield.models import AnyUrlField
from any_urlfield.forms import SimpleRawIdWidget

AnyUrlField.register_model(Article, widget=SimpleRawIdWidget(Article))

That will display the Article model as raw input field with a browse button.

Contributing

This module is designed to be generic. In case there is anything you didn't like about it, or think it's not flexible enough, please let us know. We'd love to improve it!

If you have any other valuable contribution, suggestion or idea, please let us know as well because we will look into it. Pull requests are welcome too. :-)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].