GithubHelp home page GithubHelp logo

samirelanduk / django-random-id-model Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 8 KB

A model base class which creates long, random, integer primary keys.

Python 100.00%
django primary-key django-models id-generator

django-random-id-model's Introduction

Sam Ireland

I'm a developer, consultant, and UCL PhD based in London. I write a lot of code. I also write and do research.

Currently Working On

Deep Mountain - software contracting, mostly in the bioinformatics/biotech area. If you think my skillset would match a problem you have, it would be great to hear from you.

Goodwright - a web dev startup I run with a friend. We make software for scientists, such as iMaps, LabTab and more.

Lytiko - a personal analytics platform.

Other Projects.

Core Skills

Python/Django

JavaScript/React

GraphQL

Bioinformatics

Machine Learning

How to reach me?

Twitter or Linkedin - same username as here for both.

django-random-id-model's People

Contributors

samirelanduk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gurugeek tamhv

django-random-id-model's Issues

Use PositiveBigIntegerField instead of BigIntegerField

Nice module, thanks !

Some fixture generators like Django-Baker will prefill this ID with random negative values, breaking e.g. URL resolution (because it expects a positive integer in the regex of placeholders of URLs)

So the simplest would be to use PositiveBigIntegerField, also allowing tiny optimizations at DB level maybe.

(Of course this can still be overridden at subclass level, so it's not very blocking)

ID field in admin

thanks for your package. I did as per readme ๐Ÿ‘

from django_random_id_model import RandomIDModel

class Work(RandomIDModel):
	title = models.CharField(max_length=200)
	body = HTMLField()
	published = models.BooleanField(default=False, null=True)
	date = models.DateTimeField(auto_now=True)

the problem is that now in adming (or add forms) an ID is required so I need to enter it mantually?
I am confident that this was not interended behaviour so thanks in advance for your help!

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.