Re: how to create 2 different kind of user profiles using django python

2016-10-30 Thread Amandeep Singh
Hi
If student and warden have similar attributes and only differ in permission
level than you could use the same User model for both of them and to
provide different access levels by creating two different authorization
groups for student and warden.
https://docs.djangoproject.com/en/1.10/topics/auth/
default/#topic-authorization

On Sun, Oct 30, 2016 at 7:59 PM, Amandeep Singh 
wrote:

> Hi
> If student and warden have similar attributes and only differ in
> permission level than you could use the same User model for both of them
> and to provide different access levels by creating two different
> authorization groups for student and warden.
> https://docs.djangoproject.com/en/1.10/topics/auth/
> default/#topic-authorization
>
> On Sun, Oct 30, 2016 at 7:18 PM, YOGITHA A N 
> wrote:
>
>> Hey,
>>
>> I am new to django . Please let me know how to create 2 various kind of
>> user profiles in django. I am doing a hostel management system using django
>> where in I have 2 kinds of users one is a student and the other is the
>> warden.
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@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/ms
>> gid/django-users/22ce8644-2a9d-430c-a565-39ab94664d88%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/22ce8644-2a9d-430c-a565-39ab94664d88%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAMi_2%3DFipXyvWwj%2BDOTr_Ac67mSRcpLZMSOEyZZGu0QfYkve_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django invoice generation system

2016-07-15 Thread Amandeep Singh
Firstly you could create a function that uses these to models and renders a
html  or csv  format invoice. Then you could mail this to yourself. Once
the function is created then you could create a scheduled cron job using
celery or a even simple way would be to use crontab linux command with
monthly interval.

On 14-Jul-2016 5:01 pm, "USMAN MALIK"  wrote:

> Hi. I'm new to django and i'm creating a buisness application for my
> company. i want to generate a monthly invoice for every member in my
> company and for this i have two models in which all the information is
> stored. Is there a way to generate an automatic invoice based on the
> information in these two models? kindly help me. thanks .
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/ab6fca84-0cc7-4789-9e62-9d02cba01f6b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAMi_2%3DEN6pfzhNoMn9MeYTUhCz50S6Z7UauVw8Y7ixxn5j2s%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Built a API with django rest framework how do i get a key for people or is it open to them

2016-04-11 Thread Amandeep Singh
Hi Robert

As for as API key is concerned it's mainly to track usage records for a key
which would be linked to a person/user entity and provide a layer to block
unwanted requests(stops requests at middleware before hitting the view).
This key could be sent in headers or as the query parameter.

But the choice of using a key is totally yours, if you are providing a
universal key then it's no good and if you  are providing key per user then
you could even think about using auth tokens for authorization and
authentication( benefit easy to integrate with rest-framework).

Amandeep

On Tue, Apr 12, 2016 at 8:22 AM, djangorobert 
wrote:

> Hello fellow django users I recently built a api for just a small sprint
> board where tasks can be set its built with django and django rest
> framework what i see though  is most apis have like a key that others can
> use do i have to offer api keys or is mine able just able to be free thats
> where im confused.
>
> Mainly for others to use an api do i have to offer a key
> or is it ok to just let them go to the site and use it thanks
> please be patientim new with apis
>
>
> thanks Robert
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/0c239c3d-bf92-4e7f-a101-0b1b562d7a40%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAMi_2%3DFx4MCxF5sRaHZdqJYVymXS8hB_6gbY0cxuPfi-SNQMsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django models choices

2016-03-21 Thread Amandeep Singh
The choices don't enforce any default validation. But if you are populating
the data from a http call then use ModelForm they show the invalid_choice
error message on entering value other than defined choices

On Mon, Mar 21, 2016 at 1:59 PM, Amine Yaiche  wrote:

> Hi everyone,
>
> Given a field in a model that uses choices:
>
> CHOICES = (
> (0, "choice_0"),
> (1, "choice_1")
> )
>
> foo = models.IntegerField(choices=CHOICES)
>
>
> If i put a value other than 0 or 1, django will accept it. Is that
> possible that we instruct Django to accept only values that are mentioned
> in CHOICES without creating a validator function.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/78d84aa0-506f-4d5c-9590-ef6325c255e0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAMi_2%3DETuiuo%3D0xcz%3D3haWv5ayXpurpMazZP1rUsdEcLYxJ%3DJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.