GithubHelp home page GithubHelp logo

rafaelgontijo / django-custom-field Goto Github PK

View Code? Open in Web Editor NEW

This project forked from willseward/django-custom-field

0.0 2.0 1.0 99 KB

End user defined custom fields for Django including contrib.admin support

Python 97.46% HTML 2.54%

django-custom-field's Introduction

django-custom-field

Allow end users to create easy (but slower to work with) fields attached to any Django model. Includes support so fields show up in the admin interface and helper functions that make it easy to access any custom fields programmatically.

Does not alter sql when adding a new field. Does not allow you use to custom fields in django ORM mymodel.objects.filter(custom_field_x=Whatever)

Build Status

Installation

  1. pip install django-custom-field
  2. Add 'custom_field' to settings.INSTALLED_APPS
  3. Optional: For shortcut methods to get and set custom fields, extend models you want to use it with like:
from custom_field.custom_field import CustomFieldModel
class MyModel(CustomFieldModel):
  1. Optional: To have admin work with custom fields include this class:
from custom_field.custom_field import CustomFieldAdmin
class MyModelAdmin(CustomFieldAdmin):

#Schooldriver Usage The custom fields option allows schools additional flexibility with regards to storing information to a particular model (student, applicants, student worker, etc.).

Under Admin > Custom Fields, the custom fields creation screen displays: Alt text

Required fields:

Name- Refers to the name of the custom field. Note: this name will be visible to other users

Content Type- Designates which model to affix the custom field to. (Student, Alumni, Applicant, Faculty, etc.)

Field Type- Text, Integer, and Boolean- select the type of custom field.

NB: Boolean refers to a simple checkbox. The box can be checked or unchecked when created based on preference. Leave blank for unchecked and enter "1" for checked under the "Default Value" in the creation screen shown above.

#Example This example will demonstrate custom fields for a school that would like to attach additional information to the incoming applicants page.

In sum, the school wants three additional items of information: who an applicant was referred by, whether or not financial aid is needed, and how many times the applicant has visited the school.

Accordingly, three custom fields will need to be generated under Admin > Custom Fields > Add, formatted as follows:

Who the applicant was referred by:

Alt text

Number of visits to the school:

Alt text

Whether or not financial aid is needed:

Alt text

The end result will look like the image below where end users will see the custom fields attached to the Applicant model and can then enter the appropiate information

Alt text

Credit

This project was originally designed and maintained by burke-software. After a period of stagnation, it was graciously handed over to me for upkeep. Please give due respect and gratitude for the inception of this project to David.

django-custom-field's People

Contributors

bufke avatar fromageball avatar juanvasquez avatar willseward avatar

Watchers

 avatar  avatar

Forkers

tqchagas

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.