Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
Cómo usar el tipo de texto como clave principal en Django

Estoy aprendiendo Django, pero el ORM no permite tener una clave principal de texto. Me gustaría tener una clave principal como 00RTTIN223 . ¿Hay alguna otra forma de evitar ese límite?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Este es un fragmento de django docs: https://docs.djangoproject.com/en/1.11/topics/db/models/

 class Fruit(models.Model): name = models.CharField(max_length=100, primary_key=True) >>> fruit = Fruit.objects.create(name='Apple') >>> fruit.name = 'Pear' >>> fruit.save() >>> Fruit.objects.values_list('name', flat=True) ['Apple', 'Pear']
about 4 years ago · Santiago Trujillo Report

0

Intente usar CharField con unique=True y primary_key=True

about 4 years ago · Santiago Trujillo Report

0

documentos de django sobre la clave_principal

 class Product(models.Model): pid = models.CharField(max_length=255, primary_key=True)
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!