Giter Site home page Giter Site logo

georgemagnuson / neapolitan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carltongibson/neapolitan

0.0 0.0 0.0 59 KB

Quick CRUD views for Django

Home Page: https://noumenal.es/neapolitan/

License: MIT License

Python 89.22% HTML 10.17% Just 0.61%

neapolitan's Introduction

Neapolitan

PyPI version

I have a Django model:

from django.db import models

class Bookmark(models.Model):
    url = models.URLField(unique=True)
    title = models.CharField(max_length=255)
    note = models.TextField(blank=True)
    favourite = models.BooleanField(default=False)

I want easy CRUD views for it, without it taking all day:

# urls.py
from neapolitan.views import CRUDView

class BookmarkView(CRUDView):
    model = Bookmark
    fields = ["url", "title", "note"]
    filterset_fields = [
        "favourite",
    ]

urlpatterns = [ ... ] + BookmarkView.get_urls()

Neapolitan's CRUDView provides the standard list, detail, create, edit, and delete views for a model, as well as the hooks you need to be able to customise any part of that.

Neapolitan provides base templates and re-usable template tags to make getting your model on the page as easy as possible.

Where you take your app after that is up to you. But Neapolitan will get you started.

Let's go! ๐Ÿš€

Next stop the docs ๐Ÿš‚

Versioning and Status

Neapolitan uses a two-part CalVer versioning scheme, such as 23.7. The first number is the year. The second is the release number within that year.

This is alpha software. I'm still working out the details of the API, and I've only begun the docs.

But: You could just read neapolitan.views.CRUDView and see what it does. Up to you. ๐Ÿ˜œ

Installation

Install with pip:

pip install neapolitan

Add neapolitan to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "neapolitan",
]

Templates expect a base.html template to exist and for that to defined a content block. (Refs <carltongibson#6>.)

neapolitan's People

Contributors

carltongibson avatar georgemagnuson avatar avallbona avatar luciddan avatar evildmp avatar joshuadavidthomas avatar kasun avatar sobolevn avatar

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.