does it means we have to user Admin tool?

2 views
Skip to first unread message

Eric Liu

unread,
Jul 21, 2008, 5:45:09 AM7/21/08
to django...@googlegroups.com
Hi all,
    after I readed the djangobook,I found if I wrote following code and I want to get some cool stuff.like auto generate the CRUD logic,I found that I have to use the Django Admin tool.I mean if I use Rails Or Grail,it can auto generate the code for me (both logic code and page code).but it seems that Django didn't provide these feature.I think if I want to some "user_define" feature ,and I don't use the Django Admin tool,that means I have to write some redundancy,for example every model with same CRUD method.and even if I extend the Django Admin template ,and  I want to custom some behavious of page logic,it's tough.

Is there some better methods I can use under Django,like Rails or Grails?

Thanks




class Publisher(models.Model):
    name=models.CharField(max_length=30)
    address=models.CharField(max_length=50)
    city=models.CharField(max_length=60)
    state_province=models.CharField(max_length=30)
    country=models.CharField(max_length=50)
    website=models.URLField()
   
    def __str__(self):
        return self.name
    class Meta:
        ordering=['name']
    class Admin:
        pass

Scott Moonen

unread,
Jul 21, 2008, 6:00:11 AM7/21/08
to django...@googlegroups.com
Hi Eric.  Take a look at Django's generic views (http://www.djangoproject.com/documentation/generic_views/), especially the List/Detail generic views and the Create/Update/Delete generic views on that page.  If these generic views suit your needs then you may be able to get away with writing only some template code.

  -- Scott

Eric Liu

unread,
Jul 21, 2008, 6:15:08 AM7/21/08
to django...@googlegroups.com
Hi Scott,

Thank you reply,I'll read it

all the best

Eric

2008/7/21 Scott Moonen <smo...@andstuff.org>:
Reply all
Reply to author
Forward
0 new messages