using extends more than once

2018-09-05 Thread Rootz
Can a child template have more than one parent template?
I am using the the latest release for Django and I have several template to 
include 
in the one template file. How can I do so using template inheritance (using 
the default django template api) ?

-- 
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/5110b6a9-6b53-4a7d-b235-34e967de4361%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Amazon S3 Storage

2015-07-17 Thread Rootz
Thanks. However is there a similar Django-package for the Google Drive API?

On Thursday, July 16, 2015 at 10:22:32 PM UTC-5, Bill Blanchard wrote:
>
> I've used this with success in the past:
>
> https://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html
>
> On Thu, Jul 16, 2015 at 10:22 PM, Rootz > 
> wrote:
>
>> Can you explain to me the easiest way to store uploaded image to a Django 
>> Project using Amazon S3 for all my uploads to the project? 
>>
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c35bb4fa-88ab-4ff3-b5eb-f1db054f7adc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c35bb4fa-88ab-4ff3-b5eb-f1db054f7adc%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9656842b-4411-47b0-95bd-70795f512a79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Amazon S3 Storage

2015-07-16 Thread Rootz
Can you explain to me the easiest way to store uploaded image to a Django 
Project using Amazon S3 for all my uploads to the project? 

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c35bb4fa-88ab-4ff3-b5eb-f1db054f7adc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using multiple form in Class Base View (CBV)

2015-04-08 Thread Rootz
Can anyway give me advice as to how I would implement a CBV like formview 
to incorporate multiple forms in the class base view?

I have (2) form class I would like for my FormView to use? But I am not 
sure how to do that with the FormView or any class base view.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9917bb5b-b55f-4ff4-a3e8-d03ab6278073%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using proxy kind of Table in Admin Interface

2015-03-03 Thread Rootz


On Tuesday, March 3, 2015 at 12:26:05 AM UTC-5, Simon Charette wrote:
>
> Hi Rootz,
>
> Unfortunately there's a long standing ticket to solve inconsistency with 
> permissions for proxy models  
> <https://code.djangoproject.com/ticket/11154>so your chosen approach 
> won't work until this is fixed.
>
> Simon
>
> Le lundi 2 mars 2015 11:16:36 UTC-5, Rootz a écrit :
>>
>> Question.
>> How would one go about designing the django table(s) so that I can assign 
>> each user account/group a different Model Manager using the same table in 
>> the Django admin interface? 
>>
>> After doing some reading the closest that comes to this is the Proxy 
>> Model but I tried adding the proxy model manually into the django admin and 
>> I got it to work. However when I try to assign permission to each user 
>> account for the different proxy models I had created I am only  see only 
>> one proxy model in the permission list (django admin interface).
>>
>> My goal is to create one table that returns a custom QuerySet unique to a 
>> user group or user account. Adding to this I would like for this to be 
>> visible in the admin interface. Can you guide me as to how can achieve this.
>>
>> thank you 
>>
>

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23ea5632-be06-4811-b131-fe49776acbcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using proxy kind of Table in Admin Interface

2015-03-02 Thread Rootz
Ok below is a sample of the models.py


class LocationProfile(models.Model):
shortName = models.CharField('Location Name',max_length=100,primary_key 
= True)
longName = models.CharField('Church Name',max_length=100)
.

class Member(models.Model):
first = models.CharField('First Name',max_length=150)
last =  models.CharField('Last Name',max_length=150)
.

###Meadowvale SDA
###Model Manager 
class MeadowvaleManager(models.Manager):
def get_queryset(self):
return super(MeadowvaleManager, self).get_queryset().filter(
churchLoc='meadow-sda')


###Model Proxy
class MeadowvaleMember(Member):
objects = MeadowvaleManager()

class Meta:
verbose_name = "MeadowMember"
proxy = True



Another SDA
###Model Manager
class AnotherManager(models.Manager):
def get_queryset(self):
return super(AnotherManager, self).get_queryset().filter(id=1)


###Model Proxy
class AnotherMember(Member):
objects = AnotherManager()

class Meta:
verbose_name = "AnotherMember"
proxy = True



below is a sample of the admin.py

from members.mymodels.models import MeadowvaleMember,AnotherMember
  
class MeadowvaleMemberAdmin(admin.ModelAdmin):
def get_query_set(self,request):
return MeadowvaleMember.objects.all()


class AnotherMemberAdmin(admin.ModelAdmin):
def get_query_set(self,request):
return AnotherMember.objects.all()

#proxy

admin.site.register(MeadowvaleMember,MeadowvaleMemberAdmin)
admin.site.register(AnotherMember,AnotherMemberAdmin)


On Monday, March 2, 2015 at 12:21:47 PM UTC-5, Derek wrote:
>
> I am not quite sure what you are trying to achieve (without seeing sample 
> code), but here is some very basic code showing how a proxy could work:
>
> models.py
>
> class MainModel(Model):
>"""mother of models"""
> ...
> 
>
> class MainModelProxy(MainModel):
> objects = MainModelProxyManager()
>
> class Meta:
> proxy = True
>
>
> admin.py
>
> class MainModelAdmin(ModelAdmin):
> """mother of all admin"""
> ...
>
>
> class MainModelProxyAdmin(MainModelAdmin):
> #add salt to taste
> 
>
> admin.site.register(MainModel, MainModelAdmin)
> admin.site.register(MainModelProxy, MainModelProxyAdmin)
>
>
> On Monday, 2 March 2015 18:16:36 UTC+2, Rootz wrote:
>>
>> Question.
>> How would one go about designing the django table(s) so that I can assign 
>> each user account/group a different Model Manager using the same table in 
>> the Django admin interface? 
>>
>> After doing some reading the closest that comes to this is the Proxy 
>> Model but I tried adding the proxy model manually into the django admin and 
>> I got it to work. However when I try to assign permission to each user 
>> account for the different proxy models I had created I am only  see only 
>> one proxy model in the permission list (django admin interface).
>>
>> My goal is to create one table that returns a custom QuerySet unique to a 
>> user group or user account. Adding to this I would like for this to be 
>> visible in the admin interface. Can you guide me as to how can achieve this.
>>
>> thank you 
>>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19bc578f-1704-4a58-a068-13b89139c859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using proxy kind of Table in Admin Interface

2015-03-02 Thread Rootz
Question.
How would one go about designing the django table(s) so that I can assign 
each user account/group a different Model Manager using the same table in 
the Django admin interface? 

After doing some reading the closest that comes to this is the Proxy Model 
but I tried adding the proxy model manually into the django admin and I got 
it to work. However when I try to assign permission to each user account 
for the different proxy models I had created I am only  see only one proxy 
model in the permission list (django admin interface).

My goal is to create one table that returns a custom QuerySet unique to a 
user group or user account. Adding to this I would like for this to be 
visible in the admin interface. Can you guide me as to how can achieve this.

thank you 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f24f7fc-4865-477d-83fe-bb9f98e23189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using proxy kind of Table in Admin Interface

2015-03-01 Thread Rootz
Question.
How would one go about designing the django table(s) so that I can assign 
each user account/group a different Model Manager using the same table in 
the Django admin interface? 

After doing some reading the closest that comes to this is the Proxy Model 
but I tried adding the proxy model manually into the django admin and got 
an error while loading it. 

My goal is to create one table that returns a custom QuerySet unique to a 
user group or user account. Adding to this I would like for this to be 
visible in the admin interface. Can you guide me as to how can achieve this.

thank you 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cd13f5ab-633e-4361-a621-cfc11d5d01a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Signals - request_finished

2015-02-26 Thread Rootz
thanks it worked

On Thursday, February 26, 2015 at 5:54:02 AM UTC-5, Rodrigo Zayit wrote:
>
> put on your __init__.py file:
>
> from signals import request_finished_callback
>
> I guess it'll work.
>
>
> Atenciosamente,
> Rodrigo de Oliveira
>
> On Wed, Feb 25, 2015 at 6:21 PM, Rootz > 
> wrote:
>
>> Still not working
>>
>>
>> On Wednesday, February 25, 2015 at 12:55:29 PM UTC-5, Rodrigo Zayit wrote:
>>>
>>> If it is being loaded and it is not working, try to do by this way:
>>>
>>> from django.core.signals import request_finished
>>> from django.dispatch import receiver
>>>
>>> @receiver(request_finished)
>>> def request_finished_callback(sender, **kwargs):
>>> # . . .
>>>
>>> On Wednesday, 25 February 2015 14:01:24 UTC-3, Rootz wrote:
>>>>
>>>> I have tried using the request_finished signal but nothing happens when 
>>>> I tried testing it.
>>>> What suggestions or recommendations can I do to help fix the problem?
>>>>
>>>> Thank you.
>>>>
>>>>
>>>> Below is a sample of the signals.py file (sample is taken from 
>>>> djangoproject.com )
>>>>
>>>> ###SIGNALS.PY
>>>>
>>>>
>>>> from django.core.signals import request_finished
>>>>
>>>>
>>>> def my_callback(sender, **kwargs):
>>>> print("request finished")
>>>> 
>>>> request_finished.connect(my_callback)
>>>>
>>>>
>>>>
>>>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e2287639-0b90-4e27-9766-bf4bd356fadd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/e2287639-0b90-4e27-9766-bf4bd356fadd%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ed079f0-581c-4464-ac09-768e01500523%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MySQLdb Missing Module errors

2015-02-25 Thread Rootz
I recently installed the django framework ( v1.7.4 ) and the mysql database 
connector ( pymysql ) for python. It is my understanding that the MySQLdb 
python connector is depreciated and is no longer available for download 
through PIP . However I installed pymysql which is an alternate download 
for MySQLdb connector for python. The connector (pysql) works with the 
MySQL database installed but my current django installation does not work 
because I recieve errors about missing MySQLdb module.

However despite the setback trying to use the MySQLdb package I was able to 
make changes to the installed django package ( 
django/db/backends/mysql/base.py ) that
help to make my django projects functional and error free now. 

I hope this will help those in the Django community, whom are affected by 
the same errors that I was recieving.

Thanks

Below I have outlined some of the changes I made to my django package are 
as follows:

Updates made in base.py (The base.py is locate in the django package)
Path to base.py inside the django package ( django/db/backends/mysql/ )
import pymysql as Database#MySQLdb as Database



from pymysql.converters import conversions, Thing2Literal
from pymysql.constants import FIELD_TYPE, CLIENT


### line 30 - 31 replaced MySQLdb for pymysql
### line 15 replaced MySQLdb for pymysql


#from MySQLdb.converters import conversions, Thing2Literal
#from MySQLdb.constants import FIELD_TYPE, CLIENT




Below is a snippet installing MySQLdb connector using PIP

C:\Users\root\Documents\GitHub\djangoproject-tutorial\tutorial> pip install 
mysqldb
Downloading/unpacking mySQLdb
  Could not find any downloads that satisfy the requirement mySQLdb
Cleaning up...
No distributions at all found for mySQLdb
Storing debug log for failure in C:\Users\root\pip\pip.log
C:\Users\root\Documents\GitHub\djangoproject-tutorial\tutorial>


Below is a snippet of the Django-1.7.4 interacting with the pymysql 
connector

File 
"C:\Users\root\Documents\GitHub\djangoproject-tutorial\tutorial\lib\site-packages\django\db\backends\mysql\base.py"
, line 18, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: 
No module named 'MySQLdb'


-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aac9808f-ca9f-4b57-96f4-086704267761%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Signals - request_finished

2015-02-25 Thread Rootz
Still not working

On Wednesday, February 25, 2015 at 12:55:29 PM UTC-5, Rodrigo Zayit wrote:
>
> If it is being loaded and it is not working, try to do by this way:
>
> from django.core.signals import request_finished
> from django.dispatch import receiver
>
> @receiver(request_finished)
> def request_finished_callback(sender, **kwargs):
> # . . .
>
> On Wednesday, 25 February 2015 14:01:24 UTC-3, Rootz wrote:
>>
>> I have tried using the request_finished signal but nothing happens when I 
>> tried testing it.
>> What suggestions or recommendations can I do to help fix the problem?
>>
>> Thank you.
>>
>>
>> Below is a sample of the signals.py file (sample is taken from 
>> djangoproject.com )
>>
>> ###SIGNALS.PY
>>
>>
>> from django.core.signals import request_finished
>>
>>
>> def my_callback(sender, **kwargs):
>> print("request finished")
>> 
>> request_finished.connect(my_callback)
>>
>>
>>
>>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e2287639-0b90-4e27-9766-bf4bd356fadd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Signals - request_finished

2015-02-25 Thread Rootz
how do I load the signals file at the same point?

On Wednesday, February 25, 2015 at 12:29:57 PM UTC-5, Vijay Khemlani wrote:
>
> is the signals.py module being loaded at some point?
>
> If it isn't, then the connect function is never being called.
>
> On Wed, Feb 25, 2015 at 2:01 PM, Rootz > 
> wrote:
>
>> I have tried using the request_finished signal but nothing happens when I 
>> tried testing it.
>> What suggestions or recommendations can I do to help fix the problem?
>>
>> Thank you.
>>
>>
>> Below is a sample of the signals.py file (sample is taken from 
>> djangoproject.com )
>>
>> ###SIGNALS.PY
>>
>>
>> from django.core.signals import request_finished
>>
>>
>> def my_callback(sender, **kwargs):
>> print("request finished")
>> 
>> request_finished.connect(my_callback)
>>
>>
>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c25adbf7-4654-440f-bb43-9a234339ad17%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c25adbf7-4654-440f-bb43-9a234339ad17%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55f732cb-4f92-4d04-a7d4-0d8609f894d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using Signals - request_finished

2015-02-25 Thread Rootz
I have tried using the request_finished signal but nothing happens when I 
tried testing it.
What suggestions or recommendations can I do to help fix the problem?

Thank you.


Below is a sample of the signals.py file (sample is taken from 
djangoproject.com )

###SIGNALS.PY


from django.core.signals import request_finished


def my_callback(sender, **kwargs):
print("request finished")

request_finished.connect(my_callback)



-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c25adbf7-4654-440f-bb43-9a234339ad17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-04 Thread Rootz
Thanks . It work using both the name and namespaces.

On Thursday, December 4, 2014 8:45:27 AM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> Not sure about namespaces, but you can certainly use name:
>
> urlpatterns = patterns('',
> url(r'^about/', login_required(AboutView.as_view()), name='about'),
> )
>
> Or better yet, patterns() is deprecated so:
>
> urlpatterns = [
> url(r'^about/', login_required(AboutView.as_view()), name='about'),
> ]
>
> Collin
>
> On Wednesday, December 3, 2014 10:13:24 AM UTC-5, Rootz wrote:
>>
>> URL Reversing the view where login is required.
>>
>> On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote:
>>>
>>> Hi,
>>>
>>> It's probably possible. Do you mean url reversing the login view, or url 
>>> reversing the view where login is required?
>>>
>>> Collin
>>>
>>> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:
>>>>
>>>> Hi can this work with url reversing namespaced urls?
>>>> thanks
>>>>
>>>> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>>>>>
>>>>> If you are usign class based generic views you can use the decorators 
>>>>> in the URL config of your app, for example
>>>>>
>>>>> urlpatterns = patterns('',
>>>>> (r'^about/', login_required(AboutView.as_view())),
>>>>> )
>>>>>
>>>>>
>>>>> On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:
>>>>>
>>>>>> Can I use both Generic View and the Django.contrib.auth features 
>>>>>> (such as login_required decorator and other auth interface tool)? And if 
>>>>>> it 
>>>>>> is not possible to integrate auth into Generic Views then can you 
>>>>>> recommend 
>>>>>> alternative way of making the two work together? Adding to this I am 
>>>>>> using 
>>>>>> Django 1.7v and python 3.4v. 
>>>>>>
>>>>>> Thank you
>>>>>>
>>>>>> -- 
>>>>>> 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 http://groups.google.com/group/django-users.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9888440b-f10a-4474-bb37-595e612b3310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect user inside Class-Based views

2014-12-03 Thread Rootz
Thanks again..

On Wednesday, December 3, 2014 10:24:44 AM UTC-5, pjotr wrote:
>
> You could also look into django-braces that has some mixins to handle some 
> common operations.
>
> http://django-braces.readthedocs.org/en/latest/index.html
>
>
> On Tuesday, December 2, 2014 4:10:40 PM UTC+1, Rootz wrote:
>>
>> thanks
>>
>> On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote:
>>>
>>> 2014-12-02 15:17 GMT+01:00 Rootz :
>>>
>>>> I have a small Django App using several Class-Based Views but I am 
>>>> contemplating how the class views would redirect a user based upon a 
>>>> condition? In my case I would like to redirect user who are not 
>>>> authenticated. Just how do I go about doing that?
>>>>
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> As long as the class based view doesn't require you to be logged in you 
>>> can achive that by doing:
>>>
>>> def dispatch(self, request, *args, **kwargs):
>>> if not request.user.is_authenticated():
>>> return HttpResponseRedirect(reverse("url_name_to_redirect_to"))
>>>
>>> # Continue with other dispatch functionality
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/441d935f-450a-4705-82a6-5e960d32a948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
URL Reversing the view where login is required.

On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> It's probably possible. Do you mean url reversing the login view, or url 
> reversing the view where login is required?
>
> Collin
>
> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:
>>
>> Hi can this work with url reversing namespaced urls?
>> thanks
>>
>> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>>>
>>> If you are usign class based generic views you can use the decorators in 
>>> the URL config of your app, for example
>>>
>>> urlpatterns = patterns('',
>>> (r'^about/', login_required(AboutView.as_view())),
>>> )
>>>
>>>
>>> On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:
>>>
>>>> Can I use both Generic View and the Django.contrib.auth features (such 
>>>> as login_required decorator and other auth interface tool)? And if it is 
>>>> not possible to integrate auth into Generic Views then can you recommend 
>>>> alternative way of making the two work together? Adding to this I am using 
>>>> Django 1.7v and python 3.4v. 
>>>>
>>>> Thank you
>>>>
>>>> -- 
>>>> 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 http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a7028f1d-0b42-4c9f-acef-397188922a0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
Yes

On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> It's probably possible. Do you mean url reversing the login view, or url 
> reversing the view where login is required?
>
> Collin
>
> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:
>>
>> Hi can this work with url reversing namespaced urls?
>> thanks
>>
>> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>>>
>>> If you are usign class based generic views you can use the decorators in 
>>> the URL config of your app, for example
>>>
>>> urlpatterns = patterns('',
>>> (r'^about/', login_required(AboutView.as_view())),
>>> )
>>>
>>>
>>> On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:
>>>
>>>> Can I use both Generic View and the Django.contrib.auth features (such 
>>>> as login_required decorator and other auth interface tool)? And if it is 
>>>> not possible to integrate auth into Generic Views then can you recommend 
>>>> alternative way of making the two work together? Adding to this I am using 
>>>> Django 1.7v and python 3.4v. 
>>>>
>>>> Thank you
>>>>
>>>> -- 
>>>> 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 http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7806cb5c-9d11-4a12-b296-1279c5eb4922%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect user inside Class-Based views

2014-12-02 Thread Rootz
thanks

On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote:
>
> 2014-12-02 15:17 GMT+01:00 Rootz >:
>
>> I have a small Django App using several Class-Based Views but I am 
>> contemplating how the class views would redirect a user based upon a 
>> condition? In my case I would like to redirect user who are not 
>> authenticated. Just how do I go about doing that?
>>
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> As long as the class based view doesn't require you to be logged in you 
> can achive that by doing:
>
> def dispatch(self, request, *args, **kwargs):
> if not request.user.is_authenticated():
> return HttpResponseRedirect(reverse("url_name_to_redirect_to"))
>
> # Continue with other dispatch functionality
>
> Regards,
>
> Andréas
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d58084b0-b8c9-48bf-b6b4-f818cdf1d2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using login_required decorator

2014-12-02 Thread Rootz
Thanks I got it to work...

On Tuesday, December 2, 2014 7:22:30 AM UTC-5, Daniel Roseman wrote:
>
> On Monday, 1 December 2014 23:59:00 UTC, Rootz wrote:
>>
>> I have a small project but I am trying to restrict access on some of the 
>> django app urls to login users only. The problem is that when I hit a page 
>> that requires login users I expected that they(users) are redirected to the 
>> login page however that is not the case of what happens instead they are 
>> redirected to an example url link like this '/login?next=/detail/1/' with 
>> an error message as stated "TypeError at /login/ object() takes no 
>> parameters" 
>>
>> The django project url
>>
>>
>> (r'^detail/(?P\d{1,10})/$',login_required(views.DetailViewMember.as_view)),
>>
>>  
> This has nothing to do with the decorator. You need to *call* the as_view 
> method:
>   
> (r'^detail/(?P\d{1,10})/$',login_required(views.
> DetailViewMember.as_view())),
> --
> DR.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ff9b6f8d-9776-4196-a500-86ef533383bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Redirect user inside Class-Based views

2014-12-02 Thread Rootz
I have a small Django App using several Class-Based Views but I am 
contemplating how the class views would redirect a user based upon a 
condition? In my case I would like to redirect user who are not 
authenticated. Just how do I go about doing that?

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57d8f675-5336-421a-9f36-aee6e24545ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using login_required decorator

2014-12-01 Thread Rootz
I have a small project but I am trying to restrict access on some of the 
django app urls to login users only. The problem is that when I hit a page 
that requires login users I expected that they(users) are redirected to the 
login page however that is not the case of what happens instead they are 
redirected to an example url link like this '/login?next=/detail/1/' with 
an error message as stated "TypeError at /login/ object() takes no 
parameters" 

The django project url

(r'^detail/(?P\d{1,10})/$',login_required(views.DetailViewMember.as_view)),

url(r'^login/$',views.members_login,name='login'),

The Login View Function

def members_login(request):

if request.method == 'POST':
password = request.POST['password']
username = request.POST['username']
user = authenticate(username=username,password=password)

if user is not None:
if user.is_active:
login(request,user)
return redirect('members:index')
else:
#inactive users required to re-register
return 
redirect('members:index')#render(request,'members/login',dict(loginErr=True))
else:
#no account required to register to create one
return redirect('members:index')

else:
#test if login is a regular get request then redirect
return redirect('members:index')

Can you explain to me why is it the I am getting this error?

Thank you

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9cc8283d-4fc7-4f82-bbfe-cc5d9fcfb6eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-11-30 Thread Rootz
Hi can this work with url reversing namespaced urls?
thanks

On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>
> If you are usign class based generic views you can use the decorators in 
> the URL config of your app, for example
>
> urlpatterns = patterns('',
> (r'^about/', login_required(AboutView.as_view())),
> )
>
>
> On Thu, Oct 16, 2014 at 12:49 PM, Rootz > 
> wrote:
>
>> Can I use both Generic View and the Django.contrib.auth features (such as 
>> login_required decorator and other auth interface tool)? And if it is not 
>> possible to integrate auth into Generic Views then can you recommend 
>> alternative way of making the two work together? Adding to this I am using 
>> Django 1.7v and python 3.4v. 
>>
>> Thank you
>>
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/688a1152-690e-41a9-91e1-72cf0f21b631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Login Problem

2014-11-30 Thread Rootz
Apparently caching was enable. Now that I know I disable caching and now it 
is working now..
thanks :)

On Sunday, November 30, 2014 1:32:27 PM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> If you type your password wrong, user will be None, and your code will 
> then redirect to the "register" page.
>
> If you press "back" after a successful login, the CSRF token will be out 
> of date and the form won't work.
>
> Are you caching any pages?
>
> Collin
>
> On Friday, November 28, 2014 12:55:35 AM UTC-5, Rootz wrote:
>>
>> I have a django app but I having problems with my login views and logout 
>> views. I do not have a html template designated to handle user login/logout 
>> view.
>> Django project is configured as follows:
>>
>> INSTALLED_APPS 
>> <https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-INSTALLED_APPS>
>>  setting:
>>
>>1. 'django.contrib.auth' contains the core of the authentication 
>>framework, and its default models.
>>2. 'django.contrib.contenttypes' is the Django *content type system* 
>><https://docs.djangoproject.com/en/1.7/ref/contrib/contenttypes/>, 
>>which allows permissions to be associated with models you create.
>>3. 'django.contrib.sessions',
>>
>>  MIDDLEWARE_CLASSES 
>> <https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-MIDDLEWARE_CLASSES>
>>  setting:
>>
>>1. SessionMiddleware 
>>
>> <https://docs.djangoproject.com/en/1.7/ref/middleware/#django.contrib.sessions.middleware.SessionMiddleware>
>> manages *sessions* 
>><https://docs.djangoproject.com/en/1.7/topics/http/sessions/> across 
>>requests.
>>2. AuthenticationMiddleware 
>>
>> <https://docs.djangoproject.com/en/1.7/ref/middleware/#django.contrib.auth.middleware.AuthenticationMiddleware>
>>  associates 
>>users with requests using sessions.
>>3. csrf.CsrfViewMiddleware 
>>
>>
>> Using Django Template Language and Template inheritance. The login form 
>> is on the base template on other templates extends from this base template.
>>
>> All my login attempts result in some of the views rendering the user info 
>> (username to welcome user back) while other views rendering the page as if 
>> the user is an anonymous user. If I try to login in again I get an error 
>> page stating that there is a missing csrf token or incorrect. Adding to 
>> this I have identified many instances where I have tried to logout and it 
>> does not seem to log me out because it is still showing the last user login 
>> info. For my base template I have hard coded the form (meaning not using 
>> Django Form class).
>>
>> Can You identify the possible fault in how i am implementing the login 
>> and logout views?
>>
>>  
>>  Here is a copy of my login and logout views
>>
>> def members_login(request):
>>
>> if request.method == 'POST':
>> password = request.POST['password']
>> username = request.POST['username']
>> user = authenticate(username=username,password=password)
>>
>> if user is not None:
>> if user.is_active:
>> login(request,user)
>> return redirect('members:index')
>> else:
>> #inactive users required to re-register
>> return redirect('members:index')
>> else:
>> #no account required to register to create one
>> return redirect('members:register')
>> 
>> else:
>> #test if login is a regular get request then redirect
>> return HttpResponseRedirect(reverse('members:index'))
>>
>>
>> def members_logout(request):
>> logout(request)
>> return redirect('members:index')
>>
>>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a54ac9c-d935-4fb0-b220-113dc477a200%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simple Login Problem

2014-11-27 Thread Rootz
I have a django app but I having problems with my login views and logout 
views. I do not have a html template designated to handle user login/logout 
view.
Django project is configured as follows:

INSTALLED_APPS 

 setting:

   1. 'django.contrib.auth' contains the core of the authentication 
   framework, and its default models.
   2. 'django.contrib.contenttypes' is the Django *content type system* 
   , which 
   allows permissions to be associated with models you create.
   3. 'django.contrib.sessions',
   
 MIDDLEWARE_CLASSES 

 setting:

   1. SessionMiddleware 
   

manages *sessions* 
    across 
   requests.
   2. AuthenticationMiddleware 
   

 associates 
   users with requests using sessions.
   3. csrf.CsrfViewMiddleware 


Using Django Template Language and Template inheritance. The login form is 
on the base template on other templates extends from this base template.

All my login attempts result in some of the views rendering the user info 
(username to welcome user back) while other views rendering the page as if 
the user is an anonymous user. If I try to login in again I get an error 
page stating that there is a missing csrf token or incorrect. Adding to 
this I have identified many instances where I have tried to logout and it 
does not seem to log me out because it is still showing the last user login 
info. For my base template I have hard coded the form (meaning not using 
Django Form class).

Can You identify the possible fault in how i am implementing the login and 
logout views?

 
 Here is a copy of my login and logout views

def members_login(request):

if request.method == 'POST':
password = request.POST['password']
username = request.POST['username']
user = authenticate(username=username,password=password)

if user is not None:
if user.is_active:
login(request,user)
return redirect('members:index')
else:
#inactive users required to re-register
return redirect('members:index')
else:
#no account required to register to create one
return redirect('members:register')

else:
#test if login is a regular get request then redirect
return HttpResponseRedirect(reverse('members:index'))


def members_logout(request):
logout(request)
return redirect('members:index')

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f55242f9-ea84-4620-a90d-d4b81640885d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-10-19 Thread Rootz
Thanks.

On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>
> If you are usign class based generic views you can use the decorators in 
> the URL config of your app, for example
>
> urlpatterns = patterns('',
> (r'^about/', login_required(AboutView.as_view())),
> )
>
>
> On Thu, Oct 16, 2014 at 12:49 PM, Rootz > 
> wrote:
>
>> Can I use both Generic View and the Django.contrib.auth features (such as 
>> login_required decorator and other auth interface tool)? And if it is not 
>> possible to integrate auth into Generic Views then can you recommend 
>> alternative way of making the two work together? Adding to this I am using 
>> Django 1.7v and python 3.4v. 
>>
>> Thank you
>>
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7fdf3ecf-381b-4aa7-9e30-46a1043a7694%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Generic Views and Django.contrib.auth

2014-10-16 Thread Rootz
Can I use both Generic View and the Django.contrib.auth features (such as 
login_required decorator and other auth interface tool)? And if it is not 
possible to integrate auth into Generic Views then can you recommend 
alternative way of making the two work together? Adding to this I am using 
Django 1.7v and python 3.4v. 

Thank you

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09fe215a-4572-418c-959f-567e9ab05b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


file inserts

2013-10-23 Thread Rootz
Question
How do one do file inserts less than 16 mb without gridfs?

thank you

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08e193f2-f271-4360-af1f-1f9463f44c4c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: DateTimeField stored as None

2013-02-03 Thread Rootz
Changing pub_date to DateField() class worked now and now I am able to see 
date values stored in the pub_date column.

On Sunday, February 3, 2013 9:07:27 AM UTC-5, Rootz wrote:
>
> I made several attempts to store/update the current date in a model. I 
> used both admin page and the shell  to save/update a datetimefield value of 
> my model and then after querying the record it return None for 
> datetimefield column.
>
> Secondly my method was_published_recently() does not work.
>
> I am guessing maybe its because I am using sqlite3 correct me if I am 
> wrong?
>
> I am using sqlite3 db engine.
>
> models.py  
>
> from django.db import models
> import datetime
> from django.utils import timezone
>
>
> # Create your models here.
>
> class Poll(models.Model):
> question = models.CharField(max_length=200)
> pub_date = models.DateTimeField('Date Information')
>
> def __unicode__(self):
> return self.question
>
> def was_published_recently(self):
> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
>
> class Choice(models.Model):
> poll = models.ForeignKey('Poll')
> choice = models.CharField(max_length=200)
> votes = models.IntegerField()
>
> def __unicode__(self):
> return self.choice
>
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




DateTimeField stored as None

2013-02-03 Thread Rootz
I made several attempts to store/update the current date in a model. I used 
both admin page and the shell  to save/update a datetimefield value of my 
model and then after querying the record it return None for datetimefield 
column.

Secondly my method was_published_recently() does not work.

I am guessing maybe its because I am using sqlite3 correct me if I am wrong?

I am using sqlite3 db engine.

models.py  

from django.db import models
import datetime
from django.utils import timezone


# Create your models here.

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('Date Information')

def __unicode__(self):
return self.question

def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

class Choice(models.Model):
poll = models.ForeignKey('Poll')
choice = models.CharField(max_length=200)
votes = models.IntegerField()

def __unicode__(self):
return self.choice



-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.