Hi,
I'm very new in Django. I'm making a cv, but I don't get select a choice 
through the django-admin web. I've searched solutions in the community but 
I cant't solve it.

My code is:

*Models.py*
""""
class Article(models.Model):
    
    year = models.PositiveIntegerField(
            validators=[
                MinValueValidator(1900), 
                MaxValueValidator(datetime.now().year)], null=True, 
blank=True)
   
    title = models.CharField(max_length=200)
    author = models.ManyToManyField(Author)
    journal = models.ForeignKey(Journal, models.CASCADE)
    summary = models.TextField(max_length=1000, null=True, blank=True, 
                               help_text="Brief description of the article")
   
    PUB_TYPE = (
        ('r', 'refereed'),
        ('t', 'technical report'),
        ('p', 'proceeding'),
        ('b', 'book'),
        ('c', 'book chapter'),
    )

    status = models.CharField(max_length=1, choices=PUB_TYPE, 
default='refereed', 
                               help_text='publication type')
    
    class Meta:
        ordering = ['year']
        
    def get_absolute_url(self):
        return reverse('article-detail', args=[str(self.id)])    

    def __str__(self):
        return self.title
""""

*admin.py*
"""
@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'journal', 'year', 'status')
    list_filter = (("year", "journal")
    ordering = ('-year',)
    search_fields= ('author',)
    filter_horizontal = ('author',)
    raw_id_fields = ('journal',)
"""
When I click in the status button (attached image), the  choices aren't 
displayed and i can't seletc one.
I would be very grateful for any idea.

Thanks in advance,
Maria

-- 
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/30490e97-5c14-436b-970e-17676ad0d420n%40googlegroups.com.

Reply via email to