# Path: DJangoHotel/models.py
# class Hotel(models.Model):
#     name = models.CharField(max_length=30,primary_key=True)
#     address = models.CharField(max_length=50)
#     description = models.TextField()
#     
#     def __unicode__(self):
#         return self.name  
# 
# class Customer(models.Model):
# #    id = models.AutoField(primary_key=True, default='SOME STRING')
#     tel = models.CharField(max_length=30)
#     name = models.CharField(max_length=30, default='someone')
#     IDcard=models.CharField(max_length=30,null=True,blank=True)
#     
#     def __unicode__(self):
#         return self.name    
# 
# class RoomInfo(models.Model):
#     name = models.CharField(max_length=30,primary_key=True)
#     price = models.IntegerField(null=True,blank=True)
#     total = models.IntegerField(null=True,blank=True)
#     description = models.TextField()
# 
#     def __unicode__(self):
#         return self.name
# 
# class Order(models.Model):    
#     customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
#     roomtype = models.CharField(max_length=45,choices= ROOM_TPYE_CHOICES)
#     begin = models.DateField()
#     end = models.DateField()
#     totalprice = models.IntegerField()
#     state=models.CharField(max_length=45,choices=ORDER_STATE_CHOICES)
# 
#     def __unicode__(self):
#         return self.id


from django.contrib import admin
from .models import Hotel, Customer, RoomInfo,Order

# Register your models here.


class HotelAdmin(admin.ModelAdmin):
    list_display = ('name', 'address', 'description')

class RoomInfoAdmin(admin.ModelAdmin):
    list_display = ('name', 'price','total', 'description')

class OrderAdmin(admin.ModelAdmin):
    list_display = ('id','customer','roomtype','begin','end','totalprice','state')

class customerAdmin(admin.ModelAdmin):
    list_display = ('tel','name','IDcard')

admin.site.register(Hotel,HotelAdmin)
admin.site.register(Customer,customerAdmin)

# Path: DJangoHotel/models.py
# class Hotel(models.Model):
#     name = models.CharField(max_length=30,primary_key=True)
#     address = models.CharField(max_length=50)
#     description = models.TextField()
#     
#     def __unicode__(self):
#         return self.name  
# 
# class Customer(models.Model):
# #    id = models.AutoField(primary_key=True, default='SOME STRING')
#     tel = models.CharField(max_length=30)
#     name = models.CharField(max_length=30, default='someone')
#     IDcard=models.CharField(max_length=30,null=True,blank=True)
#     
#     def __unicode__(self):
#         return self.name    
# 
# class RoomInfo(models.Model):
#     name = models.CharField(max_length=30,primary_key=True)
#     price = models.IntegerField(null=True,blank=True)
#     total = models.IntegerField(null=True,blank=True)
#     description = models.TextField()
# 
#     def __unicode__(self):
#         return self.name
# 
# class Order(models.Model):    
#     customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
#     roomtype = models.CharField(max_length=45,choices= ROOM_TPYE_CHOICES)
#     begin = models.DateField()
#     end = models.DateField()
#     totalprice = models.IntegerField()
#     state=models.CharField(max_length=45,choices=ORDER_STATE_CHOICES)
# 
#     def __unicode__(self):
#         return self.id


# Path: DJangoHotel/admin.py
from django.contrib import admin
from .models import Hotel, Customer, RoomInfo,Order


# Register your models here.


class HotelAdmin(admin.ModelAdmin):
    list_display = ('name', 'address', 'description')

class RoomInfoAdmin(admin.ModelAdmin):
    list_display = ('name', 'price','total', 'description')

class OrderAdmin(admin.ModelAdmin):
    list_display = ('id','customer','roomtype','begin','end','totalprice','state')

class customerAdmin(admin.ModelAdmin):
    list_display = ('tel','name','IDcard')

admin.site.register(Hotel,HotelAdmin)
admin.site.register(Customer,customerAdmin)

admin.site.register(RoomInfo,RoomInfoAdmin)