Re: Django How to write Customized Query ( Display Information Departmentwise)

2019-04-23 Thread Gourav Chawla
making necessary changes > in schema) > > > > On Sun, Apr 21, 2019 at 11:00 AM Gourav Chawla < > gauravchawla.chawla...@gmail.com> wrote: > >> First of all, use appropriate model fields for linking objects. For >> example users should be a foreign key to your(or Django's) us

Django How to write Customized Query ( Display Information Departmentwise)

2019-04-20 Thread Gourav Chawla
First of all, use appropriate model fields for linking objects. For example users should be a foreign key to your(or Django's) user table. Then whenever you want to show data on any interface to any user, just filter content/rows by user department. Something like:

Re: How do I pass the CSRF token when using a jQuery post

2017-11-08 Thread Gourav Chawla
See, if this helps: https://stackoverflow.com/questions/8614947/jquery-and-django-csrf-token On Tuesday, November 7, 2017 at 10:25:47 PM UTC+5:30, Tony King wrote: > > > Hi, > > I thought I'd finally understood this but it seems I have not and I've > spent far too much time trying to do it

Creating login page with Django using HTML and CSS

2017-10-09 Thread Gourav Chawla
It isn't clear what are you looking for but if you need instructions on creating registration, login, logout views then this[1] is a good place to start. Also, look into another chapter where the author talks about using django-registration package to remove the hassle of building your own

Re: Access data associated to a primary key

2017-10-03 Thread Gourav Chawla
Glad, you worked it out. You can use them whenever you want. Function based views require you to write more code but give you more clarity on what's happening. On the other hand CBV help you keep the codebase cleaner. At the end of the day, it's you who has to decide what to use. -- You

Re: Access data associated to a primary key

2017-10-02 Thread Gourav Chawla
You can create another url, view, template to do that. Just create a url like : team/id For the above url create a view, say, teams_under_region which accepts the 'id'. Based on that id you can then query your database for teams where region_member=id. This is just the approach you would

Re: Login with different groups

2017-10-02 Thread Gourav Chawla
You can have a look at Django registrations app[1] for inspiration. Also, look at the default Django admin login. All of it is there, you just have to search a little more and you'll get it. [1]: https://github.com/macropin/django-registration On Monday, October 2, 2017 at 4:55:14 PM UTC+5:30,

Re: online training application

2017-09-30 Thread Gourav Chawla
On Thursday, September 28, 2017 at 11:02:58 AM UTC+5:30, Mike Dewhirst wrote: > > I need to write an online training application - except I don't know a > lot about online training. > Please, have a look at OpenEdx[1]. It is also a LMS like Moodle written using Django. [1]: