Re: Is here Ella cms (based on Django) users?

2013-06-10 Thread Amirouche


Le lundi 10 juin 2013 00:48:06 UTC+2, Pavel a écrit :
>
> i have some newbie questions ^^


Can you elaborate on yours needs ? They are several CMS in Django:

- djagnocms 
- amstrongcms
- mezzanine 

-- 
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.




Re: database -> model -> charting

2013-06-10 Thread Christian Schulz
I installed with python2.7/1.4.5 some weeks ago , but I didn't use a 
BigIntegerField. What is your error message?



After trying this I find a problem with the types it can use. For 
example it does not seem to like BigIntegerField unless there is 
something else I am doing wrong. Thinking about it, maybe I am letting 
chartit do too much for me but I do like the idea of something doing 
the hard thinking for me :). I am using python 2.7 and django 1.5, are 
you using the same ?


On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote:

When you have some experience with JS/Highcharts django-chartit
might be
interesting.
Easy is relativ but I got it and I'm really not a django/JS pro. It's
nice work, but dev progress seems fallen asleep.

http://chartit.shutupandship.com/ 


>
>
> I would like to hear peoples opinions on third party django
charting
> apps, with various considerations. My primary consideration
would ease
> of use by a django noob. 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?hl=en
.
> For more options, visit https://groups.google.com/groups/opt_out
.
>
>



--
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.




Re: Django 1.5 - Session request.session.set_expiry() raised 500 with datetime object.

2013-06-10 Thread Tom Evans
On Sun, Jun 9, 2013 at 5:07 AM, XQ Kuang  wrote:
> Hi.
>
> The form of my app posted the expired_time with int timestamp just like
> 1371409201 and then converted it to datetime object.
>
>> expire_datetime =
>> datetime.fromtimestamp(profile_form.cleaned_data['expired_time'])
>>
>> request.session.set_expiry(expire_datetime)
>
>
> But the code raised 500 error.
>
>> Traceback (most recent call last):
>> File
>> "/usr/local/python/site-packages/django-1.5/django/core/handlers/base.py",
>> line 187, in get_response response = middleware_method(request, response)
>> File
>> "/usr/local/python/site-packages/django-1.5/django/contrib/sessions/middleware.py",
>> line 32, in process_response max_age = request.session.get_expiry_age()
>> File
>> "/usr/local/python/site-packages/django-1.5/django/contrib/sessions/backends/base.py",
>> line 195, in get_expiry_age delta = expiry - modification TypeError: can't
>> subtract offset-naive and offset-aware datetimes
>
>
> I see the doc[1] datetime is acceptable for the function, but it doesn't.
>
> Is it a bug ?
>
> Thx a lot.
>
> [1]
> https://docs.djangoproject.com/en/dev/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase.set_expiry
>

Yes, it is a bug - in your code!

You cannot mix naive and non naive datetimes together - naive
datetimes are datetimes without a timezone. If you have USE_TZ=True in
your settings.py, then django will be using non naive datetimes
throughout, and so you must do also.

Django provides a lot of utils to allow you to make a naive datetime
into a non naive:

https://docs.djangoproject.com/en/1.5/ref/utils/#django-utils-timezone

So code like this would work:

from django.utils.timezone import make_aware, get_current_timezone
expire_datetime =
datetime.fromtimestamp(profile_form.cleaned_data['expired_time'])
expire_datetime = make_aware(expire_datetime, get_current_timezone())
request.session.set_expiry(expire_datetime)

Cheers

Tom

-- 
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.




Re: Django 1.5 - Session request.session.set_expiry() raised 500 with datetime object.

2013-06-10 Thread Xuqing Kuang
Ok, thank you very much for your reply.


I will have a try later, and it should noticed in the doc maybe better. ;-)

—
Sent from Mailbox for iPhone

On Mon, Jun 10, 2013 at 4:40 PM, Tom Evans 
wrote:

> On Sun, Jun 9, 2013 at 5:07 AM, XQ Kuang  wrote:
>> Hi.
>>
>> The form of my app posted the expired_time with int timestamp just like
>> 1371409201 and then converted it to datetime object.
>>
>>> expire_datetime =
>>> datetime.fromtimestamp(profile_form.cleaned_data['expired_time'])
>>>
>>> request.session.set_expiry(expire_datetime)
>>
>>
>> But the code raised 500 error.
>>
>>> Traceback (most recent call last):
>>> File
>>> "/usr/local/python/site-packages/django-1.5/django/core/handlers/base.py",
>>> line 187, in get_response response = middleware_method(request, response)
>>> File
>>> "/usr/local/python/site-packages/django-1.5/django/contrib/sessions/middleware.py",
>>> line 32, in process_response max_age = request.session.get_expiry_age()
>>> File
>>> "/usr/local/python/site-packages/django-1.5/django/contrib/sessions/backends/base.py",
>>> line 195, in get_expiry_age delta = expiry - modification TypeError: can't
>>> subtract offset-naive and offset-aware datetimes
>>
>>
>> I see the doc[1] datetime is acceptable for the function, but it doesn't.
>>
>> Is it a bug ?
>>
>> Thx a lot.
>>
>> [1]
>> https://docs.djangoproject.com/en/dev/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase.set_expiry
>>
> Yes, it is a bug - in your code!
> You cannot mix naive and non naive datetimes together - naive
> datetimes are datetimes without a timezone. If you have USE_TZ=True in
> your settings.py, then django will be using non naive datetimes
> throughout, and so you must do also.
> Django provides a lot of utils to allow you to make a naive datetime
> into a non naive:
> https://docs.djangoproject.com/en/1.5/ref/utils/#django-utils-timezone
> So code like this would work:
> from django.utils.timezone import make_aware, get_current_timezone
> expire_datetime =
> datetime.fromtimestamp(profile_form.cleaned_data['expired_time'])
> expire_datetime = make_aware(expire_datetime, get_current_timezone())
> request.session.set_expiry(expire_datetime)
> Cheers
> Tom
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-users/dI_3IG-7a78/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.

-- 
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.




Using django-autocomplete-light?

2013-06-10 Thread Derek
Hi

I am trying to get django-autocomplete-light (
https://github.com/yourlabs/django-autocomplete-light) working for my
project in the admin.  I have the following files and code, running with
Django 1.4.3.  In the edit form for the Company, the drop-down list for
country has been replaced by an empty edit box, but beyond that there is no
list displaying when I start typing...

I'd appreciate any ideas as to how to get this basic example working.

Thanks
Derek


# models.py

class Country(Model):
id = AutoField(primary_key=True)
code = CharField(unique=True, max_length=5)
name = CharField(unique=True, max_length=250)

class Company(Model):
id = AutoField(primary_key=True)
name = CharField(max_length=250)
country = ForeignKey(Country)

# autocomplete_light_registry.py

import autocomplete_light
from models import Country

class CountryAutocomplete(autocomplete_light.AutocompleteModelBase):
search_fields = ['^name', ]

autocomplete_light.register(Country, CountryAutocomplete)

# admin.py

import autocomplete_light
import autocomplete_light_registry

class CompanyForm(forms.ModelForm):
country = forms.ModelChoiceField(
Country.objects.all(),
widget=autocomplete_light.ChoiceWidget('CountryAutocomplete'))

class Meta:
model = Company

class CompanyAdmin(admin.ModelAdmin):
list_display = ('name', 'country', )
list_filter = ('country', )
form = CompanyForm

-- 
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.




Re: database -> model -> charting

2013-06-10 Thread tony gair
TypeError at /heating/chart/
__init__() got an unexpected keyword argument 'use_decimal'
Request Method: GET
Request URL: http://127.0.0.1:8000/heating/chart/
Django Version: 1.5.1
Exception Type: TypeError
Exception Value: 
__init__() got an unexpected keyword argument 'use_decimal'
Exception Location: /usr/lib/python2.7/json/__init__.py in dumps, line 250
Python Executable: /usr/bin/python
Python Version: 2.7.4
Python Path: 
['/home/tony/django/sh',
 '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-i386-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

This was my error. What I did was replace the two american city temperature 
example with my own model data. However my data was different in that the 
two temperatures were integer and the time axis variable was actually 
utctime time (unconverted :) ) , the odd thing though is that there seems 
to be no way to specify the variables going in to the wrapper. e.g. Why is 
it insisting on a decimal, I cannot see where this is specified in the 
example!

On Monday, 10 June 2013 08:28:57 UTC, Christian Schulz wrote:
>
> I installed with python2.7/1.4.5 some weeks ago , but I didn't use a 
> BigIntegerField. What is your error message? 
>
>
> > After trying this I find a problem with the types it can use. For 
> > example it does not seem to like BigIntegerField unless there is 
> > something else I am doing wrong. Thinking about it, maybe I am letting 
> > chartit do too much for me but I do like the idea of something doing 
> > the hard thinking for me :). I am using python 2.7 and django 1.5, are 
> > you using the same ? 
> > 
> > On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote: 
> > 
> > When you have some experience with JS/Highcharts django-chartit 
> > might be 
> > interesting. 
> > Easy is relativ but I got it and I'm really not a django/JS pro. 
> It's 
> > nice work, but dev progress seems fallen asleep. 
> > 
> > http://chartit.shutupandship.com/  
>
> > 
> > 
> > > 
> > > 
> > > I would like to hear peoples opinions on third party django 
> > charting 
> > > apps, with various considerations. My primary consideration 
> > would ease 
> > > of use by a django noob. 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?hl=en 
> > . 
> > > For more options, visit https://groups.google.com/groups/opt_out 
> > . 
> > > 
> > > 
> > 
>
>

-- 
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.




Re: database -> model -> charting

2013-06-10 Thread Christian Schulz
It could be a problem with the simpleson.dumps options in django 1.5 vs. 
the included simplejson. I remember there was something...

Change:
chartit/templatetags/chartit.py
- from django.utils import simplejson
+import simplejson



TypeError at /heating/chart/
__init__() got an unexpected keyword argument 'use_decimal'
Request Method:GET
Request URL:http://127.0.0.1:8000/heating/chart/
Django Version:1.5.1
Exception Type:TypeError
Exception Value:
__init__() got an unexpected keyword argument 'use_decimal'
Exception Location:/usr/lib/python2.7/json/__init__.py in dumps, line 250
Python Executable:/usr/bin/python
Python Version:2.7.4
Python Path:
['/home/tony/django/sh',
 '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-i386-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

This was my error. What I did was replace the two american city 
temperature example with my own model data. However my data was 
different in that the two temperatures were integer and the time axis 
variable was actually utctime time (unconverted :) ) , the odd thing 
though is that there seems to be no way to specify the variables going 
in to the wrapper. e.g. Why is it insisting on a decimal, I cannot see 
where this is specified in the example!


On Monday, 10 June 2013 08:28:57 UTC, Christian Schulz wrote:

I installed with python2.7/1.4.5 some weeks ago , but I didn't use a
BigIntegerField. What is your error message?


> After trying this I find a problem with the types it can use. For
> example it does not seem to like BigIntegerField unless there is
> something else I am doing wrong. Thinking about it, maybe I am
letting
> chartit do too much for me but I do like the idea of something
doing
> the hard thinking for me :). I am using python 2.7 and django
1.5, are
> you using the same ?
>
> On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote:
>
> When you have some experience with JS/Highcharts django-chartit
> might be
> interesting.
> Easy is relativ but I got it and I'm really not a django/JS
pro. It's
> nice work, but dev progress seems fallen asleep.
>
> http://chartit.shutupandship.com/

>
>
>
> >
> >
> > I would like to hear peoples opinions on third party django
> charting
> > apps, with various considerations. My primary consideration
> would ease
> > of use by a django noob. 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?hl=en

> >.
> > For more options, visit
https://groups.google.com/groups/opt_out

> >.
> >
> >
>



--
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.




Re: how to make project template?

2013-06-10 Thread kl4us
any suggestion please?

Il giorno venerdì 7 giugno 2013 19:13:50 UTC+2, kl4us ha scritto:
>
> Anyone know how to push changes upstream back to the template after 
> having started the project? i'm in this snenario:
>
> 1) I start a project from pinax:
>
> $ virtualenv mysite
> $ source mysite/bin/activate
> (mysite)$ pip install Django==1.4.5
> (mysite)$ django-admin.py startproject 
> --template=https://github.com/pinax/pinax-project-social/zipball/master mysite
> (mysite)$ cd mysite
> (mysite)$ pip install -r requirements.txt
> (mysite)$ python manage.py syncdb
> (mysite)$ python manage.py runserver
>
> 2) make stuff 
> 3) i want to pull to pinax repository my changes
>
> The question is: How can i change my named project "mysite" with {{ 
> project_name}} back?
>
>
>

-- 
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.




Point System in django

2013-06-10 Thread coded kid
what is the best way to implement this? Users will pay a certain fee
and get some amount of points (100points) and for every video the user
watch, like 30points will be deducted. How can I go about this? is
there a package for point system in django?

-- 
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.




Please help me in Django

2013-06-10 Thread Abhimanyu Choithramani
I downloaded Python 2.7.5 and it started working.
And I downloaded Django 1.5.1 BUT I am not being able to start it.
Can someone please guide me step by step..
PLEASE please please..

Would be obliged if I also get a voice guidance over Skype.
 my skype id is:  abhimanyu.choithramani89

-- 
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.




Re: Please help me in Django

2013-06-10 Thread Gerald Klein
Hi, Can't start it? Please be precise with what you mean it helps us help
you.




On Mon, Jun 10, 2013 at 5:57 AM, Abhimanyu Choithramani <
life.abhi.l...@gmail.com> wrote:

> I downloaded Python 2.7.5 and it started working.
> And I downloaded Django 1.5.1 BUT I am not being able to start it.
> Can someone please guide me step by step..
> PLEASE please please..
>
> Would be obliged if I also get a voice guidance over Skype.
>  my skype id is:  abhimanyu.choithramani89
>
> --
> 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.
>
>
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

geraldklein.wordpress.com

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580

-- 
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.




Re: Please help me in Django

2013-06-10 Thread Thomas Weholt
First of all; have you followed the python tutorial and a good grasp on
python in general? If not, do a quick read of the python docs before trying
to learn django.

You'll have to install django after downloading it. Unpack django, cd into
the new django-folder and do a

python setup.py install

Then read the official django tutorial/docs. They are all exceptionally
good and should get you going.

Thomas


On Mon, Jun 10, 2013 at 12:57 PM, Abhimanyu Choithramani <
life.abhi.l...@gmail.com> wrote:

> I downloaded Python 2.7.5 and it started working.
> And I downloaded Django 1.5.1 BUT I am not being able to start it.
> Can someone please guide me step by step..
> PLEASE please please..
>
> Would be obliged if I also get a voice guidance over Skype.
>  my skype id is:  abhimanyu.choithramani89
>
> --
> 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.
>
>
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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.




Re: database -> model -> charting

2013-06-10 Thread tony gair
I tried that on 1.5 and tried my code out in a 1.4 install. I get the same 
error.  Interestingly in stack overflow they mention this problem at 
http://stackoverflow.com/questions/8644060/caught-typeerror-while-rendering-init-got-an-unexpected-keyword-argument

and chartit in its own code seems to expect a decimal value regardless, so 
maybe decimal values are hardwired into the code

On Monday, June 10, 2013 10:55:00 AM UTC, Christian Schulz wrote:
>
> It could be a problem with the simpleson.dumps options in django 1.5 vs. 
> the included simplejson. I remember there was something... 
> Change: 
> chartit/templatetags/chartit.py 
> - from django.utils import simplejson 
> +import simplejson 
>
>
> > TypeError at /heating/chart/ 
> > __init__() got an unexpected keyword argument 'use_decimal' 
> > Request Method:GET 
> > Request URL:http://127.0.0.1:8000/heating/chart/ 
> > Django Version:1.5.1 
> > Exception Type:TypeError 
> > Exception Value: 
> > __init__() got an unexpected keyword argument 'use_decimal' 
> > Exception Location:/usr/lib/python2.7/json/__init__.py in dumps, line 
> 250 
> > Python Executable:/usr/bin/python 
> > Python Version:2.7.4 
> > Python Path: 
> > ['/home/tony/django/sh', 
> >  '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg', 
> >  '/usr/lib/python2.7', 
> >  '/usr/lib/python2.7/plat-i386-linux-gnu', 
> >  '/usr/lib/python2.7/lib-tk', 
> >  '/usr/lib/python2.7/lib-old', 
> >  '/usr/lib/python2.7/lib-dynload', 
> >  '/usr/local/lib/python2.7/dist-packages', 
> >  '/usr/lib/python2.7/dist-packages', 
> >  '/usr/lib/python2.7/dist-packages/PILcompat', 
> >  '/usr/lib/python2.7/dist-packages/gtk-2.0', 
> >  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', 
> >  '/usr/lib/python2.7/dist-packages/ubuntuone-client', 
> >  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', 
> >  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol'] 
> > 
> > This was my error. What I did was replace the two american city 
> > temperature example with my own model data. However my data was 
> > different in that the two temperatures were integer and the time axis 
> > variable was actually utctime time (unconverted :) ) , the odd thing 
> > though is that there seems to be no way to specify the variables going 
> > in to the wrapper. e.g. Why is it insisting on a decimal, I cannot see 
> > where this is specified in the example! 
> > 
> > On Monday, 10 June 2013 08:28:57 UTC, Christian Schulz wrote: 
> > 
> > I installed with python2.7/1.4.5 some weeks ago , but I didn't use a 
> > BigIntegerField. What is your error message? 
> > 
> > 
> > > After trying this I find a problem with the types it can use. For 
> > > example it does not seem to like BigIntegerField unless there is 
> > > something else I am doing wrong. Thinking about it, maybe I am 
> > letting 
> > > chartit do too much for me but I do like the idea of something 
> > doing 
> > > the hard thinking for me :). I am using python 2.7 and django 
> > 1.5, are 
> > > you using the same ? 
> > > 
> > > On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote: 
> > > 
> > > When you have some experience with JS/Highcharts 
> django-chartit 
> > > might be 
> > > interesting. 
> > > Easy is relativ but I got it and I'm really not a django/JS 
> > pro. It's 
> > > nice work, but dev progress seems fallen asleep. 
> > > 
> > > http://chartit.shutupandship.com/ 
> >  
> >  > > 
> > > 
> > > 
> > > > 
> > > > 
> > > > I would like to hear peoples opinions on third party django 
> > > charting 
> > > > apps, with various considerations. My primary consideration 
> > > would ease 
> > > > of use by a django noob. 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?hl=en 
> >  
> > >  > >. 
> > > > For more options, visit 
> > https://groups.google.com/groups/opt_out 
> >  
> > >  > >. 
> > > > 
> > > > 
> > 

Re: database -> model -> charting

2013-06-10 Thread tony gair
I have subsequently located the problem. I think where the chartit.py 
supplies a parameter saying use_decimal=true is wrong. I have removed that 
parameter and found that it works with that change. 
Do you know if this is because of updates to jquery? 

On Monday, June 10, 2013 12:38:02 PM UTC, tony gair wrote:
>
> I tried that on 1.5 and tried my code out in a 1.4 install. I get the same 
> error.  Interestingly in stack overflow they mention this problem at 
> http://stackoverflow.com/questions/8644060/caught-typeerror-while-rendering-init-got-an-unexpected-keyword-argument
>
> and chartit in its own code seems to expect a decimal value regardless, so 
> maybe decimal values are hardwired into the code
>
> On Monday, June 10, 2013 10:55:00 AM UTC, Christian Schulz wrote:
>>
>> It could be a problem with the simpleson.dumps options in django 1.5 vs. 
>> the included simplejson. I remember there was something... 
>> Change: 
>> chartit/templatetags/chartit.py 
>> - from django.utils import simplejson 
>> +import simplejson 
>>
>>
>> > TypeError at /heating/chart/ 
>> > __init__() got an unexpected keyword argument 'use_decimal' 
>> > Request Method:GET 
>> > Request URL:http://127.0.0.1:8000/heating/chart/ 
>> > Django Version:1.5.1 
>> > Exception Type:TypeError 
>> > Exception Value: 
>> > __init__() got an unexpected keyword argument 'use_decimal' 
>> > Exception Location:/usr/lib/python2.7/json/__init__.py in dumps, line 
>> 250 
>> > Python Executable:/usr/bin/python 
>> > Python Version:2.7.4 
>> > Python Path: 
>> > ['/home/tony/django/sh', 
>> >  '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg', 
>> >  '/usr/lib/python2.7', 
>> >  '/usr/lib/python2.7/plat-i386-linux-gnu', 
>> >  '/usr/lib/python2.7/lib-tk', 
>> >  '/usr/lib/python2.7/lib-old', 
>> >  '/usr/lib/python2.7/lib-dynload', 
>> >  '/usr/local/lib/python2.7/dist-packages', 
>> >  '/usr/lib/python2.7/dist-packages', 
>> >  '/usr/lib/python2.7/dist-packages/PILcompat', 
>> >  '/usr/lib/python2.7/dist-packages/gtk-2.0', 
>> >  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', 
>> >  '/usr/lib/python2.7/dist-packages/ubuntuone-client', 
>> >  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', 
>> >  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol'] 
>> > 
>> > This was my error. What I did was replace the two american city 
>> > temperature example with my own model data. However my data was 
>> > different in that the two temperatures were integer and the time axis 
>> > variable was actually utctime time (unconverted :) ) , the odd thing 
>> > though is that there seems to be no way to specify the variables going 
>> > in to the wrapper. e.g. Why is it insisting on a decimal, I cannot see 
>> > where this is specified in the example! 
>> > 
>> > On Monday, 10 June 2013 08:28:57 UTC, Christian Schulz wrote: 
>> > 
>> > I installed with python2.7/1.4.5 some weeks ago , but I didn't use 
>> a 
>> > BigIntegerField. What is your error message? 
>> > 
>> > 
>> > > After trying this I find a problem with the types it can use. For 
>> > > example it does not seem to like BigIntegerField unless there is 
>> > > something else I am doing wrong. Thinking about it, maybe I am 
>> > letting 
>> > > chartit do too much for me but I do like the idea of something 
>> > doing 
>> > > the hard thinking for me :). I am using python 2.7 and django 
>> > 1.5, are 
>> > > you using the same ? 
>> > > 
>> > > On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote: 
>> > > 
>> > > When you have some experience with JS/Highcharts 
>> django-chartit 
>> > > might be 
>> > > interesting. 
>> > > Easy is relativ but I got it and I'm really not a django/JS 
>> > pro. It's 
>> > > nice work, but dev progress seems fallen asleep. 
>> > > 
>> > > http://chartit.shutupandship.com/ 
>> >  
>> > > > > 
>> > > 
>> > > 
>> > > > 
>> > > > 
>> > > > I would like to hear peoples opinions on third party django 
>> > > charting 
>> > > > apps, with various considerations. My primary consideration 
>> > > would ease 
>> > > > of use by a django noob. 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?hl=en 
>> > 

Re: Point System in django

2013-06-10 Thread Amirouche


Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>
> what is the best way to implement this? Users will pay a certain fee 
> and get some amount of points (100points) and for every video the user 
> watch, like 30points will be deducted. How can I go about this? is 
> there a package for point system in django?
>

This is simple transaction scheme what is specific to your usecase ? 

-- 
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.




Re: Please help me in Django

2013-06-10 Thread Sithembewena Lloyd Dube
Start with the Django installation guide and tutorial. They will show you
everything you need to know to get started.

https://docs.djangoproject.com/en/1.5/intro/install/
https://docs.djangoproject.com/en/1.5/intro/tutorial01/


On Mon, Jun 10, 2013 at 12:57 PM, Abhimanyu Choithramani <
life.abhi.l...@gmail.com> wrote:

> I downloaded Python 2.7.5 and it started working.
> And I downloaded Django 1.5.1 BUT I am not being able to start it.
> Can someone please guide me step by step..
> PLEASE please please..
>
> Would be obliged if I also get a voice guidance over Skype.
>  my skype id is:  abhimanyu.choithramani89
>
> --
> 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.
>
>
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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.




Re: database -> model -> charting

2013-06-10 Thread Christian Schulz

Hmm , don't know I'm not so much a js/jquery guy.

But here is something about this issue.
https://github.com/django/django/commit/5003df3659


I have subsequently located the problem. I think where the chartit.py 
supplies a parameter saying use_decimal=true is wrong. I have removed 
that parameter and found that it works with that change.

Do you know if this is because of updates to jquery?

On Monday, June 10, 2013 12:38:02 PM UTC, tony gair wrote:

I tried that on 1.5 and tried my code out in a 1.4 install. I get
the same error.  Interestingly in stack overflow they mention this
problem at

http://stackoverflow.com/questions/8644060/caught-typeerror-while-rendering-init-got-an-unexpected-keyword-argument




and chartit in its own code seems to expect a decimal value
regardless, so maybe decimal values are hardwired into the code

On Monday, June 10, 2013 10:55:00 AM UTC, Christian Schulz wrote:

It could be a problem with the simpleson.dumps options in
django 1.5 vs.
the included simplejson. I remember there was something...
Change:
chartit/templatetags/chartit.py
- from django.utils import simplejson
+import simplejson


> TypeError at /heating/chart/
> __init__() got an unexpected keyword argument 'use_decimal'
> Request Method:GET
> Request URL:http://127.0.0.1:8000/heating/chart/

> Django Version:1.5.1
> Exception Type:TypeError
> Exception Value:
> __init__() got an unexpected keyword argument 'use_decimal'
> Exception Location:/usr/lib/python2.7/json/__init__.py in
dumps, line 250
> Python Executable:/usr/bin/python
> Python Version:2.7.4
> Python Path:
> ['/home/tony/django/sh',
>
 '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-i386-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PILcompat',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>
> This was my error. What I did was replace the two american city
> temperature example with my own model data. However my data was
> different in that the two temperatures were integer and the
time axis
> variable was actually utctime time (unconverted :) ) , the
odd thing
> though is that there seems to be no way to specify the
variables going
> in to the wrapper. e.g. Why is it insisting on a decimal, I
cannot see
> where this is specified in the example!
>
> On Monday, 10 June 2013 08:28:57 UTC, Christian Schulz wrote:
>
> I installed with python2.7/1.4.5 some weeks ago , but I
didn't use a
> BigIntegerField. What is your error message?
>
>
> > After trying this I find a problem with the types it
can use. For
> > example it does not seem to like BigIntegerField
unless there is
> > something else I am doing wrong. Thinking about it,
maybe I am
> letting
> > chartit do too much for me but I do like the idea of
something
> doing
> > the hard thinking for me :). I am using python 2.7 and
django
> 1.5, are
> > you using the same ?
> >
> > On Friday, 7 June 2013 11:33:07 UTC+1, Christian
Schulz wrote:
> >
> > When you have some experience with JS/Highcharts
django-chartit
> > might be
> > interesting.
> > Easy is relativ but I got it and I'm really not a
django/JS
> pro. It's
> > nice work, but dev progress seems fallen asleep.
> >
> > http://chartit.shutupandship.com/

> >
> 
> >>
> >
   

How does it all work

2013-06-10 Thread Nafiul Islam
Hi!

I've been using django for a little bit, and I gotta say I love the 
framework. But here's the thing, I don't know how it works. How everything 
fits together. So, what I wanted to ask is how does it all work? Say you 
have a server, and you have Python installed on it. How would you go about 
making a simple hello world web page, without django?

I would be grateful to any link to a comprehensive resource, that shows you 
how to make a simple Hello World webpage, from how you install software 
that you need to writing pure python (without a framework) that can handle 
requests, and work with databases.

I guess, what I'm asking is how do you make a very very basic website using 
Python, from start to finish on a server?

-- 
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.




Re: How does it all work

2013-06-10 Thread Thomas Weholt
I'd take a look at the standard python docs, especially the things about
wsgi and httpserver, but this question is not django-specific so you might
have better look asking in a more python-specific forum, like
comp.lang.python (
https://groups.google.com/forum/?fromgroups#!forum/comp.lang.python )

There's a long way and lots of codelines from a basic "Hello world" webapp
to a framework like django, but you'll learn alot by starting with the
standard webrelated stuff in standard python.

Thomas


On Mon, Jun 10, 2013 at 4:10 PM, Nafiul Islam wrote:

> Hi!
>
> I've been using django for a little bit, and I gotta say I love the
> framework. But here's the thing, I don't know how it works. How everything
> fits together. So, what I wanted to ask is how does it all work? Say you
> have a server, and you have Python installed on it. How would you go about
> making a simple hello world web page, without django?
>
> I would be grateful to any link to a comprehensive resource, that shows
> you how to make a simple Hello World webpage, from how you install software
> that you need to writing pure python (without a framework) that can handle
> requests, and work with databases.
>
> I guess, what I'm asking is how do you make a very very basic website
> using Python, from start to finish on a server?
>
> --
> 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.
>
>
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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.




Re: dictionary update sequence

2013-06-10 Thread Bill Freeman
Look very carefully at the urlpattern (in some urls.py) that corresponds to
this url tag.  Perhaps something there isn't acted upon until you use the
reverse stuff.

If you don't see the issue, and want to chase it in pdb, make a dummy view
that calls django.core.urlresolvers.reverse() with these arguments, and put
import pdb;pdb.set_trace() just before the reverse().  Access the view, the
step into the reverse() call, and see when it gets to the exception, and
where it got the arguments.  (It sounds like arguments to the update()
method of a dictionary, but it could be internal to the regular expressiom
application if you use named arguments.

Good luck.

Bill


On Fri, Jun 7, 2013 at 2:40 PM, Rene Zelaya  wrote:

> Hi,
>
> I am getting the following error when the server tries to load one of my
> templates and I am not sure what the problem is:
>
> dictionary update sequence element #0 has length 1; 2 is required
>
>
> The error occurs at the following line in my template:
>
> 
>
> However, I thought I was already passing it both of those arguments
> (geneset.user and geneset.slug).  Does that have anything to do with it? I
> also recently installed the Django tastypie API - Could that be causing the
> problem at all?
>
> Many thanks!
>
> Rene
>
> --
> 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.
>
>
>

-- 
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.




Suggestions on caching queries for a single request on a subset of Views?

2013-06-10 Thread Kurtis
I have two views which perform a ton of DB queries. The views themselves 
don't perform the queries; they simply call quite a few Model methods to 
build the context data. I understand that I could simply build one method 
to re-use the data but I'd like to sustain the "Object Oriented" quality of 
the code I've developed.

If possible, I'd like to be able to cache these queries when these views 
are called. A lot of the queries are simply re-produced but perform 
different calculations or what-not based on the method called.

These views do not create persistent data; they simply hit the database and 
return calculated results from what's in there.

The caching mechanism should simply persist through the duration of the 
request. For example, subsequent requests should not use cached results 
from a previous request.

Let me know if anybody has suggestions or experience with implementing 
something along these lines. I have some 'creative' ideas on how to do it 
but I'd like to get some input first.

Thanks!
- Kurtis

-- 
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.




Re: Suggestions on caching queries for a single request on a subset of Views?

2013-06-10 Thread Marcin Szamotulski
Hi,

I am not en expert but since I had a similar problem I found a solution.
I just attached data I wanted to persist to the request.  You can put the
common code in a middleware to be computed early and then use it in your
views.  You can also add it to the session data (i.e. request.session)
and after you process the view delete it.  But then the session will be
marked as both accessed and modified, and even though at the end you
haven't change the data (since you deleted what you have added) it will
be written to the database (or a file depending which session backend
you use).

Best regards,
Marcin


On 09:58 Mon 10 Jun , Kurtis wrote:
> I have two views which perform a ton of DB queries. The views themselves 
> don't perform the queries; they simply call quite a few Model methods to 
> build the context data. I understand that I could simply build one method 
> to re-use the data but I'd like to sustain the "Object Oriented" quality of 
> the code I've developed.
> 
> If possible, I'd like to be able to cache these queries when these views 
> are called. A lot of the queries are simply re-produced but perform 
> different calculations or what-not based on the method called.
> 
> These views do not create persistent data; they simply hit the database and 
> return calculated results from what's in there.
> 
> The caching mechanism should simply persist through the duration of the 
> request. For example, subsequent requests should not use cached results 
> from a previous request.
> 
> Let me know if anybody has suggestions or experience with implementing 
> something along these lines. I have some 'creative' ideas on how to do it 
> but I'd like to get some input first.
> 
> Thanks!
> - Kurtis
> 
> -- 
> 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.
> 
> 

-- 
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.




Re: Suggestions on caching queries for a single request on a subset of Views?

2013-06-10 Thread Nikolas Stevenson-Molnar
I created a simple decorator for this purpose:

http://djangosnippets.org/snippets/2874/

Wrap your expensive model methods with @auto_memoize and the results
will be cached in memory for the duration of the request.

_Nik

On 6/10/2013 9:58 AM, Kurtis wrote:
> I have two views which perform a ton of DB queries. The views
> themselves don't perform the queries; they simply call quite a few
> Model methods to build the context data. I understand that I could
> simply build one method to re-use the data but I'd like to sustain the
> "Object Oriented" quality of the code I've developed.
>
> If possible, I'd like to be able to cache these queries when these
> views are called. A lot of the queries are simply re-produced but
> perform different calculations or what-not based on the method called.
>
> These views do not create persistent data; they simply hit the
> database and return calculated results from what's in there.
>
> The caching mechanism should simply persist through the duration of
> the request. For example, subsequent requests should not use cached
> results from a previous request.
>
> Let me know if anybody has suggestions or experience with implementing
> something along these lines. I have some 'creative' ideas on how to do
> it but I'd like to get some input first.
>
> Thanks!
> - Kurtis
> -- 
> 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.
>  
>  

-- 
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.




Re: dictionary update sequence

2013-06-10 Thread Marcin Szamotulski
Hi,

This error message one gets in the following way:

>>> dict('a')
ValueError: dictionary update sequence element #0 has length 1; 2 is 
required

I suspect that the second argument of your url is a keyword argument
rather than a positional one.  In this case you should write:

{% 'path.to.some_view' arg1=v1 arg2=v2 %}

checkout https://docs.djangoproject.com/en/dev/ref/templates/builtins/

The url tag calls reverse() which has to be called with:

reverse(name, args=list, kwargs=dictionary)

I got this error a few times when url was trying to make the kwargs
dictionary.

Best regards,
Marcin


On 14:40 Fri 07 Jun , Rene Zelaya wrote:
> Hi,
> 
> I am getting the following error when the server tries to load one of my
> templates and I am not sure what the problem is:
> 
> dictionary update sequence element #0 has length 1; 2 is required
> 
> 
> The error occurs at the following line in my template:
> 
> 
> 
> However, I thought I was already passing it both of those arguments
> (geneset.user and geneset.slug).  Does that have anything to do with it? I
> also recently installed the Django tastypie API - Could that be causing the
> problem at all?
> 
> Many thanks!
> 
> Rene
> 
> -- 
> 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.
> 
> 

-- 
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.




Re: How does it all work

2013-06-10 Thread Nick Apostolakis

On 10/06/2013 05:10 μμ, Nafiul Islam wrote:

Hi!
I would be grateful to any link to a comprehensive resource, that 
shows you how to make a simple Hello World webpage, from how you 
install software that you need to writing pure python (without a 
framework) that can handle requests, and work with databases.




Hello, you could take a look at the classic cgi concept. It is the base 
on which all wsgi,fastcgi and the rest of the family stand.


You have the webserver who accepts a request, the web server passes the 
request to a program (of any language) through an interface ( cgi,wsgi 
etc) the program returns through the same interface a response, the 
webserver returns the response to the world.


A simple idea with a lot of consequences...

--
 --
   Nick Apostolakis
  e-mail: nicka...@oncrete.gr
 Web Site: http://nick.oncrete.gr
 --

--
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.




Class Based CreateView with foreign key question

2013-06-10 Thread Jason Arnst-Goodrich
I'm having trouble wrapping my head around how to use generic class based 
views properly when it comes to creating objects associated with already 
created objects.

The concept here is adding File objects to a Case object.

The url pattern would be something like:

url(r'^case/(?P\d+)/add/$', AddFileToCase.as_view(), {}, 'file-add')


So going to case/1/add would prompt the user with a form to add a file to 
case with pk = 1.

The following code below is doing what I want but I'm not sure it's the 
best way to handle it. I feel the documentation to be very lacking in this 
area.

class AddFileToCase(CreateView):
model = File
form_class = FileForm #all of the file fields exposed except for the 
foreign key relationship field to Case

def dispatch(self, request, *args, **kwargs):
self.case = Case.objects.get(pk=self.kwargs['pk'])
return super(AddFileToCase, self).dispatch(request, *args, **kwargs)


def form_valid(self, form):
form.instance.case= self.case
return super(AddFileToCase, self).form_valid(form)


-- 
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.




Re: How does it all work

2013-06-10 Thread Russell Keith-Magee
Hi Nafiul,

One place to start would be to read the WSGI specification. WSGI is the
interface between your web server (say, Apache) and Python as a language.
The WSGI spec - also known as PEP 333 - gives a brief overview before it
gets into the fine details. However, one of the advantages of WSGI as an
interface is that there aren't actually that many fine details anyway --
for such a significant specification, it's remarkably readable.

http://www.python.org/dev/peps/pep-0333/

This will show you the interaction between web server and code that a
website developer would need to write; from there, it's a matter of looking
at what tasks the website developer needs to do often, and finding
abstractions and APIs to make that job easier. That's where Django, and
it's libraries for URL routing, database interaction, form processing and
so on comes in. If you try and write a non-trivial website to the "bare
metal" of WSGI, you'll very quickly see what Django (or any other web
framework, for that matter) is providing for you.

Yours,
Russ Magee %-)

On Mon, Jun 10, 2013 at 10:10 PM, Nafiul Islam wrote:

> Hi!
>
> I've been using django for a little bit, and I gotta say I love the
> framework. But here's the thing, I don't know how it works. How everything
> fits together. So, what I wanted to ask is how does it all work? Say you
> have a server, and you have Python installed on it. How would you go about
> making a simple hello world web page, without django?
>
> I would be grateful to any link to a comprehensive resource, that shows
> you how to make a simple Hello World webpage, from how you install software
> that you need to writing pure python (without a framework) that can handle
> requests, and work with databases.
>
> I guess, what I'm asking is how do you make a very very basic website
> using Python, from start to finish on a server?
>
> --
> 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.
>
>
>

-- 
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.




Re: How does it all work

2013-06-10 Thread Eraldo Helal
I think.. I found what you are looking 
for: http://www.djangobook.com/en/2.0/chapter01.html
Under the heading "The MVC Design Pattern"..
there is a nice example of a simple CGI script using python (no django).

Greetings from Linz (Austria)
Eraldo

On Monday, June 10, 2013 4:10:51 PM UTC+2, Nafiul Islam wrote:
>
> Hi!
>
> I've been using django for a little bit, and I gotta say I love the 
> framework. But here's the thing, I don't know how it works. How everything 
> fits together. So, what I wanted to ask is how does it all work? Say you 
> have a server, and you have Python installed on it. How would you go about 
> making a simple hello world web page, without django?
>
> I would be grateful to any link to a comprehensive resource, that shows 
> you how to make a simple Hello World webpage, from how you install software 
> that you need to writing pure python (without a framework) that can handle 
> requests, and work with databases.
>
> I guess, what I'm asking is how do you make a very very basic website 
> using Python, from start to finish on a server?
>

-- 
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.




Looking for a Django mentor

2013-06-10 Thread Feyzi Bagirov
Trying to learn the platform and work on the project at the same time. 

Thanks, Feyzi

-- 
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.




Re: Looking for a Django mentor

2013-06-10 Thread Tomas Neme
> Trying to learn the platform and work on the project at the same time.
>
> Thanks, Feyzi

first of all, do the tutorial, don't try to go further until you're
somewhat comfortable with the concepts there. You'll get the feel of
the most basic and powerful django tools are: models, forms, and the
admin site. I don't remember if it's been updated to use class-based
views, but you should take a look at them too, it'll be easier for you
to navigate 3rd party code, and it's becoming the standard, plus
generic views are another of the time-saving goodies.

Then go to #django in irc.freenode.net, there's lot of very patient
and helpful people there

--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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.




Re: Looking for a Django mentor

2013-06-10 Thread Aaron C. de Bruyn
You might consider trying http://www.pairprogramwith.me/

-A


On Mon, Jun 10, 2013 at 2:13 PM, Feyzi Bagirov  wrote:

> Trying to learn the platform and work on the project at the same time.
>
> Thanks, Feyzi
>
> --
> 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.
>
>
>

-- 
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.




Re: How does it all work

2013-06-10 Thread Gamesbrainiac
@Russell: Thanks. That is what I wanted since WSGI is what most people use
these days. Thanks, I will have a look at that.


On 11 June 2013 04:59, Russell Keith-Magee  wrote:

> Hi Nafiul,
>
> One place to start would be to read the WSGI specification. WSGI is the
> interface between your web server (say, Apache) and Python as a language.
> The WSGI spec - also known as PEP 333 - gives a brief overview before it
> gets into the fine details. However, one of the advantages of WSGI as an
> interface is that there aren't actually that many fine details anyway --
> for such a significant specification, it's remarkably readable.
>
> http://www.python.org/dev/peps/pep-0333/
>
> This will show you the interaction between web server and code that a
> website developer would need to write; from there, it's a matter of looking
> at what tasks the website developer needs to do often, and finding
> abstractions and APIs to make that job easier. That's where Django, and
> it's libraries for URL routing, database interaction, form processing and
> so on comes in. If you try and write a non-trivial website to the "bare
> metal" of WSGI, you'll very quickly see what Django (or any other web
> framework, for that matter) is providing for you.
>
> Yours,
> Russ Magee %-)
>
> On Mon, Jun 10, 2013 at 10:10 PM, Nafiul Islam wrote:
>
>> Hi!
>>
>> I've been using django for a little bit, and I gotta say I love the
>> framework. But here's the thing, I don't know how it works. How everything
>> fits together. So, what I wanted to ask is how does it all work? Say you
>> have a server, and you have Python installed on it. How would you go about
>> making a simple hello world web page, without django?
>>
>> I would be grateful to any link to a comprehensive resource, that shows
>> you how to make a simple Hello World webpage, from how you install software
>> that you need to writing pure python (without a framework) that can handle
>> requests, and work with databases.
>>
>> I guess, what I'm asking is how do you make a very very basic website
>> using Python, from start to finish on a server?
>>
>> --
>> 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.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/VHvM1uOGmio/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
Kind Regards,

Quazi Nafiul Islam

-- 
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.




Re: How does it all work

2013-06-10 Thread Gamesbrainiac
@Eraldo: Thanks for the reply. I've read that part of the Django book, but
it does little to explain how Django itself works, because it uses WSGI not
CGI. After this excursion, I plan to see how Django handles connections and
such, so I'll be diving into the Django libraries.

Thanks for this, I appreciate it.


On 11 June 2013 07:44, Eraldo Helal  wrote:

> I think.. I found what you are looking for:
> http://www.djangobook.com/en/2.0/chapter01.html
> Under the heading "The MVC Design Pattern"..
> there is a nice example of a simple CGI script using python (no django).
>
> Greetings from Linz (Austria)
> Eraldo
>
> On Monday, June 10, 2013 4:10:51 PM UTC+2, Nafiul Islam wrote:
>>
>> Hi!
>>
>> I've been using django for a little bit, and I gotta say I love the
>> framework. But here's the thing, I don't know how it works. How everything
>> fits together. So, what I wanted to ask is how does it all work? Say you
>> have a server, and you have Python installed on it. How would you go about
>> making a simple hello world web page, without django?
>>
>> I would be grateful to any link to a comprehensive resource, that shows
>> you how to make a simple Hello World webpage, from how you install software
>> that you need to writing pure python (without a framework) that can handle
>> requests, and work with databases.
>>
>> I guess, what I'm asking is how do you make a very very basic website
>> using Python, from start to finish on a server?
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/VHvM1uOGmio/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
Kind Regards,

Quazi Nafiul Islam

-- 
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.




is possible to store a value of a field in a proxy model

2013-06-10 Thread carlos
Hi
is possible to store a value of a field in a proxy model

I explain how models are

class Model1(models.Model):
title = models.Charfield(blabla)

class Model2(models.Model):
name = models.CharField(blabla)
fk_field = models.FK(Model1)

and then important thing

class ItemModel(Model1)
class Meta:
proxy = True

def save(self, *args, **kwargs):

# I would like to do something like that is possible?
#what would be the right thing to do?

*self.title = Model2.name*

super(ItemModel, self).save(*args, **kwargs)

will be possible to do that?? someone could explain if possible!! yes or
not :/

thank

-- 
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.