question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to have a per-model prefix

See original GitHub issue

It would be nice to be able to specify a per-model prefix, eg:

class User(models.Model)
    id = AutoHashId(primary_key=True, prefix='us_')
    # ids like us_3n3b3hjbjh4

class Project(models.Mode)
    id =  AutoHashId(primary_key=True, prefix='pr_')
    # ids like pr_j5f7l3hg5k5l

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
nshafercommented, May 1, 2018

Not a bad idea, and you’re not the only one to think of it. I just found @pegler has created a fork with that functionality. I’ll review his work.

1reaction
nshafercommented, Mar 15, 2021

OK, I have just removed the callable support for now so that it doesn’t hold up a new release. I did think it was a little superfluous since it’s called in pretty much the same context as just setting the string, but I figured there was a use-case I wasn’t aware of or thinking of. I’ll take another PR once it’s more defined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

benslavin/django-db-prefix - GitHub
GitHub - benslavin/django-db-prefix: Ability to specify prefixes for database table names in Django on a global, per-app, or per-model basis.
Read more >
Prefixes - Grammar - Cambridge Dictionary
Writing prefixes: hyphens (super-hero or supermodel). There are no absolute rules for when to use a hyphen or when to write a prefixed...
Read more >
Word Root: super- (Prefix) - Membean
The prefix super- and its variant sur- mean “over.” We all know that the DC Comics hero Superman is the hero who stands...
Read more >
Using Multi-Instance Capability on the Firepower 4100/9300
Add a MAC Pool Prefix and View MAC Addresses for Container Instance Interfaces. The FXOS chassis automatically generates MAC addresses for ...
Read more >
How to add prefix to all instances - Custom IC SKILL
Hi All, I need a SKILL code for adding prefix or suffix to a top-cell and to all its instances. For eg: I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found