Python Django: How Users Can Follow Tags - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Python 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:He should rather use ORM, read more on django docs |
Nairaland Should Switch To Python/django. Opinion • Which One Is Better: Python Django Or Php? • Learn How To Create Websites With Python(Django Web Framework) • 2 • 3 • 4
Java Programming Paid Internship • OOP Is Causing Some Problems, I Need Help • Anticipating: Nigeria Blogger Seminar In Mainland Lagos