Anyone kind enough to help me understand these few concepts

14 views
Skip to first unread message

DumbaClassics

unread,
May 16, 2019, 12:32:41 PM5/16/19
to Django users
I am still new on Django Web Framework and I want to understand the MVC concept based on this Project structure. Say I am trying to come up with an Online Gambling platform. Where exaclty do put the following;

1. say I want the player to randomly shuffle cards, is this whole business called on views.py or models or in models I just put a class related to creating my database?
2. say I want a player to have a ticket which is a receipt that can be picked randomly from those who have signed up for a draw. how exaclty do i have my clients get randomly generated receipts numbers using the random.randint module
3. Is there a possibility to generate a coin that is a local currency which enables players to buy them and then use the tokens for buying tickets into the game? If so how do i go about it in django python  

Test Bot

unread,
May 16, 2019, 12:51:52 PM5/16/19
to django...@googlegroups.com
Hi

In models you have to define your database tables as class and any response to the user should be handled in views.py

You can introduce randomness via random module or for any customisation you can write it as a different app altogether.

You can create your coin as a separate model and attach it as a relation to your players model, for payment you can use any payment gateway.


--
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...@googlegroups.com.
To post to this group, send email to django...@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/6658851f-f32c-42d4-bb04-7e00c0715a97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joel Mathew

unread,
May 16, 2019, 12:53:17 PM5/16/19
to Django ML
I would suggest you go through the official tutorial. Your questions don't have relation to django. It seems you're still at the concept/algorithm level of your app. 

In django, you put all your logic in your views, retrieve data from models into views, and then pass the data from views to templates which display the data.
Sincerely yours,

 Joel G Mathew



--
Reply all
Reply to author
Forward
0 new messages