I have a model as follows :
transaction_id = models.AutoField(primary_key=True)
transaction_unique_id = models.CharField(max_length=100, null=True, blank=True, unique=True)
route_id = models.ForeignKey(FlightScheduleDetail, null=False, blank=False)
flight_number = models.ForeignKey(FlightNumbers, null=False, blank=False)
device_id = models.ForeignKey(DeviceInfo)
crew_code = models.ForeignKey(Crew)
time_of_transaction = models.TimeField()
total_quantity = models.IntegerField()
manually_added_flag = models.BooleanField(default=False)
seat_number = models.CharField(max_length=200, null=True, blank=True)
transaction_type = models.CharField(max_length=200)
reason_code_id = models.ForeignKey(ReasonCode, null=True, blank=True)
total_amount = models.FloatField()
amount_by_card = models.FloatField(null=True, blank=True)
payment_mode_id = models.ForeignKey(PaymentMethod, null=True, blank=True)
transaction_date = models.DateField(null=True, blank=True)
created_at = models.DateTimeField(null=True, blank=True)
def __unicode__(self):
return u'%s' % self.transaction_unique_id
class Meta:
verbose_name_plural = "Post Flight Transaction"
In my admin, I need a customization which displays all the route_id
values from the model and when I click on one route_id
, it displays all the transaction_date
values and under them, it displays all the transaction_id
values and when I click on one entry , in this level, I need to display its edit screen. Basically I need a folder like implementation for a model. I need to group and display all the entries. I googled for the same, but could not find any solution. Is this even possible in django? Please help.