Sounds to me you'd like a separate auto-increment field?

On Saturday, February 8, 2020 at 11:55:48 AM UTC-5, Bruckner de Villiers 
wrote:
>
> Mike,
>
> I tried id = model.AutoField(verbose_name=”Ticket #”).  Migrate didn’t 
> like it – can’t have duplicate primaries.  I suspect this is because the 
> Bug model already exists.
>
>  
>
> What I am trying to achieve is an auto-increment field whereby every time 
> a user logs a bug/suggestion/comment it writes a unique ticket number in 
> the background, which is used as a reference for subsequent actions like 
> Fixed, Close, WiP, etc.  and as a ForeignKey in the Comment model.   I 
> couldn’t find anything meaningful for this functionality and so thought 
> that the ‘id’ is already fit for purpose, but merely requires an 
> explanatory field text.
>
>  
>
> Make sense?
>
>  
>
> Bruckner de Villiers
>
> 083 625 1086
>
>  
>
> *From: *<django...@googlegroups.com <javascript:>> on behalf of Mike 
> Dewhirst <mi...@dewhirst.com.au <javascript:>>
> *Reply to: *<django...@googlegroups.com <javascript:>>
> *Date: *Saturday, 08 February 2020 at 13:48
> *To: *<django...@googlegroups.com <javascript:>>
> *Subject: *RE: Adding a verbose_name to id field
>
>  
>
> I imagine you need to specify the id field in your model and give it a 
> verbose name. 
>
>  
>
> This is an unusual requirement. Why do you want to do such a thing?
>
>  
>
> Mike
>
>  
>
> -------- Original message --------
>
> From: Bruckner de Villiers <bruckner....@gmail.com <javascript:>> 
>
> Date: 8/2/20 21:33 (GMT+10:00) 
>
> To: django...@googlegroups.com <javascript:> 
>
> Subject: Adding a verbose_name to id field 
>
>  
>
> Using Sqlite3 & Django 3.0.2 - I have searched high and low, but can’t 
> find a way to add a verbose name to the id of a model.
>
> Anyone have ideas, please?
>
>  
>
> Bruckner de Villiers
>
> +27 83 625 1086
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5e3e9fe6.1c69fb81.7cda5.a2fdSMTPIN_ADDED_MISSING%40gmr-mx.google.com
>  
> <https://groups.google.com/d/msgid/django-users/5e3e9fe6.1c69fb81.7cda5.a2fdSMTPIN_ADDED_MISSING%40gmr-mx.google.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0627cb8d-c308-4ef0-85f9-14de135a2270%40googlegroups.com.

Reply via email to