Re: Migrating custom mysql application to django orm

2016-10-30 Thread Avraham Serour
SearchableText.objects.filter(searchterm__term__in=('is',
'another')).order_by('searchterm__term')

is this what you need?


On Sat, Oct 29, 2016 at 7:03 PM, Yaşar Arabacı  wrote:

> Hi,
>
> I am trying to migrate my mysql application into django orm. I need help
> converting my sql statements into it. Here are my models
>
> class SearchableText(models.Model):
> searchable_text = models.TextField()
> class SearchTerm(models.Model):
> searchabletext = models.ForeignKey(SearchableText, 
> on_delete=models.CASCADE)
> term = models.CharField(max_length=100)
>
>
> This is basically a table to store some textual information, and another
> table to use as index of searchable terms.
>
> Consider it like this
>
> SearchableText
> id   searchable_text
> 1"this is text"
> 2"this is another text"
>
> SearchTerm
> id  searchable_text term
> 1   1this
> 2   1is
> 3   1text
> 4   2this
> 5   2is
> 6   2another
> 7   2text
>
> I would normally do a sql query like this;
>
> Select SearchableText.*
> Right Join SearchTerm on SearchTerm.searchable_text = SearchableText.id
> Where term in ("is","another")
> group by SearchTerm.searchable_text ORDER BY COUNT(SearchTerm.term ) DESC
> LIMIT
>
> Right now, I don't even know where to start writing a complex sql like
> this using django-orm so any help is appreciated.
>
> --
> 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/c6481fa3-1d35-4957-b70e-3d9912715546%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/CAFWa6tLyTgXJz%2BuYYooAZi0okdG5%2BZ211L9DSk5_S9DA3T87zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How will I Run the Django Project (https://github.com/django/django) in my laptop ?

2016-10-30 Thread Srinivasulu Reddy
Hi Guys,

How will i contribute to the django 
project(https://github.com/django/django) ? I'm trying to install the 
django project local laptop. I'm unable to run the project. I changed the 
project name `{{ project_name }}.settings` in 
django/conf/project_template/project_name/ and run the server (runserver). 
I'm not able to find the other apps. How will i contribute to the tickets 
`https://code.djangoproject.com/query?status=!closed&easy=1&stage=Accepted&order=priority`.

-- 
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/6738a4a5-f650-406e-bc67-d0f42043f8ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How will I Run the Django Project (https://github.com/django/django) in my laptop ?

2016-10-30 Thread James Bennett
To install and run Django, I recommend reading through the official Django
tutorial, which explains how to install Django and create a project you can
work with and run:

https://docs.djangoproject.com/en/1.10/intro/

Additionally, there is documentation on how to contribute to Django, which
is useful to read:

https://docs.djangoproject.com/en/1.10/internals/contributing/


On Sun, Oct 30, 2016 at 4:20 AM, Srinivasulu Reddy <
srinivasulur5...@gmail.com> wrote:

> Hi Guys,
>
> How will i contribute to the django project(https://github.com/
> django/django) ? I'm trying to install the django project local laptop.
> I'm unable to run the project. I changed the project name `{{ project_name
> }}.settings` in django/conf/project_template/project_name/ and run the
> server (runserver). I'm not able to find the other apps. How will i
> contribute to the tickets `https://code.djangoproject.
> com/query?status=!closed&easy=1&stage=Accepted&order=priority`
> 
> .
>
> --
> 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/6738a4a5-f650-406e-bc67-d0f42043f8ea%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/CAL13Cg9oafzNUJQ9sDHnt0oPf-HOCcv_9v74KwwFMkc5YMDfsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrating custom mysql application to django orm

2016-10-30 Thread pradam programming
hi Yasar,
create_dic_of_searchterm = {'searchabletext_id':1,'term':'this'}

SearchTerm.objects.create(**create_dic_of_searchterm)

you can do like above



On Sat, Oct 29, 2016 at 9:33 PM, Yaşar Arabacı  wrote:

> Hi,
>
> I am trying to migrate my mysql application into django orm. I need help
> converting my sql statements into it. Here are my models
>
> class SearchableText(models.Model):
> searchable_text = models.TextField()
> class SearchTerm(models.Model):
> searchabletext = models.ForeignKey(SearchableText, 
> on_delete=models.CASCADE)
> term = models.CharField(max_length=100)
>
>
> This is basically a table to store some textual information, and another
> table to use as index of searchable terms.
>
> Consider it like this
>
> SearchableText
> id   searchable_text
> 1"this is text"
> 2"this is another text"
>
> SearchTerm
> id  searchable_text term
> 1   1this
> 2   1is
> 3   1text
> 4   2this
> 5   2is
> 6   2another
> 7   2text
>
> I would normally do a sql query like this;
>
> Select SearchableText.*
> Right Join SearchTerm on SearchTerm.searchable_text = SearchableText.id
> Where term in ("is","another")
> group by SearchTerm.searchable_text ORDER BY COUNT(SearchTerm.term ) DESC
> LIMIT
>
> Right now, I don't even know where to start writing a complex sql like
> this using django-orm so any help is appreciated.
>
> --
> 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/c6481fa3-1d35-4957-b70e-3d9912715546%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/CAGGVXBOcXH_nrg_oGUnjdUU4Xy%3DipJOXSjZ9xxoUkXm0HNBJTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: WOrking with checkbox Multiple Select FIeld - Django Admin

2016-10-30 Thread pradam programming
try to to get all the checked objects using getlist from request store it
in a textfield.this is better when you have 20 check boxes then code become
too complex and messy

On Sun, Oct 30, 2016 at 10:55 AM, M Hashmi  wrote:

> Form ModelForm if you need to check a single field then you set it as
> BooleanField in your models.py but if you need to use kind of condition
> that requires multiple checkboxes to be True. Then its better to define
> condition in your view like
>
> models.py
> a = models.BooleanField(default=False)
> b = models.BooleanField(default=False)
> c = models.BooleanField(default=False)
>
> Views.py
> if a and b == True
> return "correct".
>
> Makes sense?
>
> Regards,
> Mudassar
>
> On Sat, Oct 29, 2016 at 3:43 PM, Bernardo Garcia 
> wrote:
>
>> HI, friends.
>>
>> Someone know how to work with a field that allow perform a multiple
>> selection in a field?, like a checkbox. In django admin,
>>
>> 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/ms
>> gid/django-users/670c3379-cea2-4819-91e8-5fbe804d1c88%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/CANoUts7E%2BTPngOpz4D6YBdsK9j5XopXNpmR-
> zEzZLe%2BJ8zrZjw%40mail.gmail.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/CAGGVXBO2Qn6DVHR-zf5Xca1TvUT%2BhkaqOU3qxBmD8PD_yNrgPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Redirect after Form

2016-10-30 Thread Stanislav Vasko
Greetings,

trying to create new app with simple Form to create and update Company 
info. My view looks like:

def company_new(request):
if request.method == "POST":
form = CompanyForm(request.POST)
if form.is_valid():
company = form.save(commit=False)
company.save()
return redirect('views.company_detail', pk=company.pk)
else:
form = CompanyForm()
return render(request, 'crm/company_edit.html', {'form': form})


with urls.py:


app_name = 'crm'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^index_previous', views.index_previous, name='index_previous'),
url(r'^report_money', views.report_money, name='report_money'),
url(r'^report_works', views.report_works, name='report_works'),
url(r'^company/(?P[0-9]+)/$', views.company_detail, 
name='company_detail'),
url(r'^work/(?P[0-9]+)/$', views.work_detail, name='work_detail'),
url(r'^company/new/$', views.company_new, name='company_new'),
url(r'^company/edit/(?P[0-9]+)/$', views.company_edit, 
name='company_edit'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)



But when i save my new company, i get info: 

Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/company/new/views.company_detail


So Django takes whole URL + my redirect. Is it possible to force to use my 
urls.py? I found something like "return HttpResponseRedirect('/')", but 
it's strange solution. Another way is to point to exact path, but i don't 
like too, i'd like to use urls.py to redirect.

Thanks for tips, i hope it's some simple trick or import i'm missing.

-- 
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/24f7f6b7-2b9a-452f-9d15-325e1e467793%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How will I Run the Django Project (https://github.com/django/django) in my laptop ?

2016-10-30 Thread Srinivasulu Reddy


On Sunday, October 30, 2016 at 4:50:18 PM UTC+5:30, Srinivasulu Reddy wrote:
>
> Hi Guys,
>
> How will i contribute to the django project(
> https://github.com/django/django) ? I'm trying to install the django 
> project local laptop. I'm unable to run the project. I changed the project 
> name `{{ project_name }}.settings` in 
> django/conf/project_template/project_name/ and run the server (runserver). 
> I'm not able to find the other apps. How will i contribute to the tickets `
> https://code.djangoproject.com/query?status=!closed&easy=1&stage=Accepted&order=priority`
>  
> 
> .
>

-- 
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/c17cfc7b-feb6-4feb-95a4-f7a7a31f7cbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How will I Run the Django Project (https://github.com/django/django) in my laptop ?

2016-10-30 Thread Srinivasulu Reddy
I'm talking about the Django install in github project. Not talking about 
using django how to create the project. I'm an member in all the groups. 
How will i contribute the coding part of django. How will i assign tickets 
to myself ?. How will i run the github django project ? To support the 
django community.

On Sunday, October 30, 2016 at 5:50:30 PM UTC+5:30, James Bennett wrote:
>
> To install and run Django, I recommend reading through the official Django 
> tutorial, which explains how to install Django and create a project you can 
> work with and run:
>
> https://docs.djangoproject.com/en/1.10/intro/
>
> Additionally, there is documentation on how to contribute to Django, which 
> is useful to read:
>
> https://docs.djangoproject.com/en/1.10/internals/contributing/
>
>
> On Sun, Oct 30, 2016 at 4:20 AM, Srinivasulu Reddy  > wrote:
>
>> Hi Guys,
>>
>> How will i contribute to the django project(
>> https://github.com/django/django) ? I'm trying to install the django 
>> project local laptop. I'm unable to run the project. I changed the project 
>> name `{{ project_name }}.settings` in 
>> django/conf/project_template/project_name/ and run the server (runserver). 
>> I'm not able to find the other apps. How will i contribute to the tickets `
>> https://code.djangoproject.com/query?status=!closed&easy=1&stage=Accepted&order=priority`
>>  
>> 
>> .
>>
>> -- 
>> 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/6738a4a5-f650-406e-bc67-d0f42043f8ea%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/b1d078c0-ca9e-4519-9bcd-fce3a3d30a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How will I Run the Django Project (https://github.com/django/django) in my laptop ?

2016-10-30 Thread James Bennett
Django by itself does not "run" or do anything. Django only does something
when provided with settings and applications. If all you want is to run the
test suite, to verify that a change you made to Django itself did
something, you can do that by following the instructions in the
documentation.

On Sun, Oct 30, 2016 at 6:10 AM, Srinivasulu Reddy <
srinivasulur5...@gmail.com> wrote:

> I'm talking about the Django install in github project. Not talking about
> using django how to create the project. I'm an member in all the groups.
> How will i contribute the coding part of django. How will i assign tickets
> to myself ?. How will i run the github django project ? To support the
> django community.
>
> On Sunday, October 30, 2016 at 5:50:30 PM UTC+5:30, James Bennett wrote:
>>
>> To install and run Django, I recommend reading through the official
>> Django tutorial, which explains how to install Django and create a project
>> you can work with and run:
>>
>> https://docs.djangoproject.com/en/1.10/intro/
>>
>> Additionally, there is documentation on how to contribute to Django,
>> which is useful to read:
>>
>> https://docs.djangoproject.com/en/1.10/internals/contributing/
>>
>>
>> On Sun, Oct 30, 2016 at 4:20 AM, Srinivasulu Reddy > > wrote:
>>
>>> Hi Guys,
>>>
>>> How will i contribute to the django project(https://github.com/dja
>>> ngo/django) ? I'm trying to install the django project local laptop.
>>> I'm unable to run the project. I changed the project name `{{ project_name
>>> }}.settings` in django/conf/project_template/project_name/ and run the
>>> server (runserver). I'm not able to find the other apps. How will i
>>> contribute to the tickets `https://code.djangoproject.co
>>> m/query?status=!closed&easy=1&stage=Accepted&order=priority`
>>> 
>>> .
>>>
>>> --
>>> 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/ms
>>> gid/django-users/6738a4a5-f650-406e-bc67-d0f42043f8ea%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/b1d078c0-ca9e-4519-9bcd-fce3a3d30a66%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/CAL13Cg9KnZ0ntw3MZA2737D5vhF_uKM%2B%3DeBhoXa02boQfqG8aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect after Form

2016-10-30 Thread Moreplavec
I found in Django Tutorial solution: 
https://docs.djangoproject.com/en/1.10/intro/tutorial04/ :

Now i have: 

return HttpResponseRedirect(reverse('crm:company_detail', args=(company.pk,)))
#return redirect('views.company_detail', pk=company.pk)


And it works fine!

-- 
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/020ebfa1-2bd0-4cba-91bc-5797dee25e5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help with a hostel management system project using django

2016-10-30 Thread YOGITHA A N
I am beginner in django please help me out with my project

-- 
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/35fed150-9a4e-4ba9-a81b-1a5301119f7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-30 Thread YOGITHA A N
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/msgid/django-users/22ce8644-2a9d-430c-a565-39ab94664d88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with a hostel management system project using django

2016-10-30 Thread Bob Gailer
On Oct 30, 2016 9:53 AM, "YOGITHA A N"  wrote:
>
> I am beginner in django please help me out with my project
To help us help you be more specific. What kind of help do you need?
>
> --
> 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/35fed150-9a4e-4ba9-a81b-1a5301119f7f%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/CAP1rxO5GPt155WmMB8NUO7fbwz7%3DP%2Brq0NaEbLJsQ7UXeUjqtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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
>> 
>> .
>> 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: Need help with a hostel management system project using django

2016-10-30 Thread YOGITHA A N
I need to create 3 kinds of users with 3 different permissions. One being 
that of the student , mess contractor and hostel warden.
How do I create 3 differnt kinds of login and user profiles.

On Sunday, October 30, 2016 at 7:39:56 PM UTC+5:30, bob gailer wrote:
>
> On Oct 30, 2016 9:53 AM, "YOGITHA A N" > 
> wrote:
> >
> > I am beginner in django please help me out with my project
> To help us help you be more specific. What kind of help do you need?
> >
> > -- 
> > 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/35fed150-9a4e-4ba9-a81b-1a5301119f7f%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/b3f43cf2-6692-4cdd-8ec3-130b6552893d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-30 Thread ADEWALE ADISA
You can start by designing your warden and student models in which each of
them inherit the django inbuilt user model class.
Each model would then have attribute that is peculiar to it alone.
On Oct 30, 2016 2:53 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/
> msgid/django-users/22ce8644-2a9d-430c-a565-39ab94664d88%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/CAMGzuy8%2BEMTJBo76UZjQwNdbDJ%3DN4aA07SBCUEcRva9L66L3Cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-30 Thread Derek
You'll probably need jQuery. Bear in mind "size" is not absolute as it will 
depend on font family and font height.

On Sunday, 30 October 2016 01:27:59 UTC+2, Ken Albright wrote:
>
> Sounds good. Thanks for the advice. Now if I could only figure out how to 
> get forms to expand and contract to match the size of the quote...
>
> Thanks.
>
> On Friday, October 28, 2016 at 5:00:14 PM UTC-7, Ken Albright wrote:
>>
>> I'm just learning Python and Django so please be gentle...
>>
>> I've written a quote decryption game (like you see in the newspaper) in 
>> Python. I'd like to put it on a web page with Django. However, I'm not sure 
>> of the best way to structure the data. The original quote and the encrypted 
>> quote need to have a one-to-one relationship at the letter level. So it 
>> could be two strings on the same row (same id) or a set of tuples, a 
>> dictionary, or ???
>>
>> How to set up the database and models.py?
>>
>> 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/600aea7e-54fc-4856-9c71-fc56469d3712%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-30 Thread ali Eblice
thanks for reply
 i setup the x-sendfile but there's a problem :

django return a x-sendfile response successfully but since i'm using django 
development area and the development area runs on port 8000 the return 
response will be on port 8000 but the apache web server runs on port 80 so 
the response wont go to apache  so it cause me to download the file with 0 
byte size 

how can i solve this problem ?

On Friday, October 28, 2016 at 6:29:53 PM UTC+3:30, ali Eblice wrote:
>
> hello
> think of a downloading website:
> when we create a temporary link in django and map it to actual URL or file 
> path in database like this:
>
> id -- temporary_URL -- origin_URL  --  file_path
>
> so when a user used a temporary URL and directed to some view , how should 
> i return that file from that view for user to be able to download that file?
> i know that i can use "FileResponse"  or  "StreamingHttpResponse" but in 
> django documentation says that we should use these for short-lived requests 
> but downloading a big file can take long time, so what should i do ?
> i appreciate any help and idea 
>

-- 
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/9d0fc69a-ca82-4b2f-81ce-82ba58afdf92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using django pagination or slicing

2016-10-30 Thread ADEWALE ADISA
Hello,
Please I need an advice on the best approach to take on the following
issues.
I have a database table consist of about 1000 record. I need to be
displaying like 20 records at a time on a page such that when the user
scroll the browser another batches will be append to the browser.
Below are the 3 ways am aiming to achieve this:

1. Using django pagination feature.

2. Everytime records need to be appended to the browser , an ajax call is
made to the view, then the queryset is slice using appropriate lower and
upper band. Then the returned record is appended to the browser.

3. Fetch the whole records from the database and transfer everything to the
browser, then JavaScript is now use to slice and be appending as needed.

NOTE: The webpage would work like yahoo.com mobile site.
Please with approach is the best in term of performance and speed.

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/CAMGzuy8cK7ueHGPwuCjbrV-SdfZwkYYhg7_t7-Dmmt%3D6g787YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with a hostel management system project using django

2016-10-30 Thread mulianto
Hi,

You can create 3 groups and put each user to specific group. Set the permission 
on the group an all te group member will have the specified permission for 
Create, Read, Update, Delete.

Mulianto

Sent from my iPhone

On 30 Okt 2016, at 22:37, YOGITHA A N  wrote:

> I need to create 3 kinds of users with 3 different permissions. One being 
> that of the student , mess contractor and hostel warden.
> How do I create 3 differnt kinds of login and user profiles.
> 
> On Sunday, October 30, 2016 at 7:39:56 PM UTC+5:30, bob gailer wrote:
>> 
>> On Oct 30, 2016 9:53 AM, "YOGITHA A N"  wrote:
>> >
>> > I am beginner in django please help me out with my project
>> To help us help you be more specific. What kind of help do you need?
>> >
>> > -- 
>> > 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/35fed150-9a4e-4ba9-a81b-1a5301119f7f%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/b3f43cf2-6692-4cdd-8ec3-130b6552893d%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/39DE8D04-F5BF-4ED4-A0B0-A65480A99729%40gmail.com.
For more options, visit https://groups.google.com/d/optout.