₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,440 members, 8,422,047 topics. Date: Sunday, 07 June 2026 at 03:19 PM

Toggle theme

Python Django: How Users Can Follow Tags - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPython Django: How Users Can Follow Tags (935 Views)

1 Reply

Python Django: How Users Can Follow Tags by FuckYou(op): 2:31pm On Jun 07, 2019
Pls.. who knows how I can create a blog where users can follow a tag and gets Topics only on those tags.
I have intermediate experience in Python Django, but I dont know how to go about creating a blog where users can follow a tag and gets Topics on those tags they are following..
Can someone walk me through
Re: Python Django: How Users Can Follow Tags by resosdigital(m): 2:45pm On Jun 07, 2019
Eont use django much but guess I will tell u how I would implement in laravel.

You need a many to many relationship between tags and users.

For this you need 3 tables: users, tags, and tag_subscriptions

Users and tags table must have a primary id to identify each record.

The scheme for the tag_subscriptions table will contain just two columns
user_id and tag_id.

How it works.

Let's say when user with id 3 wants to subscribe to tag with id 5, you insert a new record into tag_subscriptions with the appropriate ids for user and tag.

When you need to retrieve all the subscribed tags for say user with id 4. You would query the tag_subscriptions table for all records with user_id 4, then you can get the tag_ids and the tags.

I am sure you should be able to figure out how to implement in django
Re: Python Django: How Users Can Follow Tags by Badilstical(m): 3:07pm On Jun 07, 2019
resosdigital:
Eont use django much but guess I will tell u how I would implement in laravel.

You need a many to many relationship between tags and users.

For this you need 3 tables: users, tags, and tag_subscriptions

Users and tags table must have a primary id to identify each record.

The scheme for the tag_subscriptions table will contain just two columns
user_id and tag_id.

How it works.

Let's say when user with id 3 wants to subscribe to tag with id 5, you insert a new record into tag_subscriptions with the appropriate ids for user and tag.

When you need to retrieve all the subscribed tags for say user with id 4. You would query the tag_subscriptions table for all records with user_id 4, then you can get the tag_ids and the tags.

I am sure you should be able to figure out how to implement in django
He should rather use ORM, read more on django docs
1 Reply

Nairaland Should Switch To Python/django. OpinionWhich One Is Better: Python Django Or Php?Learn How To Create Websites With Python(Django Web Framework)234

Java Programming Paid InternshipOOP Is Causing Some Problems, I Need HelpAnticipating: Nigeria Blogger Seminar In Mainland Lagos