filter in admin

hello everyone,

i have a quite simple project which i want to develop. i got my feet wet by working through tutorials and some docs and have some models going, but now came across a roadblock.

it is nessessary that teachers are separate from other teachers and exercises. this means that when a teacher is in the admin he should only see (and be able to crud) exercises and students he created.
so first of all is that generally possible?

right now i got the basic functionality down (teacher role being able to create students and exercises), but not the separation.

i have more questions (a lot), but need to know if this key-feature implementable before continuing.

thanks for any input!

td

Yes, it is possible

You can implement almost anything, it depends on your code flow and logic that you build :v:

1 Like

Yes, but the question you should be asking yourself is “Is this the approach I should be taking?”

My answer to that question would be “No”.

I will point out what the Django docs say about situations like this:

The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around.

and

If you need to provide a more process-centric interface that abstracts away the implementation details of database tables and fields, then it’s probably time to write your own views.

I’ve seen numerous examples of cases where people have started with using the admin - but keep laying more and more functionality on top of it until they’ve taken it to the point where it’s creating a lot more work for them than if they had just started from their own views.

Creating a basic set of BREAD views (Browse, Read, Edit, Add, Delete) is very easy using the Django-provided generic views, and it gives you a base for future enhancements.

hello ken,

Yes, but the question you should be asking yourself is “Is this the approach I should be taking?”

My answer to that question would be “No”.

so if i understand correctly i should leave the admin area alone and build sort of a custom admin area for the teachers? if so: hallelujah!:slight_smile: challenge accepted…

I’ve seen numerous examples of cases where people have started with using the admin - but keep laying more and more functionality on top of it until they’ve taken it to the point where it’s creating a lot more work for them than if they had just started from their own views.

i see. but consider just for a second again i think my project is rather simple. separate the teachers, create exercises, assign them to students and display on frontpage. basically a task list i guess.

Creating a basic set of BREAD views (Browse, Read, Edit, Add, Delete) is very easy using the Django-provided generic views, and it gives you a base for future enhancements.

… if done in a sound manner code-wise. but i see your point. i think if i was a real developer i could write that pretty quickly. but right now, i would like to avoid creating too much own code.:slight_smile:

i actually tried to develope (i’m not a developer) this project already with a different framework, but it ended when i couldnt have teachers manage their items separately. that was a real pity, i put lots of hours in it.

so, ken, thanks for your advice! i will have to think about if i open that bottle of writing a custom teacher backend. although i would be very proud if i should manage to pull that off!

tnx
td

I’d just like to point out that if you completed the official Django tutorial, you’ve learned enough to do this. It really is that easy.

1 Like

allright! firing up the coffemachine right now! :sunglasses:

td

1 Like

expect to be able log into the ready application at dawn!

(not saying which day)