Thank you in advance!

I am new to Django, trying to build a small app for my friend. The app 
mock-up is here  <http://ninjamock.com/s/CBK7S>

Basically, the app will include Units/Lessons with Subsection, each 
Subsection will end with several questions.

Here my models.py

from django.db import models


# Create your models here.
class Unit(models.Model):
    title = models.CharField(max_length=150, blank=True, null=True)
    unit_number = models.PositiveIntegerField(blank=True, null=True, 
default=1)

    def __str__(self):
        return self.title



class SubSection(models.Model):
    subsection_text = models.TextField(default='SUBSECTION TEXT')
    question = models.ForeignKey(Unit, 
related_name='subsection_to_question')


class Question(models.Model):
    question_text = models.CharField(max_length=2000, default='QUESTION 
TEXT')
    subsection = models.ForeignKey(SubSection, 
related_name='question_to_subsection',)

And here is my admin.py

from django.contrib import admin
from .models import Unit, SubSection


# Register your models here.
class SubSectionInline(admin.StackedInline):
    model = SubSection


@admin.register(Unit)
class UnitAdmin(admin.ModelAdmin):
    inlines = [
        SubSectionInline,
    ]

Here is what I see in the admin 

<https://lh3.googleusercontent.com/-i1LJ-pDrF5o/VxpQC-QYT8I/AAAAAAAAK6I/7vVttraHLMsQd8T4l2FtXnpMxr6-yOBngCLcB/s1600/units.JPG>
It is all nice, but it is not exactly what I want :-). Here is what I want 
to see, it is photoshop mock-up

<https://lh3.googleusercontent.com/-bZTrb_qBYE4/VxpUVPvSuDI/AAAAAAAAK6U/L1qsjkmka_s3oJU-beZBzvDQseAkVtSvQCLcB/s1600/mock-up-admin-unit.jpg>

My questions are:

Is this even possible to do with the approach I took?

If it is possible, can you please help me to figure out how to make it?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c623f00-aefe-4eea-8f74-85a781234002%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to