GithubHelp home page GithubHelp logo

matiasherranz / django-tekextensions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pmourelle/django-tekextensions

0.0 1.0 1.0 77 KB

Re-usable views/templatetags/widgets for django applications

django-tekextensions's Introduction

admin popups

if using grappeli, copy RelatedObjectLookups.js to your admin_media folder from django's admin media

settings.py

TEMPLATE_CONTEXT_PROCESSORS = (
    'tekextensions.context_processors.admin_media_prefix',
)
INSTALLED_APPS = (
    'tekextensions',
)

urls.py

url(r'^add/(?P<model_name>\w+)/?$', 'tekextensions.views.add_new_model'),

or adding some custom form (the class, not string name)

from path.to.custom.forms import CustomForm
...
url(r'^add/(?P<model_name>\w+)/?$', 'tekextensions.views.add_new_model',
    {'form': CustomForm}),

forms.py

override any ModelChoiceField widget with SelectWithPopUp

from tekextensions.widgets import SelectWithPopUp
from django import forms

class CustomForm(forms.Form):
    company = forms.ModelChoiceField(CustomModel.objects, widget=SelectWithPopUp)
    # or
    company = forms.ModelChoiceField(CustomModel.objects, widget=SelectWithPopUp(model=CustomModel))

django-tekextensions's People

Contributors

sontek avatar

Watchers

 avatar

Forkers

thetuxis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.