should we develop apps based on urls?

2013-04-10 Thread surya
I have an unstructured idea in my to implement (say a weekend hack).

The thing here is, how to give it a structure.. 

1. should I first define URLs and then divide apps based on it?
2. or something else.

I want to develop a ratings site.. where people rate on product X.. 

I like to divide apps in this way

pages (have static pages if at all present)
submissions (stores products, and ratings)
persons (user accounts etc..)

etc.. 

any suggestions.

Its like I am spending more time on designing things than writing code. why 
is that happening and how to fix it.

-- 
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: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:48, Lachlan Musicman  wrote:
>>> On 11/04/2013 2:02pm, Lachlan Musicman wrote:
>>>
>>> Inside your test class before writing tests you can have ...
>>>
>>> def setUp(self):
>>>
>>> jack = MaleAccountFactory()
>>> jill = FemaleAccountFactory()
>>>
>>> def tearDown(self):
>>> ( here delete jack and jill )

I have it working as per - thanks for advise Shawn and Mike


--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith

-- 
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: New to testing

2013-04-10 Thread Mike Dewhirst

On 11/04/2013 2:42pm, Lachlan Musicman wrote:

On 11 April 2013 14:23, Mike Dewhirst  wrote:

On 11/04/2013 2:02pm, Lachlan Musicman wrote:

Inside your test class before writing tests you can have ...

 def setUp(self):

 jack = MaleAccountFactory()
 jill = FemaleAccountFactory()

 def tearDown(self):
 ( here delete jack and jill )


If you have those two methods named exactly as above, setUp() will be called
immediately before every test and tearDown() after every test.


Thanks for the response. I've added these two methods as you
suggested, and now I'm getting

Ran 0 tests in 0.000s


Try this ...

import unittest

class TestThing(unittest.TestCase):

def setUp(self):
print('setting up')

def tearDown(self):
print('tearing down')

def test_thing2(self):
self.assertEqual(2, 2)

def test_thing4(self):
self.assertEqual(2, 2)

def test_thing6(self):
self.assertEqual(2, 2)

if __name__ == "__main__":
unittest.main()




?

cheers
L.




def test_parent_account_creation(self):



# next two lines should not be here


  jack = MaleAccountFactory()
  jill = FemaleAccountFactory()

  jack.parents.add(jill)
  self.assertIn(jill, jack.parents.all())
  #we should check that the reverse relationship has been created too
  self.assertIn(jack, jill.children.all())


This works. Great.

But now I want to create a test for parent *removal*. So I tried this
without success:

def test_parent_account_removal(self):


# this line should not be here but it wouldn't work
# anyway because it should be self.test_parent_account_creation()


  test_parent_account_creation()

  # now we should remove jack as jill's parent
  jack.parents.remove(jill)
  self.assertNotIn(jill, jack.parents.all())
  # and test that jill is not jack's child
  self.assertNotIn(jack, jill.children.all())


Is there a way of calling previous tests to stay DRY? Or am I being a
fool and should just suck up the copy and paste?

Alternatively, am I being too obsessively modular and should I just
put the removal into the first test and change it's title to
test_parent_account(self)?

cheers
L.


--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.


http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith



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






--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith



--
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: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:42, Lachlan Musicman  wrote:
> On 11 April 2013 14:23, Mike Dewhirst  wrote:
>> On 11/04/2013 2:02pm, Lachlan Musicman wrote:
>>
>> Inside your test class before writing tests you can have ...
>>
>> def setUp(self):
>>
>> jack = MaleAccountFactory()
>> jill = FemaleAccountFactory()
>>
>> def tearDown(self):
>> ( here delete jack and jill )
>>
>>
>> If you have those two methods named exactly as above, setUp() will be called
>> immediately before every test and tearDown() after every test.
>
> Thanks for the response. I've added these two methods as you
> suggested, and now I'm getting
>
> Ran 0 tests in 0.000s
>
> ?


My fault, ignore.

cheers
L.
--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith

-- 
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: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:23, Mike Dewhirst  wrote:
> On 11/04/2013 2:02pm, Lachlan Musicman wrote:
>
> Inside your test class before writing tests you can have ...
>
> def setUp(self):
>
> jack = MaleAccountFactory()
> jill = FemaleAccountFactory()
>
> def tearDown(self):
> ( here delete jack and jill )
>
>
> If you have those two methods named exactly as above, setUp() will be called
> immediately before every test and tearDown() after every test.

Thanks for the response. I've added these two methods as you
suggested, and now I'm getting

Ran 0 tests in 0.000s

?

cheers
L.

>
>> def test_parent_account_creation(self):
>
>
># next two lines should not be here
>
>>  jack = MaleAccountFactory()
>>  jill = FemaleAccountFactory()
>>
>>  jack.parents.add(jill)
>>  self.assertIn(jill, jack.parents.all())
>>  #we should check that the reverse relationship has been created too
>>  self.assertIn(jack, jill.children.all())
>>
>>
>> This works. Great.
>>
>> But now I want to create a test for parent *removal*. So I tried this
>> without success:
>>
>>def test_parent_account_removal(self):
>
># this line should not be here but it wouldn't work
># anyway because it should be self.test_parent_account_creation()
>
>>  test_parent_account_creation()
>>
>>  # now we should remove jack as jill's parent
>>  jack.parents.remove(jill)
>>  self.assertNotIn(jill, jack.parents.all())
>>  # and test that jill is not jack's child
>>  self.assertNotIn(jack, jill.children.all())
>>
>>
>> Is there a way of calling previous tests to stay DRY? Or am I being a
>> fool and should just suck up the copy and paste?
>>
>> Alternatively, am I being too obsessively modular and should I just
>> put the removal into the first test and change it's title to
>> test_parent_account(self)?
>>
>> cheers
>> L.
>>
>>
>> --
>> The new creativity is pointing, not making. Likewise, in the future,
>> the best writers will be the best information managers.
>>
>>
>> http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith
>>
>
> --
> 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.
>
>



--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith

-- 
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: New to testing

2013-04-10 Thread Mike Dewhirst

On 11/04/2013 2:02pm, Lachlan Musicman wrote:

Hi

I'm new to testing. Not to Django. To my shame.

I'm trying to test some m2m signals connections, so I have a



Inside your test class before writing tests you can have ...

def setUp(self):
jack = MaleAccountFactory()
jill = FemaleAccountFactory()

def tearDown(self):
( here delete jack and jill )


If you have those two methods named exactly as above, setUp() will be 
called immediately before every test and tearDown() after every test.



def test_parent_account_creation(self):


   # next two lines should not be here

 jack = MaleAccountFactory()
 jill = FemaleAccountFactory()

 jack.parents.add(jill)
 self.assertIn(jill, jack.parents.all())
 #we should check that the reverse relationship has been created too
 self.assertIn(jack, jill.children.all())


This works. Great.

But now I want to create a test for parent *removal*. So I tried this
without success:

   def test_parent_account_removal(self):

   # this line should not be here but it wouldn't work
   # anyway because it should be self.test_parent_account_creation()

 test_parent_account_creation()

 # now we should remove jack as jill's parent
 jack.parents.remove(jill)
 self.assertNotIn(jill, jack.parents.all())
 # and test that jill is not jack's child
 self.assertNotIn(jack, jill.children.all())


Is there a way of calling previous tests to stay DRY? Or am I being a
fool and should just suck up the copy and paste?

Alternatively, am I being too obsessively modular and should I just
put the removal into the first test and change it's title to
test_parent_account(self)?

cheers
L.


--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith



--
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: New to testing

2013-04-10 Thread Shawn Milochik
Create a function with a name that *doesn't* start with "test" and you
can easily do what you want.

Then both tests can call it.

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




New to testing

2013-04-10 Thread Lachlan Musicman
Hi

I'm new to testing. Not to Django. To my shame.

I'm trying to test some m2m signals connections, so I have a

def test_parent_account_creation(self):
jack = MaleAccountFactory()
jill = FemaleAccountFactory()

jack.parents.add(jill)
self.assertIn(jill, jack.parents.all())
#we should check that the reverse relationship has been created too
self.assertIn(jack, jill.children.all())


This works. Great.

But now I want to create a test for parent *removal*. So I tried this
without success:

  def test_parent_account_removal(self):
test_parent_account_creation()

# now we should remove jack as jill's parent
jack.parents.remove(jill)
self.assertNotIn(jill, jack.parents.all())
# and test that jill is not jack's child
self.assertNotIn(jack, jill.children.all())


Is there a way of calling previous tests to stay DRY? Or am I being a
fool and should just suck up the copy and paste?

Alternatively, am I being too obsessively modular and should I just
put the removal into the first test and change it's title to
test_parent_account(self)?

cheers
L.


--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith

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




XMLRPC semms not work in 1.5.1

2013-04-10 Thread yillkid
Hi all

I use XMLRPC with this link: https://code.djangoproject.com/wiki/XML-RPC
and work fine in Django 1.4.3

But now I upgrade to 1.5.1 but not work
error message as below: http://paste.ubuntu.com/5697269/

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




Custom Commands?

2013-04-10 Thread Mark Lybrand
I am at a loss how to get custom commands working in my Django project.

I am on Windows 7, running Python 2.7.3, Django 1.4.5.  When I try to make 
my "hello world" command, I get an unknown command error.

I have the following structure:

│   manage.py
│
├───mysite
│   │   settings.py
│   │   settings.pyc
│   │   urls.py
│   │   urls.pyc
│   │   wsgi.py
│   │   wsgi.pyc
│   │   __init__.py
│   │   __init__.pyc
│   │
│   └───management
│   │   __init__.py
│   │
│   └───commands
│   x.py
│   __init__.py


And this is the code of my command:

from optparse import make_option
from django.core.management.base import BaseCommand, CommandError

class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--long', '-l', dest='long',
help='Help for the long options'),
)
help = 'Help text goes here'

def handle(self, **options):
 print "This is a command"

When I run

python manage.py x

I get:

Unknown command: 'x'
Type 'manage.py help' for usage.

Where should begin looking to troubleshoot this issue?

Thanks in advance...

Mark :)


-- 
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 not disconnecting from database after a request

2013-04-10 Thread Lewis Sobotkiewicz
Seems to be caused by Django not sending the "request_finished" signal, 
which is also bizarre, unexpected behaviour.

On Wednesday, April 10, 2013 11:47:52 AM UTC-7, Lewis Sobotkiewicz wrote:
>
> Thanks, but I'm not using the Django development version. Apparently 
> persistent DB conns will be a feature of Django 1.6, but not 1.5.1.
>
> I'm using RDS with MySQL 5.5.27. The only thing I've changed about the 
> infrastructure is upgrading Django to 1.5.1. If I downgrade to 1.4.5, DB 
> connections are released after the request, as expected.
>
> On Wednesday, April 10, 2013 2:24:05 AM UTC-7, Andrey Kostakov wrote:
>>
>>
>> https://docs.djangoproject.com/en/dev/ref/databases/#persistent-connections 
>>
>> On Wed, Apr 10, 2013 at 2:59 AM, Lewis Sobotkiewicz  
>> wrote: 
>> > Hi all, 
>> > 
>> > I'm seeing some strange, undocumented behaviour when upgtrading to 
>> Django 
>> > 1.5.1. I notice that it is holding onto MySQL connections after request 
>> > processing completes, where Django 1.4.5 disconnected after every 
>> request. 
>> > 
>> > Any idea what could be happening? 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. 
>> > 
>> > 
>>
>>
>>
>> -- 
>> Best regards, 
>> Andrey Kostakov 
>> Email/Gtalk: b...@dzen.ws 
>>
>

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




request_finished signal not being called with Django 1.5.1 with uwsgi

2013-04-10 Thread Lewis Sobotkiewicz
Hi there,

I'm noticing some strange behaviour with Django 1.5.1 and uwsgi - The 
builtin signal django.core.signals.request_finished isn't being triggered. 
I've tried various versions of uwsgi, and they all have the same behaviour.

Also, when I downgrade to Django 1.4.5, the normal behaviour resumes.

Any idea why this might be happening? It's causing my DB connections to 
remain open after a request.

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




URL is successfully reversed and then not found

2013-04-10 Thread jondbaker
I'm working on tests for a Django app that I'm contributing to the 
community (https://github.com/jondbaker/django-critique) and have become 
stuck on a problem. After I perform a GET request for the app's sole URL 
within my integration tests:

response = self.client.get(reverse("critique_create"))

The response.status_code is 404 and the content:

"The requested URL /critique/create/ was not found on this server."

As you can see, the URL is being successfully reversed, but then it 404s. 
I've created a separate test URL/view/template that plays nicely, but I 
can't figure out what's going on with the /critique/create/ URL.

Any help would be greatly appreciated.

*tests/urls.py*
try:
from django.conf.urls import include, patterns, url
except ImportError:  # django < 1.4
from django.conf.urls.default import include, patterns, url

from .views import TestView

urlpatterns = patterns(
"",
url(r"^test/$", TestView.as_view(), name="test_view"),
url(r"^", include("critique.urls")),
)

*critique/urls.py*
try:
from django.conf.urls import patterns, url
except ImportError:  # django < 1.4
from django.conf.urls.default import patterns, url

urlpatterns = patterns(
"",
url(r"^critique/create/$", "critique.views.create", 
name="critique_create"),
)

-- 
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: sql union all to def()

2013-04-10 Thread Rafael E. Ferrero
I think that you can get all your table data on a Django View and then make
an algorithm to have your data, maybe using a recursive function.

Like i understand you are putting together every single field in one... so
your first result its one field (val) then you are counting all similar
value, so
1- create an array and get all number_1
2- append to previus object all number_2
3- repeat for every field
4- order ascending or descending the array
5- take first element and compare with others and count equal values and
then delete that counted value (this reduce the extention of your array)
6- move one position and repeat and proced, like point 5, from them.
7- do that to the last element in the array
This is a quick aproach... but you have an idea now. You can do it better
than me.

I dont say that is the best choice... maybe for this particulary example
using the store procedure its better ( for the health of the server cpu :P )

I dont know if python or django have a function to resolve your
requirements.

See ya


2013/4/10 Tommy 

> Hi.
>
> I have the SQL query below that works in PostgreSQL.
>
> I am attempting to learn to draw graphs/trend lines to a web page in the
> Django Framework
>
> Rather than use raw SQL queries I would like to learn how to get the same
> results in a Django purists fashion.  I have searched but I cannot find a
> solution or a solution may exist but I do not understand enough to
> recognize.
>
> Is this possible?  If so, how?
>
> select val, count(*) as valcount
>  from (
>  select number_1 as val from xscale
>  union all
>  select number_2 as val from xscale
> union all
>  select number_3 as val from xscale
> union all
>  select number_4 as val from xscale
> union all
>  select number_5 as val from xscale
> union all
>  select number_6 as val from xscale
>   ) as baseview
>  group by val order by valcount desc, val asc;
>
> models.py
>
> from django.db import models
>
> class XScale(models.Model):
> gate = models.TextField(null=False)
> number_1 = models.IntegerField(null=False)
> number_2 = models.IntegerField(null=False)
> number_3 = models.IntegerField(null=False)
> number_4 = models.IntegerField(null=False)
> number_5 = models.IntegerField(null=False)
> number_6 = models.IntegerField(null=False)
>
> class Meta:
> db_table = u'xscale'
>
> def __unicode__(self):
> return unicode (self.gate)
>
> Thanks for your help,
> Tommy.
>
>  --
> 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.
>
>
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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: Accessing Django project models from CGI

2013-04-10 Thread Mark Jones
Can't imagine why you would want to do this via CGI, it can't perform very 
well.  There is a TON of stuff that gets setup during initialization for 
wsgi/runserver, etc..

Syntax wise your import is way off since your models do not live in the 
Django folder, you can't import them like this.  I'd take a look at 
deploying mod_wsgi and running the app there.

On Sunday, April 7, 2013 10:11:00 PM UTC-5, Pradeep Kumar wrote:
>
> Hi,
>
> I am creating a widget for one of our projects for the first time. The 
> script file used calls a python file in cgi-bin/widget.py 
>
> Is there a way I can access models of a particular project in widget.py 
> using import ?
>
> say : from django.*projectname.appname.models* import *
>
>
> I tried relocating the cgi-bin/ folder inside one of the project folders 
> but it wasn't recognizing the import as it didn't recognize the modules. 
>
>
> Currently I am using REST api provided by tastypie and getting the 
> required info used for widget. Is there a better way to do it? 
>
>
> Please let me know the available options for creating such widget backend 
> scripts and any good links will be helpful (found very few but none 
> addressing my issue).
>
>
>
> Thanks,
> Pradeep
>

-- 
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: facebook/twitter sharing, and testing

2013-04-10 Thread Bill Freeman
On Wed, Apr 10, 2013 at 11:55 AM, sara ismail wrote:

> can anyone help me?!
>
> On Wednesday, April 10, 2013 4:50:51 PM UTC+2, sara ismail wrote:
>>
>> im new to django, and i am working on a project, a selling and buying
>> website, where a user can post about a product that he/she wants to sell,
>> and my part right now is sharing posts from the site with facebook, and
>> twitter. i was wondering how to test such a thing, like unit testing,
>> knowing that i implemented front end only, just an HTML file.
>> and i have another question, how can i take a post url, and make it the
>> link to be shared with facebook/twitter, for example, a facebook/twitter
>> share button is located under or next to each post, and each button when
>> pressed on, redirects to fb sharing, and has that specific post's link
>> appearing. how to do that?
>>
>> check the attached image, instead of facebook dialogs and the flowers
>> img, i wasnt the post link, and probably an img too.
>>
>> thanks in advance!
>
>  I see three possibilities:

1. Test by posting to dummy twitter and facebook accounts, and the test
code then as to follow the tweets/posts to see that they get there.
Assures that things are working, but check the terms of service for these
providers.  In particular, see if they have some kind of sandbox mode
(though differences between sandbox and live modes have been a problem for
me with some services.

2. Test against your own internal clone of the services.  Now you have
extra stuff to write, test, and maintain.

3. Test against a mock network connection and simply capture the data and
compare it to what you expect.  Getting this working doesn't assure that it
will work on the site, but once you have stuff working live you can do some
captures to have better data to test against.

-- 
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 use a list in a django model

2013-04-10 Thread Brian Schott
Cody,

This is a REALLY large list, so I recommend at this level of detailed question 
to StackOverflow.  It is a great resource and lots of Django developers like to 
show off and write your code for you sometimes :-).

Short answers:
There are ways to do custom inline forms:
http://stackoverflow.com/questions/1559690/custom-form-in-inline-form
and  filtering the queryset many-to-many choices:
http://stackoverflow.com/questions/291945/how-do-i-filter-foreignkey-choices-in-a-django-modelform

Also, you can just add a module foreign key reference to Choice as well and set 
a unique_together constraint on choice + module.  There are tradeoffs in all of 
these approaches.

Brian

Brian Schott
bfsch...@gmail.com



On Apr 10, 2013, at 4:30 PM, Cody Scott  wrote:

> I also want to have the same question in multiple quizzes. But the count for 
> each option should be dependent on the Quiz. I can do the same thing to Quiz 
> in the admin and add Questions Inline but then to add Choices to the 
> Questions I need to go to the question panel and there will be a lot of 
> duplicate questions and it will hard to tell which question is for which quiz.
> 
> I'm not even adding the Choices to the admin because there will be so many 
> duplicates, but I can't not add Question to the admin because I still need to 
> set choices.
> 
> Is there a way to Inline 2 steps? So that I can set Choices for a Question 
> when I am making a Quiz?
> 
> On Wednesday, 10 April 2013 13:38:14 UTC-4, Cody Scott wrote:
> I am trying to store questions in a database.
> I don't to set a fixed number of options for the question, some questions 
> could have 4 or 2 or 5.
> 
> Currently I am using a ManyToManyField to a table that just contains a 
> CharField.
> This works but creating an option requires making another Choice object and 
> selecting that, also when you want to select a Choice that has already been 
> created you have to use that little box in the admin and it doesn't scale 
> when you have hundreds of options.
> 
> Even if I wanted to have 4 options every time what is the recommended way 
> without having four CharFields?
> 
> class Choice(models.Model):
> choice = models.CharField(max_length=255)
> def __unicode__(self):
> return self.choice
>  
> #multiple choice question
> class Question(models.Model):
> question = models.CharField(max_length=64)
> answer = models.CharField(max_length=255)
> choices = models.ManyToManyField(Choice, related_name='questions', 
> verbose_name='options')
> module = models.ForeignKey('Module', related_name='questions')
>  
> times_correct = models.IntegerField(editable=False, default=0)
> times_total = models.IntegerField(editable=False, default=0)
>  
> def _get_average(self):
> "Returns the average in percent"
> if self.times_total != 0:
> return (self.times_correct / float(self.times_total))*100
> return 0.0
> average = property(_get_average)
>  
> def __unicode__(self):
> return self.question
> 
> -- 
> 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: django-sagepay example

2013-04-10 Thread Bill Freeman
On Wed, Apr 10, 2013 at 3:35 PM, Mario Gudelj wrote:

> What exactly are you proposing, Bill? What's the problem with simply
> passing the credit card data to the gateway if you do it over SSL and not
> store it? Are you saying that you're only purchasing on sites with
> non-seamless gateways?
>

I have no cconfidence that your gateway hasn't been rooted, let alone that
you have correctly configured SSL/TLS.  Seamless is just a buzzword.  There
are always several steps to an on-line purchase.

>
>
>

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




sql union all to def()

2013-04-10 Thread Tommy
Hi.

I have the SQL query below that works in PostgreSQL.

I am attempting to learn to draw graphs/trend lines to a web page in the 
Django Framework

Rather than use raw SQL queries I would like to learn how to get the same 
results in a Django purists fashion.  I have searched but I cannot find a 
solution or a solution may exist but I do not understand enough to 
recognize.

Is this possible?  If so, how?  

select val, count(*) as valcount
 from (
 select number_1 as val from xscale
 union all
 select number_2 as val from xscale
union all
 select number_3 as val from xscale
union all
 select number_4 as val from xscale
union all
 select number_5 as val from xscale
union all
 select number_6 as val from xscale
  ) as baseview
 group by val order by valcount desc, val asc;

models.py

from django.db import models

class XScale(models.Model):
gate = models.TextField(null=False)
number_1 = models.IntegerField(null=False)
number_2 = models.IntegerField(null=False)
number_3 = models.IntegerField(null=False)
number_4 = models.IntegerField(null=False)
number_5 = models.IntegerField(null=False)
number_6 = models.IntegerField(null=False)

class Meta:
db_table = u'xscale'

def __unicode__(self):
return unicode (self.gate)

Thanks for your help,
Tommy.

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




Nested Result

2013-04-10 Thread Carlos Eduardo Sotelo Pinto
Hi people

I have three different apps on my project

- vehicles
- gpstracking
- customer

I need a result like

- Site 1
-- Customer 1
 Vehicle | Last Track

but I dont know how to do and google is not helping me so much
I know I must so a filtered on view but I have gooten lost

Please give me a hand


--
Carlos Eduardo Sotelo Pinto | http://carlossotelo.com | csotelo@twitter
GNU Linux Admin | PHP Senior Web Developer
Mobil: RPC (Claro)+51, 958194614 | Mov: +51, 959980794
GTalk: carlos.sotelo.pi...@gmail.com | Skype: csotelop
MSN: carlos.sotelo.pi...@gmail.com | Yahoo: csotelop
GNULinux RU #379182 | GNULinux RM #277661
GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B

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




models.py
Description: Binary data


models.py
Description: Binary data


models.py
Description: Binary data


Re: django-sagepay example

2013-04-10 Thread Bill Freeman
On Wed, Apr 10, 2013 at 3:50 PM, sparky  wrote:

> @ke1g also there are very high compliance standards in the UK. You have
> to be complaint or the merchants
> get on your case.
> you have to have port scans, SSL and some level of PCI DSS to take cards
> on your site with sagepay.
>
>
> just my 2p
>
> That's as may be.  Many folks reading this stuff will try to apply it in
far less secure environments.

Seamless versus secure is, to many, an obvious tradeoff, but I suspect the
obvious answer differs among our community.

Using a tool that PCI compliant folks use does not make you PCI compliant.
As the aphorism goes, security is hard.

-- 
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-sagepay example

2013-04-10 Thread Bill Freeman
On Wed, Apr 10, 2013 at 3:22 PM, sparky  wrote:

> @ke1g thats a very sweeping generalisation.
>
> personally, we are PCI DSS level 2 compliant, have scans and all data is
> transmitted using SSL. we are resellers
> we also NEVER store card details EVER only transmit! I'm a newbie to
> Django but have implemented
> sagepay on 3 other languages on sites which takes thousands a day over the
> last 5 years (when it was Protx)
>
> have you ever used sagepay? you don't need to store card details they also
> offer VSP form and server.
>

If the info passes through RAM on your server, and somebody roots it, they
can capture the information.  If I redirect the user to Authorize.net to
collect the CC info, then I can feel relatively safe deploying to the
cloud, or wherever most folks tempted to use these tools are going to
deploy.

-- 
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 use a list in a django model

2013-04-10 Thread Cody Scott


Also if a Question changes and it is used in multiple quizzes all question 
instances will also need to change.

I think I am missing something. Here is my models.py


class Product(models.Model):
name = models.CharField(max_length=256, unique=True)

def __unicode__(self):
return self.name
class Topic(models.Model):
name = models.CharField(max_length=256)
product = models.ForeignKey('Product', related_name='topics')

class Meta:
unique_together = ("name", "product")

def __unicode__(self):
return self.name
class Module(models.Model):
name = models.CharField(max_length=256, unique=True)
threshold = models.IntegerField()
topic = models.ForeignKey('Topic', related_name='modules')

def __unicode__(self):
return self.name
class Choice(models.Model):
question = models.ForeignKey('Question', related_name='choices')
choice = models.CharField(max_length=255)
order = models.IntegerField(default=0)
count = models.IntegerField(default=0, editable=False)
is_correct = models.BooleanField(default=False)

def __unicode__(self):
return self.choice
#multiple choice questionclass Question(models.Model):
quiz = models.ForeignKey('Quiz', related_name='questions')
question = models.CharField(max_length=64)

module = models.ForeignKey('Module', related_name='questions')

times_correct = models.IntegerField(editable=False, default=0)
times_total = models.IntegerField(editable=False, default=0)

def _get_average(self):
"Returns the average in percent"
if self.times_total != 0:
return (self.times_correct / float(self.times_total))*100
return 0.0
average = property(_get_average)

def __unicode__(self):
return self.question
class Quiz(models.Model):
#id = models.UUIDField(primary_key=True)
name = models.CharField(max_length=64)
#questions = models.ManyToManyField(Question)
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, 
related_name="quizzes")

#questions = models.ManyToManyField(QuestionManager, null=True, 
related_name="quiz")

class Meta:
verbose_name_plural = "quizzes"

def __unicode__(self):
return self.name


On Wednesday, 10 April 2013 16:30:20 UTC-4, Cody Scott wrote:
>
> I also want to have the same question in multiple quizzes. But the count 
> for each option should be dependent on the Quiz. I can do the same thing to 
> Quiz in the admin and add Questions Inline but then to add Choices to the 
> Questions I need to go to the question panel and there will be a lot of 
> duplicate questions and it will hard to tell which question is for which 
> quiz.
>
> I'm not even adding the Choices to the admin because there will be so many 
> duplicates, but I can't not add Question to the admin because I still need 
> to set choices.
>
> Is there a way to Inline 2 steps? So that I can set Choices for a Question 
> when I am making a Quiz?
>
> On Wednesday, 10 April 2013 13:38:14 UTC-4, Cody Scott wrote:
>>
>> I am trying to store questions in a database.
>> I don't to set a fixed number of options for the question, some questions 
>> could have 4 or 2 or 5.
>>
>> Currently I am using a ManyToManyField to a table that just contains a 
>> CharField.
>> This works but creating an option requires making another Choice object 
>> and selecting that, also when you want to select a Choice that has already 
>> been created you have to use that little box in the admin and it doesn't 
>> scale when you have hundreds of options.
>>
>> Even if I wanted to have 4 options every time what is the recommended way 
>> without having four CharFields?
>>
>> class Choice(models.Model):
>> choice = models.CharField(max_length=255)
>> def __unicode__(self):
>> return self.choice
>>  #multiple choice questionclass Question(models.Model):
>> question = models.CharField(max_length=64)
>> answer = models.CharField(max_length=255)
>> choices = models.ManyToManyField(Choice, related_name='questions', 
>> verbose_name='options')
>> module = models.ForeignKey('Module', related_name='questions')
>>  
>> times_correct = models.IntegerField(editable=False, default=0)
>> times_total = models.IntegerField(editable=False, default=0)
>>  
>> def _get_average(self):
>> "Returns the average in percent"
>> if self.times_total != 0:
>> return (self.times_correct / float(self.times_total))*100
>> return 0.0
>> average = property(_get_average)
>>  
>> def __unicode__(self):
>> return self.question
>>
>>

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

Re: How to use a list in a django model

2013-04-10 Thread Cody Scott
I also want to have the same question in multiple quizzes. But the count 
for each option should be dependent on the Quiz. I can do the same thing to 
Quiz in the admin and add Questions Inline but then to add Choices to the 
Questions I need to go to the question panel and there will be a lot of 
duplicate questions and it will hard to tell which question is for which 
quiz.

I'm not even adding the Choices to the admin because there will be so many 
duplicates, but I can't not add Question to the admin because I still need 
to set choices.

Is there a way to Inline 2 steps? So that I can set Choices for a Question 
when I am making a Quiz?

On Wednesday, 10 April 2013 13:38:14 UTC-4, Cody Scott wrote:
>
> I am trying to store questions in a database.
> I don't to set a fixed number of options for the question, some questions 
> could have 4 or 2 or 5.
>
> Currently I am using a ManyToManyField to a table that just contains a 
> CharField.
> This works but creating an option requires making another Choice object 
> and selecting that, also when you want to select a Choice that has already 
> been created you have to use that little box in the admin and it doesn't 
> scale when you have hundreds of options.
>
> Even if I wanted to have 4 options every time what is the recommended way 
> without having four CharFields?
>
> class Choice(models.Model):
> choice = models.CharField(max_length=255)
> def __unicode__(self):
> return self.choice
>  #multiple choice questionclass Question(models.Model):
> question = models.CharField(max_length=64)
> answer = models.CharField(max_length=255)
> choices = models.ManyToManyField(Choice, related_name='questions', 
> verbose_name='options')
> module = models.ForeignKey('Module', related_name='questions')
>  
> times_correct = models.IntegerField(editable=False, default=0)
> times_total = models.IntegerField(editable=False, default=0)
>  
> def _get_average(self):
> "Returns the average in percent"
> if self.times_total != 0:
> return (self.times_correct / float(self.times_total))*100
> return 0.0
> average = property(_get_average)
>  
> def __unicode__(self):
> return self.question
>
>

-- 
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 use a list in a django model

2013-04-10 Thread Cody Scott
Perfect Answer! I must have been sleeping when I did that part of the 
tutorial. Now I understand it and even learned about actions and this is 
what my duplicate action looks like

def duplicate_questions(modeladmin, request, queryset):
for obj in queryset:
new_question = Question(question=obj.question, module=obj.module)
new_question.save()
for choice in obj.choices.all():
new_choice = Choice(question=new_question, 
choice=choice.choice, order=choice.order, is_correct=choice.is_correct)
new_choice.save()
duplicate_questions.short_description = "Duplicate Selected Questions"


On Wednesday, 10 April 2013 15:15:04 UTC-4, BFSchott wrote:
>
> You can create and edit choices right in the Question admin view.  You can 
> even control how many blank slots to show by default.  Go look at 
> ChoiceInline admin here in the tutorial:
> https://docs.djangoproject.com/en/dev/intro/tutorial02/
>
> The next step would be to create an admin action on Question to duplicate 
> the question and its choices.
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/
>
> That way, your workflow is duplicate a question, edit on a single page, 
> hit save.
>
> Brian Schott
> bfsc...@gmail.com 
>
>
>  
> On Apr 10, 2013, at 3:02 PM, Cody Scott  
> wrote:
>
> I like the is_correct and the count attributes!
>
> The problem with that it is hard to make a quiz in the admin section. You 
> create a quiz and a question but then you have to go to the choice section 
> and create choices for the question. And even if you have the same choice 
> in two questions you need to create the choice multiple times.
>
> It would be nice to have text fields and be able to say add a 5th choice, 
> and just enter text. It seems easier than changing forms and selecting an 
> option from a large list, or even in your case creating each choice for a 
> quiz.
>
> Is there a way to have the admin link from Question to Choice in this 
> configuration?
>
> On Wednesday, 10 April 2013 14:43:54 UTC-4, BFSchott wrote:
>>
>> Is a many-to-many what you really want?  How common are the choices and 
>> suppose someone goes in an edits one of the choices and suddenly it doesn't 
>> match up right with a different linked question.  It might make sense to 
>> use a reverse foreign key one-to-many relationship and provide a mechanism 
>> to duplicate a question, including its member choices.  That way you could 
>> add some statistics on each choice unique to a question.
>>
>> Several possible paths depending on how you want to go.
>>
>> 1.  You could just use a reverse foreign key and have a one-to-many 
>> relationship.
>>
>> class Choice(models.Model):
>> question = models.ForeignKey('Question', related_name='choices')
>> choice = models.CharField(max_length=255)
>> index = models.IntegerField(default=0)  # in case you want order_by 
>> filtering
>> count = models.IntegerField(default=0) # in case you want to count number 
>> of times this is selected right or wrong
>> is_correct = models.BooleanField(default=False) # boolean flag replaces 
>> "answer"
>>
>> class Question(models.Model):
>>   question = models.CharField(max_length=64)
>>   module = 
>>  
>> def times_correct(self):
>> return 
>> self.choices.objects.filter(is_correct=True).aggregate(Sum('count'))
>>
>> def times_total(self):
>> return self.choices.objects.aggregate(Sum('count'))
>>
>>
>> Then in the admin, you create a table inline admin and just add unique 
>> entries.
>>
>>
>> 2. Encode the thing as a JSON list and store in a JSONField
>> https://github.com/derek-schaefer/django-json-field
>>
>> 3. There are several flavors of ListField out there:
>> http://djangosnippets.org/snippets/1491/
>>
>>
>>
>> Brian Schott
>> bfsc...@gmail.com
>>
>>
>>  
>> On Apr 10, 2013, at 1:38 PM, Cody Scott  wrote:
>>
>> I am trying to store questions in a database.
>> I don't to set a fixed number of options for the question, some questions 
>> could have 4 or 2 or 5.
>>
>> Currently I am using a ManyToManyField to a table that just contains a 
>> CharField.
>> This works but creating an option requires making another Choice object 
>> and selecting that, also when you want to select a Choice that has already 
>> been created you have to use that little box in the admin and it doesn't 
>> scale when you have hundreds of options.
>>
>> Even if I wanted to have 4 options every time what is the recommended way 
>> without having four CharFields?
>>
>> class Choice(models.Model):
>> choice = models.CharField(max_length=255)
>> def __unicode__(self):
>> return self.choice
>>  #multiple choice questionclass Question(models.Model):
>> question = models.CharField(max_length=64)
>> answer = models.CharField(max_length=255)
>> choices = models.ManyToManyField(Choice, related_name='questions', 
>> verbose_name='options')
>> module = models.ForeignKey('Module', 

Re: django-sagepay example

2013-04-10 Thread Mario Gudelj
What exactly are you proposing, Bill? What's the problem with simply
passing the credit card data to the gateway if you do it over SSL and not
store it? Are you saying that you're only purchasing on sites with
non-seamless gateways?


On 11 April 2013 05:22, sparky  wrote:

> @ke1g thats a very sweeping generalisation.
>
> personally, we are PCI DSS level 2 compliant, have scans and all data is
> transmitted using SSL. we are resellers
> we also NEVER store card details EVER only transmit! I'm a newbie to
> Django but have implemented
> sagepay on 3 other languages on sites which takes thousands a day over the
> last 5 years (when it was Protx)
>
> have you ever used sagepay? you don't need to store card details they also
> offer VSP form and server.
>
>
> On Wednesday, April 10, 2013 1:15:17 PM UTC+1, ke1g wrote:
>
>> An please, indicate on your site that the credit card number will go
>> through your site, so that I can know to never buy anything there.
>>
>> I suspect that I can count on my fingers and toes the number of web
>> developers in the world who have the knowledge, patience, and diligence to
>> securely handle credit card information.
>>
>> Services like Authorize.Net are the way to go.
>>
>>
>> On Tue, Apr 9, 2013 at 7:54 PM, Mario Gudelj  wrote:
>>
>>> Hey sparky,
>>>
>>> I hope this helps:
>>>
>>> Create your checkout form and if the form is valid populate the
>>> following dict with the form data:
>>>
>>> data = {
>>> 'VPSProtocol': settings.VPS_PROTOCOL,
>>> 'TxType': settings.TXTYPE,
>>> 'VendorTxCode': 
>>> b32encode(uuid.uuid4().bytes).**strip('=').lower(),
>>>  # Generate a new transaction ID
>>> 'Vendor': settings.SAGEPAY_VENDOR,
>>> 'Amount': order.totalAmountAsString(),
>>> 'Currency': 'GBP',
>>> 'Description': 'BC Order ID: %s' % order.orderId,
>>> 'CardHolder': clean_checkout_form['card_**name'],
>>> 'CardNumber': clean_checkout_form['card_**number'],
>>> 'ExpiryDate': clean_checkout_form['card_**
>>> expiry'].strftime('%m%y'),
>>> 'CV2': clean_checkout_form['card_CVV'**],
>>> 'CardType': clean_checkout_form['card_**type'],
>>> 'CustomerEMail': clean_checkout_form['email'].**lower(),
>>> 'BillingSurname': clean_checkout_form['lastname'**],  #
>>> 20 Chars
>>> 'BillingFirstnames': clean_checkout_form['**firstname'],
>>> # 20 Chars
>>> 'BillingAddress1': clean_checkout_form['billing_**address'],
>>>  # Truncate to 100 Chars
>>> 'BillingCity': clean_checkout_form['billing_**city'],
>>>  # Truncate to 40 Chars
>>> 'BillingPostCode': 
>>> clean_checkout_form['billing_**postcode'],
>>>  # Truncate to 10 Chars
>>> 'BillingCountry': clean_checkout_form['billing_**country'],
>>>  # 2 letter country code
>>> 'DeliverySurname':  clean_checkout_form['**lastname'],
>>>  # 20 Chars
>>> 'DeliveryFirstnames': clean_checkout_form['**firstname'],
>>>  # 20 Chars
>>> 'DeliveryAddress1':  
>>> clean_checkout_form['**shipping_address'],
>>>  # 100 Chars
>>> 'DeliveryCity': clean_checkout_form['shipping_**city'],
>>> # 40 Chars
>>> 'DeliveryPostCode': 
>>> clean_checkout_form['shipping_**postcode'],
>>>  # 10 Chars
>>> 'DeliveryCountry': 
>>> clean_checkout_form['shipping_**country'],
>>>  # 2 letter country code
>>> 'CreateToken': 1
>>> }
>>>
>>> Your field names will be different.
>>>
>>> Encode it:
>>>
>>>
>>>
>>> On 10 April 2013 02:27, sparky  wrote:
>>>
 I want to use 
 django-sagepay.
 However, it doesn't  seem to have any examples or test.py that I can learn
 from. being a newbie I need docs!

 Does anyone know of any examples of use? I'm very familiar with
 sagepay, just need to know how to implement this application into my app.

 For example, any app I can look at that makes use of this
 django-sagepay
 ?


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

Re: django-sagepay example

2013-04-10 Thread sparky
@ke1g thats a very sweeping generalisation.

personally, we are PCI DSS level 2 compliant, have scans and all data is 
transmitted using SSL. we are resellers
we also NEVER store card details EVER only transmit! I'm a newbie to Django 
but have implemented 
sagepay on 3 other languages on sites which takes thousands a day over the 
last 5 years (when it was Protx) 

have you ever used sagepay? you don't need to store card details they also 
offer VSP form and server.


On Wednesday, April 10, 2013 1:15:17 PM UTC+1, ke1g wrote:
>
> An please, indicate on your site that the credit card number will go 
> through your site, so that I can know to never buy anything there.
>
> I suspect that I can count on my fingers and toes the number of web 
> developers in the world who have the knowledge, patience, and diligence to 
> securely handle credit card information.
>
> Services like Authorize.Net are the way to go.
>
>
> On Tue, Apr 9, 2013 at 7:54 PM, Mario Gudelj  > wrote:
>
>> Hey sparky,
>>
>> I hope this helps:
>>
>> Create your checkout form and if the form is valid populate the following 
>> dict with the form data:
>>  
>> data = {
>> 'VPSProtocol': settings.VPS_PROTOCOL,
>> 'TxType': settings.TXTYPE,
>> 'VendorTxCode': 
>> b32encode(uuid.uuid4().bytes).strip('=').lower(),  # Generate a new 
>> transaction ID
>> 'Vendor': settings.SAGEPAY_VENDOR,
>> 'Amount': order.totalAmountAsString(),
>> 'Currency': 'GBP',
>> 'Description': 'BC Order ID: %s' % order.orderId,
>> 'CardHolder': clean_checkout_form['card_name'],
>> 'CardNumber': clean_checkout_form['card_number'],
>> 'ExpiryDate': 
>> clean_checkout_form['card_expiry'].strftime('%m%y'),
>> 'CV2': clean_checkout_form['card_CVV'],
>> 'CardType': clean_checkout_form['card_type'],
>> 'CustomerEMail': clean_checkout_form['email'].lower(),
>> 'BillingSurname': clean_checkout_form['lastname'],  # 20 
>> Chars
>> 'BillingFirstnames': clean_checkout_form['firstname'], # 
>> 20 Chars
>> 'BillingAddress1': 
>> clean_checkout_form['billing_address'],  # Truncate to 100 Chars
>> 'BillingCity': clean_checkout_form['billing_city'],  # 
>> Truncate to 40 Chars
>> 'BillingPostCode': 
>> clean_checkout_form['billing_postcode'],  # Truncate to 10 Chars
>> 'BillingCountry': clean_checkout_form['billing_country'], 
>>  # 2 letter country code
>> 'DeliverySurname':  clean_checkout_form['lastname'],  # 
>> 20 Chars
>> 'DeliveryFirstnames': clean_checkout_form['firstname'], 
>>  # 20 Chars
>> 'DeliveryAddress1': 
>>  clean_checkout_form['shipping_address'],  # 100 Chars
>> 'DeliveryCity': clean_checkout_form['shipping_city'], # 
>> 40 Chars
>> 'DeliveryPostCode': 
>> clean_checkout_form['shipping_postcode'],  # 10 Chars
>> 'DeliveryCountry': 
>> clean_checkout_form['shipping_country'],  # 2 letter country code
>> 'CreateToken': 1
>> }
>>
>> Your field names will be different.
>>
>> Encode it:
>>
>>
>>
>> On 10 April 2013 02:27, sparky  wrote:
>>
>>> I want to use 
>>> django-sagepay.
>>>  
>>> However, it doesn't  seem to have any examples or test.py that I can learn 
>>> from. being a newbie I need docs! 
>>>
>>> Does anyone know of any examples of use? I'm very familiar with sagepay, 
>>> just need to know how to implement this application into my app.
>>>
>>> For example, any app I can look at that makes use of this 
>>> django-sagepay
>>> ?
>>>
>>>
>>>  -- 
>>> 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...@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" 

Re: How to use a list in a django model

2013-04-10 Thread Brian Schott
You can create and edit choices right in the Question admin view.  You can even 
control how many blank slots to show by default.  Go look at ChoiceInline admin 
here in the tutorial:
https://docs.djangoproject.com/en/dev/intro/tutorial02/

The next step would be to create an admin action on Question to duplicate the 
question and its choices.
https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/

That way, your workflow is duplicate a question, edit on a single page, hit 
save.

Brian Schott
bfsch...@gmail.com



On Apr 10, 2013, at 3:02 PM, Cody Scott  wrote:

> I like the is_correct and the count attributes!
> 
> The problem with that it is hard to make a quiz in the admin section. You 
> create a quiz and a question but then you have to go to the choice section 
> and create choices for the question. And even if you have the same choice in 
> two questions you need to create the choice multiple times.
> 
> It would be nice to have text fields and be able to say add a 5th choice, and 
> just enter text. It seems easier than changing forms and selecting an option 
> from a large list, or even in your case creating each choice for a quiz.
> 
> Is there a way to have the admin link from Question to Choice in this 
> configuration?
> 
> On Wednesday, 10 April 2013 14:43:54 UTC-4, BFSchott wrote:
> Is a many-to-many what you really want?  How common are the choices and 
> suppose someone goes in an edits one of the choices and suddenly it doesn't 
> match up right with a different linked question.  It might make sense to use 
> a reverse foreign key one-to-many relationship and provide a mechanism to 
> duplicate a question, including its member choices.  That way you could add 
> some statistics on each choice unique to a question.
> 
> Several possible paths depending on how you want to go.
> 
> 1.  You could just use a reverse foreign key and have a one-to-many 
> relationship.
> 
> class Choice(models.Model):
>   question = models.ForeignKey('Question', related_name='choices')
>   choice = models.CharField(max_length=255)
>   index = models.IntegerField(default=0)  # in case you want order_by 
> filtering
>   count = models.IntegerField(default=0) # in case you want to count 
> number of times this is selected right or wrong
>   is_correct = models.BooleanField(default=False) # boolean flag replaces 
> "answer"
> 
> class Question(models.Model):
>   question = models.CharField(max_length=64)
>   module = 
>  
>   def times_correct(self):
>   return 
> self.choices.objects.filter(is_correct=True).aggregate(Sum('count'))
> 
>   def times_total(self):
>   return self.choices.objects.aggregate(Sum('count'))
> 
> 
> Then in the admin, you create a table inline admin and just add unique 
> entries.
> 
> 
> 2. Encode the thing as a JSON list and store in a JSONField
> https://github.com/derek-schaefer/django-json-field
> 
> 3. There are several flavors of ListField out there:
> http://djangosnippets.org/snippets/1491/
> 
> 
> 
> Brian Schott
> bfsc...@gmail.com
> 
> 
> 
> On Apr 10, 2013, at 1:38 PM, Cody Scott  wrote:
> 
>> I am trying to store questions in a database.
>> I don't to set a fixed number of options for the question, some questions 
>> could have 4 or 2 or 5.
>> 
>> Currently I am using a ManyToManyField to a table that just contains a 
>> CharField.
>> This works but creating an option requires making another Choice object and 
>> selecting that, also when you want to select a Choice that has already been 
>> created you have to use that little box in the admin and it doesn't scale 
>> when you have hundreds of options.
>> 
>> Even if I wanted to have 4 options every time what is the recommended way 
>> without having four CharFields?
>> 
>> class Choice(models.Model):
>> choice = models.CharField(max_length=255)
>> def __unicode__(self):
>> return self.choice
>>  
>> #multiple choice question
>> class Question(models.Model):
>> question = models.CharField(max_length=64)
>> answer = models.CharField(max_length=255)
>> choices = models.ManyToManyField(Choice, related_name='questions', 
>> verbose_name='options')
>> module = models.ForeignKey('Module', related_name='questions')
>>  
>> times_correct = models.IntegerField(editable=False, default=0)
>> times_total = models.IntegerField(editable=False, default=0)
>>  
>> def _get_average(self):
>> "Returns the average in percent"
>> if self.times_total != 0:
>> return (self.times_correct / float(self.times_total))*100
>> return 0.0
>> average = property(_get_average)
>>  
>> def __unicode__(self):
>> return self.question
>> 
>> -- 
>> 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 

Re: How to use a list in a django model

2013-04-10 Thread Cody Scott
I like the is_correct and the count attributes!

The problem with that it is hard to make a quiz in the admin section. You 
create a quiz and a question but then you have to go to the choice section 
and create choices for the question. And even if you have the same choice 
in two questions you need to create the choice multiple times.

It would be nice to have text fields and be able to say add a 5th choice, 
and just enter text. It seems easier than changing forms and selecting an 
option from a large list, or even in your case creating each choice for a 
quiz.

Is there a way to have the admin link from Question to Choice in this 
configuration?

On Wednesday, 10 April 2013 14:43:54 UTC-4, BFSchott wrote:
>
> Is a many-to-many what you really want?  How common are the choices and 
> suppose someone goes in an edits one of the choices and suddenly it doesn't 
> match up right with a different linked question.  It might make sense to 
> use a reverse foreign key one-to-many relationship and provide a mechanism 
> to duplicate a question, including its member choices.  That way you could 
> add some statistics on each choice unique to a question.
>
> Several possible paths depending on how you want to go.
>
> 1.  You could just use a reverse foreign key and have a one-to-many 
> relationship.
>
> class Choice(models.Model):
> question = models.ForeignKey('Question', related_name='choices')
> choice = models.CharField(max_length=255)
> index = models.IntegerField(default=0)  # in case you want order_by 
> filtering
> count = models.IntegerField(default=0) # in case you want to count number 
> of times this is selected right or wrong
> is_correct = models.BooleanField(default=False) # boolean flag replaces 
> "answer"
>
> class Question(models.Model):
>   question = models.CharField(max_length=64)
>   module = 
>  
> def times_correct(self):
> return self.choices.objects.filter(is_correct=True).aggregate(Sum('count'))
>
> def times_total(self):
> return self.choices.objects.aggregate(Sum('count'))
>
>
> Then in the admin, you create a table inline admin and just add unique 
> entries.
>
>
> 2. Encode the thing as a JSON list and store in a JSONField
> https://github.com/derek-schaefer/django-json-field
>
> 3. There are several flavors of ListField out there:
> http://djangosnippets.org/snippets/1491/
>
>
>
> Brian Schott
> bfsc...@gmail.com 
>
>
>  
> On Apr 10, 2013, at 1:38 PM, Cody Scott  
> wrote:
>
> I am trying to store questions in a database.
> I don't to set a fixed number of options for the question, some questions 
> could have 4 or 2 or 5.
>
> Currently I am using a ManyToManyField to a table that just contains a 
> CharField.
> This works but creating an option requires making another Choice object 
> and selecting that, also when you want to select a Choice that has already 
> been created you have to use that little box in the admin and it doesn't 
> scale when you have hundreds of options.
>
> Even if I wanted to have 4 options every time what is the recommended way 
> without having four CharFields?
>
> class Choice(models.Model):
> choice = models.CharField(max_length=255)
> def __unicode__(self):
> return self.choice
>  #multiple choice questionclass Question(models.Model):
> question = models.CharField(max_length=64)
> answer = models.CharField(max_length=255)
> choices = models.ManyToManyField(Choice, related_name='questions', 
> verbose_name='options')
> module = models.ForeignKey('Module', related_name='questions')
>  
> times_correct = models.IntegerField(editable=False, default=0)
> times_total = models.IntegerField(editable=False, default=0)
>  
> def _get_average(self):
> "Returns the average in percent"
> if self.times_total != 0:
> return (self.times_correct / float(self.times_total))*100
> return 0.0
> average = property(_get_average)
>  
> def __unicode__(self):
> return self.question
>
>
> -- 
> 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 not disconnecting from database after a request

2013-04-10 Thread Lewis Sobotkiewicz
Thanks, but I'm not using the Django development version. Apparently 
persistent DB conns will be a feature of Django 1.6, but not 1.5.1.

I'm using RDS with MySQL 5.5.27. The only thing I've changed about the 
infrastructure is upgrading Django to 1.5.1. If I downgrade to 1.4.5, DB 
connections are released after the request, as expected.

On Wednesday, April 10, 2013 2:24:05 AM UTC-7, Andrey Kostakov wrote:
>
> https://docs.djangoproject.com/en/dev/ref/databases/#persistent-connections 
>
> On Wed, Apr 10, 2013 at 2:59 AM, Lewis Sobotkiewicz 
>  
> wrote: 
> > Hi all, 
> > 
> > I'm seeing some strange, undocumented behaviour when upgtrading to 
> Django 
> > 1.5.1. I notice that it is holding onto MySQL connections after request 
> > processing completes, where Django 1.4.5 disconnected after every 
> request. 
> > 
> > Any idea what could be happening? 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. 
> > 
> > 
>
>
>
> -- 
> Best regards, 
> Andrey Kostakov 
> Email/Gtalk: b...@dzen.ws  
>

-- 
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 use a list in a django model

2013-04-10 Thread Brian Schott
Is a many-to-many what you really want?  How common are the choices and suppose 
someone goes in an edits one of the choices and suddenly it doesn't match up 
right with a different linked question.  It might make sense to use a reverse 
foreign key one-to-many relationship and provide a mechanism to duplicate a 
question, including its member choices.  That way you could add some statistics 
on each choice unique to a question.

Several possible paths depending on how you want to go.

1.  You could just use a reverse foreign key and have a one-to-many 
relationship.

class Choice(models.Model):
question = models.ForeignKey('Question', related_name='choices')
choice = models.CharField(max_length=255)
index = models.IntegerField(default=0)  # in case you want order_by 
filtering
count = models.IntegerField(default=0) # in case you want to count 
number of times this is selected right or wrong
is_correct = models.BooleanField(default=False) # boolean flag replaces 
"answer"

class Question(models.Model):
  question = models.CharField(max_length=64)
  module = 
 
def times_correct(self):
return 
self.choices.objects.filter(is_correct=True).aggregate(Sum('count'))

def times_total(self):
return self.choices.objects.aggregate(Sum('count'))


Then in the admin, you create a table inline admin and just add unique entries.


2. Encode the thing as a JSON list and store in a JSONField
https://github.com/derek-schaefer/django-json-field

3. There are several flavors of ListField out there:
http://djangosnippets.org/snippets/1491/



Brian Schott
bfsch...@gmail.com



On Apr 10, 2013, at 1:38 PM, Cody Scott  wrote:

> I am trying to store questions in a database.
> I don't to set a fixed number of options for the question, some questions 
> could have 4 or 2 or 5.
> 
> Currently I am using a ManyToManyField to a table that just contains a 
> CharField.
> This works but creating an option requires making another Choice object and 
> selecting that, also when you want to select a Choice that has already been 
> created you have to use that little box in the admin and it doesn't scale 
> when you have hundreds of options.
> 
> Even if I wanted to have 4 options every time what is the recommended way 
> without having four CharFields?
> 
> class Choice(models.Model):
> choice = models.CharField(max_length=255)
> def __unicode__(self):
> return self.choice
>  
> #multiple choice question
> class Question(models.Model):
> question = models.CharField(max_length=64)
> answer = models.CharField(max_length=255)
> choices = models.ManyToManyField(Choice, related_name='questions', 
> verbose_name='options')
> module = models.ForeignKey('Module', related_name='questions')
>  
> times_correct = models.IntegerField(editable=False, default=0)
> times_total = models.IntegerField(editable=False, default=0)
>  
> def _get_average(self):
> "Returns the average in percent"
> if self.times_total != 0:
> return (self.times_correct / float(self.times_total))*100
> return 0.0
> average = property(_get_average)
>  
> def __unicode__(self):
> return self.question
> 
> -- 
> 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.




How to use a list in a django model

2013-04-10 Thread Cody Scott
I am trying to store questions in a database.
I don't to set a fixed number of options for the question, some questions 
could have 4 or 2 or 5.

Currently I am using a ManyToManyField to a table that just contains a 
CharField.
This works but creating an option requires making another Choice object and 
selecting that, also when you want to select a Choice that has already been 
created you have to use that little box in the admin and it doesn't scale 
when you have hundreds of options.

Even if I wanted to have 4 options every time what is the recommended way 
without having four CharFields?

class Choice(models.Model):
choice = models.CharField(max_length=255)
def __unicode__(self):
return self.choice
 #multiple choice questionclass Question(models.Model):
question = models.CharField(max_length=64)
answer = models.CharField(max_length=255)
choices = models.ManyToManyField(Choice, related_name='questions', 
verbose_name='options')
module = models.ForeignKey('Module', related_name='questions')
 
times_correct = models.IntegerField(editable=False, default=0)
times_total = models.IntegerField(editable=False, default=0)
 
def _get_average(self):
"Returns the average in percent"
if self.times_total != 0:
return (self.times_correct / float(self.times_total))*100
return 0.0
average = property(_get_average)
 
def __unicode__(self):
return self.question

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




[Jobs] - Python/Django Developer Position

2013-04-10 Thread Ranjith Kumar
Hello All,

Greetings

A Job has been created in group India: Senior Python Programmers - Urgently
Required | Hakett

We welcome talented people with the following skills to join in our family.

We are looking for a Strong and Highly Skilled Python Developers.

Job Title : Python Developers
No. of Opening(s) : 2
Educational qual. : BE/MCA
Skills : Python, Django, HTML, TPL, JQuery, Backbone.js
Years of experience : +1
Job Description/Roles & Responsibilities
Minimum 2 years of experience in developing web applications
Minimum 1 years of experience with Python and Django
Excellent communication skill and written skill.
Experience in payment gateway integration in Python and Django.
Experience working on technologies like jQuery and TPL.
Knowledge in TDD and BDD
Knowledge in Mysql, Postgresql, MongoDB
Deployment experience on Amazon EC2, Heroku servers preferred.

Interested people can send your resumes to ranjitht...@gmail.com

Job Location : Chennai

-- 
Cheers,
Ranjith Kumar K,
Chennai.

http://ranjithtenz.wordpress.com

-- 
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: facebook/twitter sharing, and testing

2013-04-10 Thread sara ismail
can anyone help me?!

On Wednesday, April 10, 2013 4:50:51 PM UTC+2, sara ismail wrote:
>
> im new to django, and i am working on a project, a selling and buying 
> website, where a user can post about a product that he/she wants to sell, 
> and my part right now is sharing posts from the site with facebook, and 
> twitter. i was wondering how to test such a thing, like unit testing, 
> knowing that i implemented front end only, just an HTML file. 
> and i have another question, how can i take a post url, and make it the 
> link to be shared with facebook/twitter, for example, a facebook/twitter 
> share button is located under or next to each post, and each button when 
> pressed on, redirects to fb sharing, and has that specific post's link 
> appearing. how to do that?
>
> check the attached image, instead of facebook dialogs and the flowers img, 
> i wasnt the post link, and probably an img too.
>
> thanks in advance!

-- 
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.1: ORA-01843: not a valid month

2013-04-10 Thread Carsten Fuchs

Am 10.04.2013 16:50, schrieb Carsten Fuchs:

I consider downgrading to Django 1.4.5 on the affected system, as I'm
unfortunately unsure how to best proceed with debugging and/or fixing this.



I just found out that when we

  - downgrade cx_Oracle to 5.0.3, the problem does not occur,
  - upgrading cx_Oracle to 5.1.2 brings the problem back.

So as was mentioned in the Stackoverflow post, this is likely a problem 
in cx_Oracle rather than Django...


Best regards,
Carsten



--
Dipl.-Inf. Carsten Fuchs

Carsten Fuchs Software
Industriegebiet 3, c/o Rofu, 55768 Hoppstädten-Weiersbach, Germany
Internet: http://www.cafu.de | E-Mail: i...@cafu.de

Cafu - the open-source game and graphics engine for multiplayer 3D action

--
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: DateField displayed as (None) in admin

2013-04-10 Thread Tomas Pelka
I forgot to mention this is Django 1.5.1.

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 queryset 'in' operator on two querysets fails on first call

2013-04-10 Thread Tom Evans
On Wed, Apr 10, 2013 at 2:26 PM, bradley griffiths
 wrote:
> Cross posted from: stack overflow.
>
> When using the 'in' operator on two querysets, the first time the call is
> made it fails.
>
> …
>
> print category_list # [, ]
> print other_cats # []
> print category_list[0] in other_cats # False
> print category_list[0] in other_cats # True
>
>
> If I remove 'prefetch_related' and use 'all' instead then the problem is
> gone, however this uses many more DB calls.
>
> How can I get the correct result first time using prefetch_related?

I doubt this behaviour is expected, raise a ticket with full details.

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 queryset 'in' operator on two querysets fails on first call

2013-04-10 Thread carlos
maybe need read de docu
https://docs.djangoproject.com/en/1.5/ref/models/querysets/#select-related

Cheers


On Wed, Apr 10, 2013 at 7:26 AM, bradley griffiths <
bradley.griffi...@gmail.com> wrote:

> Cross posted from: stack 
> overflow
> .
>
> When using the 'in' operator on two querysets, the first time the call is
> made it fails.
>
> from django.db import models
> class Category(models.Model):
> name = models.CharField(max_length=100)
> slug = models.SlugField(max_length=100, db_index=True, unique=True)
> def __unicode__(self):
> return self.name
> class Director(models.Model):
> name = models.CharField(max_length=100)
> slug = models.SlugField(max_length=100, db_index=True, unique=True)
> def __unicode__(self):
> return self.name
> class Project(models.Model):
> title = models.CharField(max_length=100)
> slug = models.SlugField(max_length=100, db_index=True, unique=True)
> director = models.ForeignKey(Director, 
> related_name='projects_via_director')
> categories = models.ManyToManyField(Category,
> related_name='projects_via_category')
> def __unicode__(self):
> return self.title
>
>
> category_list = Category.objects.prefetch_related('projects_via_category')
> director_list = Director.objects.prefetch_related('projects_via_director')
> other_cats = category_list.filter(
> projects_via_category__director__slug='steven-spielberg')
> print category_list # [, ]print 
> other_cats # []print category_list[0] in other_cats # 
> Falseprint category_list[0] in other_cats # True
>
>
> If I remove 'prefetch_related' and use 'all' instead then the problem is
> gone, however this uses many more DB calls.
>
> How can I get the correct result first time using prefetch_related?
>
> --
> 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.




DateField displayed as (None) in admin

2013-04-10 Thread Tomas Pelka
Hi all,

for some reason Dates are displayed as (None) in admin and in shell as well.

model.py:
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin


class Record(models.Model):
date = models.DateField(_('Čas zadání'), null=True, blank=True) #, 
auto_now=True, auto_now_add=True, editable=True, blank=False)
water = models.ForeignKey('Water', verbose_name='Voda')
gas = models.ForeignKey('Gas', verbose_name='Plyn')
el = models.ForeignKey('El', verbose_name='Elektřina')
note = models.TextField('Poznámka', blank=True)

def __unicode__(self):
return unicode(self.date)

class Meta:
ordering = ['date']
verbose_name = 'záznam'
verbose_name_plural = 'záznamy'

class RecordAdmin(admin.ModelAdmin):
list_display = ('date', 'water', 'gas', 'el', 'note')
search_fields = ['date']
date_hierarchy = 'date'
 
.
.
.

Does anybody know what could be wrong?

Thanks
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: Show label next to Foreing key raw_id_field

2013-04-10 Thread Almudena Vila Forcén
Does anyone know how to do this?

Thanks

El jueves, 4 de abril de 2013 12:35:21 UTC+2, Almudena Vila Forcén escribió:
>
> Hi,
>
> I have a model with a Foreing key raw_id_field. Now, when I choose 
> something and I return to the model I can only see the id. But when I save 
> it and I open it again, I can see the unicode next to search button. 
>
> I want to show the unicode as soon as I return to the model. 
> I've tried to use this snippet: http://djangosnippets.org/snippets/2217/, 
> but it only puts a link on the label when I can see it (when I save it and 
> I open it again).
>
> Is there any way to do this? Can I override some method and put the 
> unicode inside?
>
> Thank you very much
>
>
>

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




Django queryset 'in' operator fails on first call

2013-04-10 Thread bradley griffiths


Corss posted from stack 
overflow

When using the 'in' operator on a queryset, the first time the call is made 
it fails.

from django.db import models

class Category(models.Model):
name = models.CharField(max_length=100)

class Project(models.Model):
categories = models.ManyToManyField(Category, related_name='projects')


category_list = Category.objects.prefetch_related('projects')

print category_list # [, ]print category_list[0] in category_list # Falseprint category_list[0] 
in category_list # True

If I remove 'prefetch_related' and use 'all' instead then the problem is 
gone, however this uses many more DB calls.

How can I get the correct result first time using prefetch_related?

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




Django queryset 'in' operator on two querysets fails on first call

2013-04-10 Thread bradley griffiths
Cross posted from: stack 
overflow
.

When using the 'in' operator on two querysets, the first time the call is 
made it fails.

from django.db import models
class Category(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(max_length=100, db_index=True, unique=True)
def __unicode__(self):
return self.name
class Director(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(max_length=100, db_index=True, unique=True)
def __unicode__(self):
return self.name
class Project(models.Model):
title = models.CharField(max_length=100)
slug = models.SlugField(max_length=100, db_index=True, unique=True)
director = models.ForeignKey(Director, related_name='projects_via_director')
categories = models.ManyToManyField(Category, 
related_name='projects_via_category')   
 
def __unicode__(self):
return self.title


category_list = Category.objects.prefetch_related('projects_via_category')
director_list = Director.objects.prefetch_related('projects_via_director')
other_cats = category_list.filter(
projects_via_category__director__slug='steven-spielberg')
print category_list # [, ]print 
other_cats # []print category_list[0] in other_cats # 
Falseprint category_list[0] in other_cats # True


If I remove 'prefetch_related' and use 'all' instead then the problem is 
gone, however this uses many more DB calls.

How can I get the correct result first time using prefetch_related?

-- 
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: Oracle database TextField limitations and Django admin interface queries

2013-04-10 Thread Jani Tiainen

10.4.2013 14:45, Lauri Savolainen kirjoitti:

A little background: my application is used to manage observational data
which is collected from designated routes annually. Each route object
has a set of observation events which in turn have a date field. The
data is managed by using a (terrible) customized Django admin interface.

In the admin interface list view it's possible to search routes using a
custom search box which just injects parameters like ?route_no=1234 and
so forth into the url resulting in a filtered list view. For the most
part this works but when I want to search for routes that, for example,
have observation events past certain date with a query like
?observationevent__observation_date__gte=2010-01-01 (supposed to show
all routes that have been observed this decade) it raises an
DatabaseError: ORA-00932: inconsistent datatypes: expected - got
NCLOB-exception while using an Oracle database in production. The query
seems to work when using a development SQLite database or doing a query
like
Route.objects.filter(observationevent__observation_date__gte='2012-01-01')
directly in the management console even when using the Oracle production
database.

According to the general notes on databases the Oracle backend has
limitations with TextField-related queries
(https://docs.djangoproject.com/en/dev/ref/databases/#textfield-limitations)
and this seems to be causing this as far as I can tell. As the queries
are created by Django admin I have no idea how I should proceed from
here. Is there some kind of easy way to prevent this from happening on
Oracle or should I implement some kind of manual search function?

I am currently using the following versions:
Django==1.4.5
cx-Oracle==5.1.2
gunicorn==0.17.2
virtualenv==1.5.1



Welcome to among us very few and brave to use Oracle... ;)

What comes to your problem few details are missing but:

Length of the field in model definition and what column type is in the 
database. Also it would be helpful to know are you using legacy database?


Actual error is slightly problematic since it doesn't directly tell what 
is wrong. It's related types of bind variables and any of them might be 
incorrect for some reason.


--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

--
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-sagepay example

2013-04-10 Thread Bill Freeman
An please, indicate on your site that the credit card number will go
through your site, so that I can know to never buy anything there.

I suspect that I can count on my fingers and toes the number of web
developers in the world who have the knowledge, patience, and diligence to
securely handle credit card information.

Services like Authorize.Net are the way to go.


On Tue, Apr 9, 2013 at 7:54 PM, Mario Gudelj  wrote:

> Hey sparky,
>
> I hope this helps:
>
> Create your checkout form and if the form is valid populate the following
> dict with the form data:
>
> data = {
> 'VPSProtocol': settings.VPS_PROTOCOL,
> 'TxType': settings.TXTYPE,
> 'VendorTxCode':
> b32encode(uuid.uuid4().bytes).strip('=').lower(),  # Generate a new
> transaction ID
> 'Vendor': settings.SAGEPAY_VENDOR,
> 'Amount': order.totalAmountAsString(),
> 'Currency': 'GBP',
> 'Description': 'BC Order ID: %s' % order.orderId,
> 'CardHolder': clean_checkout_form['card_name'],
> 'CardNumber': clean_checkout_form['card_number'],
> 'ExpiryDate':
> clean_checkout_form['card_expiry'].strftime('%m%y'),
> 'CV2': clean_checkout_form['card_CVV'],
> 'CardType': clean_checkout_form['card_type'],
> 'CustomerEMail': clean_checkout_form['email'].lower(),
> 'BillingSurname': clean_checkout_form['lastname'],  # 20
> Chars
> 'BillingFirstnames': clean_checkout_form['firstname'], #
> 20 Chars
> 'BillingAddress1': clean_checkout_form['billing_address'],
>  # Truncate to 100 Chars
> 'BillingCity': clean_checkout_form['billing_city'],  #
> Truncate to 40 Chars
> 'BillingPostCode':
> clean_checkout_form['billing_postcode'],  # Truncate to 10 Chars
> 'BillingCountry': clean_checkout_form['billing_country'],
>  # 2 letter country code
> 'DeliverySurname':  clean_checkout_form['lastname'],  # 20
> Chars
> 'DeliveryFirstnames': clean_checkout_form['firstname'],  #
> 20 Chars
> 'DeliveryAddress1':
>  clean_checkout_form['shipping_address'],  # 100 Chars
> 'DeliveryCity': clean_checkout_form['shipping_city'], # 40
> Chars
> 'DeliveryPostCode':
> clean_checkout_form['shipping_postcode'],  # 10 Chars
> 'DeliveryCountry':
> clean_checkout_form['shipping_country'],  # 2 letter country code
> 'CreateToken': 1
> }
>
> Your field names will be different.
>
> Encode it:
>
>
>
> On 10 April 2013 02:27, sparky  wrote:
>
>> I want to use 
>> django-sagepay.
>> However, it doesn't  seem to have any examples or test.py that I can learn
>> from. being a newbie I need docs!
>>
>> Does anyone know of any examples of use? I'm very familiar with sagepay,
>> just need to know how to implement this application into my app.
>>
>> For example, any app I can look at that makes use of this 
>> django-sagepay
>> ?
>>
>>
>>  --
>> 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.
>
>
>

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




Oracle database TextField limitations and Django admin interface queries

2013-04-10 Thread Lauri Savolainen
A little background: my application is used to manage observational data 
which is collected from designated routes annually. Each route object has a 
set of observation events which in turn have a date field. The data is 
managed by using a (terrible) customized Django admin interface.

In the admin interface list view it's possible to search routes using a 
custom search box which just injects parameters like ?route_no=1234 and so 
forth into the url resulting in a filtered list view. For the most part 
this works but when I want to search for routes that, for example, have 
observation events past certain date with a query like 
?observationevent__observation_date__gte=2010-01-01 (supposed to show all 
routes that have been observed this decade) it raises an DatabaseError: 
ORA-00932: inconsistent datatypes: expected - got NCLOB-exception while 
using an Oracle database in production. The query seems to work when using 
a development SQLite database or doing a query like 
Route.objects.filter(observationevent__observation_date__gte='2012-01-01') 
directly in the management console even when using the Oracle production 
database.

According to the general notes on databases the Oracle backend has 
limitations with TextField-related queries (
https://docs.djangoproject.com/en/dev/ref/databases/#textfield-limitations) 
and this seems to be causing this as far as I can tell. As the queries are 
created by Django admin I have no idea how I should proceed from here. Is 
there some kind of easy way to prevent this from happening on Oracle or 
should I implement some kind of manual search function?

I am currently using the following versions:
Django==1.4.5
cx-Oracle==5.1.2
gunicorn==0.17.2
virtualenv==1.5.1

My apologies in advance if this has been answered before or I am not 
posting this in a proper way as this is my first post here. :)

-- 
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: Getting an AttributeError while creating a Django project

2013-04-10 Thread ak
Please try to use the *traceback* option:
>>> python django-admin.py startproject mysite --traceback
Maybe we will get some additional info...

-- 
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: Using a drop down list as widget for filter in admin

2013-04-10 Thread Daniel Braun
Thanks Ibrahim, I was searching google for a solution and was sent here - 
it was simply perfect. (should be merged to be honest!)

On Sunday, September 23, 2012 4:46:46 PM UTC+2, Ibrahim Lawal wrote:
>
> Here's how I achieved it.
>
> {% load i18n %} 
> {% if choices|length > 9  %}
> {% blocktrans with title|escape as filter_title %} By {{ filter_title 
> }} {% endblocktrans %} 
> 
>   onchange="window.location=this.value"> 
> {% for choice in choices %} 
> {{ choice.display|escape }} 
> {% endfor %} 
>  
> 
> {% else %}
> {% blocktrans with title as filter_title %} By {{ filter_title }} {% 
> endblocktrans %}
> 
> {% for choice in choices %}
> 
> {{ choice.display }}
> {% endfor %}
> 
> {% endif %}
>
> The else option is simply a duplication of djangos own admin/filter.html
>
>
>
>
>
> On Friday, 1 February 2008 10:55:21 UTC+1, Julien wrote:
>>
>> Hello there, 
>>
>> The list_filter meta attribute lets you add filters in the admin 
>> interface. It's great, but the problem is that the field I'm filtering 
>> (a ForeignKey) has thousands of values, so I get thousands of links 
>> put in the right end side of the page. 
>>
>> Is it possible to have a drop down list or something that compresses 
>> the space taken by that list of values? 
>>
>> Thanks a lot! 
>>
>> Julien
>
>

-- 
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: Can someone help me with this error. No ReverseMatch

2013-04-10 Thread Chris Ramón

using one url would be:
url(r'''^narrow_category/(?P\d+)/(?P\w*)'''
r'(?:\/(?P\d+))?'
r'(?:\/(?P\d+))?'
r'(?:\/(?P\d+))?$',
'catalog.views.narrow_category', name="narrow_category"), 

second_digit, third_digit and fourth_digit parameters would be optional, 
and your view would look something like this:

def narrow_category(request, first_digit, words, second_digit, third_digit, 
fourth_digit):
ctx = {'first_digit': first_digit, 
'words': words, 
'second_digit': second_digit,
'third_digit': third_digit,
'fourth_digit': fourth_digit}
return render_to_response('narrow_category.html', ctx)


On Tuesday, April 9, 2013 9:28:59 AM UTC-5, frocco wrote:
>
> NoReverseMatch: Reverse for 'narrow_category' with arguments '(9L, u'pro 
> contact', u'', u'', u'')' and keyword arguments '{}' not found.
>
>
> url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', 
> 'catalog.views.narrow_category', name="narrow_category"),
>
> url(r'^narrow_category/(\d+)/(\w+)/$', 'catalog.views.narrow_category', 
> name="narrow_category_by_text"),
>
> url(r'^narrow_category/(\d+)/(\d+)/(\d+)/(\d+)/$', 
> 'catalog.views.narrow_category', name="narrow_category2"),
>
>

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




Django developer required for full time job

2013-04-10 Thread Mo Mughrabi
Hello,

We are looking for a Django developer for a full time job in a start up,
the candidate must have work experience with Django. As a plus knowing the
below

   -

   Linux administration / setup
   -

   amazon cloud computing
   -

   RabbitMQ and Celery
   -

   South migration for Django
   -

   Bootstrap for HTML framework
   -

   Git and Github
   -

   PostgreSQL

The post is available for telecommute, you do not have to be in Kuwait.

If you are interested to apply, please share with us your résumé and asking
salary.

-- 
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 not disconnecting from database after a request

2013-04-10 Thread Andrey Kostakov
https://docs.djangoproject.com/en/dev/ref/databases/#persistent-connections

On Wed, Apr 10, 2013 at 2:59 AM, Lewis Sobotkiewicz  wrote:
> Hi all,
>
> I'm seeing some strange, undocumented behaviour when upgtrading to Django
> 1.5.1. I notice that it is holding onto MySQL connections after request
> processing completes, where Django 1.4.5 disconnected after every request.
>
> Any idea what could be happening? 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Best regards,
Andrey Kostakov
Email/Gtalk: b...@dzen.ws

-- 
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_tables2] Expected table or queryset, not 'str'.

2013-04-10 Thread Tomas Pelka
Damn, what is the correct version or other plugin to display nice tables in 
Django?

Thanks
Tom

Dne středa, 10. dubna 2013 11:08:35 UTC+2 Tom Evans napsal(a):
>
> On Tue, Apr 9, 2013 at 8:06 PM, Tomas Pelka  
> wrote: 
> > 
> > ValueError at /plyn 
> > 
> > Expected table or queryset, not 'str'. 
> > 
> > Request Method:GET 
> > Request URL:http://127.0.0.1:8000/plyn 
> > Django Version:1.5 
> > Exception Type:ValueError 
> > Exception Value: 
> > 
> > Expected table or queryset, not 'str'. 
> > 
>
> You're using an old version of django-tables2 that doesn't support the 
> version of Django you are using. 
>
> 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_tables2] Expected table or queryset, not 'str'.

2013-04-10 Thread Tom Evans
On Tue, Apr 9, 2013 at 8:06 PM, Tomas Pelka  wrote:
>
> ValueError at /plyn
>
> Expected table or queryset, not 'str'.
>
> Request Method:GET
> Request URL:http://127.0.0.1:8000/plyn
> Django Version:1.5
> Exception Type:ValueError
> Exception Value:
>
> Expected table or queryset, not 'str'.
>

You're using an old version of django-tables2 that doesn't support the
version of Django you are using.

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-sagepay example

2013-04-10 Thread sparky
wow  a million times thank you! just what I needed to get going. :))) 

On Tuesday, April 9, 2013 5:27:12 PM UTC+1, sparky wrote:
>
> I want to use 
> django-sagepay.
>  
> However, it doesn't  seem to have any examples or test.py that I can learn 
> from. being a newbie I need docs! 
>
> Does anyone know of any examples of use? I'm very familiar with sagepay, 
> just need to know how to implement this application into my app.
>
> For example, any app I can look at that makes use of this 
> django-sagepay
> ?
>
>
>

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