Re: Custom option for Model Meta Options

2012-03-27 Thread Roman Klesel
Hello Anssi, thanks! Seems to work. I tried it like this: from django.db import models class MyModelBase(models.base.ModelBase): def __new__(cls, name, bases, attrs): attr_meta = attrs.pop('Meta', None) try: has_cpk= attr_meta.has_composite_primary_key

Re: Simple question on queryset.

2012-03-27 Thread Denis Darii
I think the error "Memberships has no attribute all" is not related to your QuerySet. Try to look deeply into your code. BTW, your QuerySet must be: queryset = Memberships.objects.get(id=4) or better, if your id is also the primary key: queryset = Memberships.objects.get(pk=4) On 27 March 2012

Re: Simple question on queryset.

2012-03-27 Thread Stanwin Siow
I tried changing it to what you said. It's still showing the error. "Memberships object has no attribute all" This only happens when i use get. When i use order_by. the page shows but with unnecessary options. Best Regards, Stanwin Siow On Mar 27, 2012, at 3:32 PM, Denis Darii wrote: >

Custom template tag for django-voting

2012-03-27 Thread Fabio Natali
Hi everybody, I have a weird problem with a custom template tag I made. The template tag is built on top of django-voting app and provides upvote and downvote counts, while standard django-voting tags only provides total number of votes and score. Here is the snippet I wrote: http://dpaste.c

Re: Simple question on queryset.

2012-03-27 Thread Stanwin Siow
ok i managed to get it to work by using filter. Cheers Best Regards, Stanwin Siow On Mar 27, 2012, at 3:32 PM, Denis Darii wrote: > I think the error "Memberships has no attribute all" is not related to your > QuerySet. Try to look deeply into your code. > > BTW, your QuerySet must be: > >

Django With Tweepy

2012-03-27 Thread coded kid
Hi guys, I’m confused on how to make this work. I want to stream user’s tweets in my django app using tweepy. I’ve written the streaming code but the problem I’m facing is: should I paste the code in views.py and input- return render_to_response('tweet.html',context_instance=RequestContext(request)

Re: Django error about utf8 with BOM when running "python manage.py compilemessages"

2012-03-27 Thread Davide Setti
On Thursday, March 8, 2012 10:04:09 PM UTC+1, Tom Evans wrote: > > Yes, just remove the BOM: > > http://en.wikipedia.org/wiki/Byte_order_mark > But that file is in django, not in his code, am i wrong? -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: De-serialization of ManyToManyField

2012-03-27 Thread sk
Hi, So a brief update. I changed the way I was building this model and explicitly created a 'joining' table and added a through clause to the ManyToManyField definition as well as allowing null values. This meant I was able to populate the joining table using YAML after building the test/instance

Re: Simple question on queryset.

2012-03-27 Thread Javier Guerra Giraldez
On Tue, Mar 27, 2012 at 1:57 AM, Stanwin Siow wrote: > queryset = Memberships.objects.get(id__exact=4) the .get() method doesn't return a queryset, it returns a record object, so your 'queryset' variable is the 'membership' object itself. the error you get: > Memberships has no attribute all.

Re: Django error about utf8 with BOM when running "python manage.py compilemessages"

2012-03-27 Thread Javier Guerra Giraldez
On Tue, Mar 27, 2012 at 3:52 AM, Davide Setti wrote: > But that file is in django, not in his code, am i wrong? many brain-dead editors silently add BOMs to files when saving. being a .po file, i'd guess somebody did a small localization by editing it with the wrong tool. -- Javier -- You re

Re: Adding link to admin page

2012-03-27 Thread Larry Martell
On Mon, Mar 26, 2012 at 9:19 PM, Mike Dewhirst wrote: > Larry > > Here is a working setup ... > > From settings.py > # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # > # > # if templates are not found here look in app_name/templates > TEMPLATE_DIRS = ( >    os.path.join(

Re: IE9+Django,Don't respond or Socket error!!!

2012-03-27 Thread JJO
With IE, we have had to use the a non-local IP for the machine. Using 'localhost' or '127.0.0.1' did not work. On Mar 25, 12:19 am, Aommonly wrote: > === > > Exception happened during processing of request from ('127.0.0.1', > 60076) > Traceback (mo

Re: IE9+Django,Don't respond or Socket error!!!

2012-03-27 Thread br
This is a problem of django development server, running on windows, and IE(7-9). Basically, the server locks up, and it doesn't really give much as far as useful errors go. Apparently no one that contributes to django uses IE for development and has been able to replicate this issue, because the i

Looking for a developer who knows Django well

2012-03-27 Thread MSSONI
I have just started a company. The company is yet to be registered. We have launched our product www.instashare.me. Our alpha has just launched. We are looking for passionate developers. Our salary will range from 15-25k depending on the developers abilities. -- You received this message because

Re: Looking for a developer who knows Django well

2012-03-27 Thread Daniel Roseman
On Tuesday, 27 March 2012 12:34:46 UTC+1, MSSONI wrote: > > I have just started a company. The company is yet to be registered. We > have launched our product www.instashare.me. Our alpha has just > launched. We are looking for passionate developers. Our salary will > range from 15-25k depending

Re: User/UserProfile Queryset problem

2012-03-27 Thread bcrem
Oh. I see. So...that wasn't very complicated at all then, was it? Thanks DR - didn't realize you could access userprofile directly from user that way. On Mar 27, 2:31 am, Daniel Roseman wrote: > On Tuesday, 27 March 2012 02:15:04 UTC+1, bcrem wrote: > > > Hello Django Nerds! > > > So I have

Getting started with Django workshop - Nottingham 18 May

2012-03-27 Thread Erskine Design
Hi - we're holding a workshop for developers interested in getting stuck into Django. It’ll cover all the essentials including: * Setting up a new project * Package management * Database migration with South * The model, view template structure * Working with forms * Customising the admin interfa

postresql integer array in django model

2012-03-27 Thread dummyman dummyman
Hi , I ve a integer array field. How do i represent it in django models ? representing it in text field is not a feasible solution. I want that array to be represented in a drop down box so which is the best way to represent them in models ? -- You received this message because you are subscribe

locale UTF-8 error

2012-03-27 Thread HMA
I am following the tutorial part 2 and when creating a superuser once the login prompt is showing (after executed *python manage.py run server* ). I am using python 2.7.2 for Mac OS 10.7.3, Django 1.4 and I get the following error: python manage.pcreatesuperuser --username=horacio --email=ho

Re: locale UTF-8 error

2012-03-27 Thread Tom Evans
On Tue, Mar 27, 2012 at 5:51 PM, HMA wrote: > I am following the tutorial part 2 and when creating a superuser once the > login prompt is showing (after executed python manage.py run server ).  I am > using python 2.7.2 for Mac OS 10.7.3, Django 1.4 and I get the following > error: > > python mana

Upgrading to 1.4, now a test is skipped?

2012-03-27 Thread Tim Chase
I'm in the process of upgrading from 1.3 to 1.4, and noticed that my test results now say that one of the tests is being skipped. As best I can tell, this is an internal Django test, rather than one of mine. Since it's not an actual failure, I'm mostly curious about what it is and what trigger

get all models for app with ContentType

2012-03-27 Thread brian
How do I get all the models for an app with ContentType? I have this code the works on the local server but throws “DoesNotExist: ContentType matching query does not exist” in production: ct = ContentType.objects.get(app_label=app_label, name=modelName) This works: ct = ContentType.objects.get(ap

LinearRing creation causing WindowsError

2012-03-27 Thread sfletche
I updated Django today to trunk (last update was Oct 2010) and I'm now getting an error when creating a LinearRing object. The following from a python shell will produce the error: from django.contrib.gis.geos import * test = LinearRing ( [ (1,1), (2,1), (2,2), (1,1) ] ) test Accessing 'test' wit

Http404 and process_exception

2012-03-27 Thread Justin Holmes
Heretofore, I had always believed that Http404 did not cause Middleware process_exception() to be run. Am I right in this thinking? I have a get_object_or_404 that, when the object in question isn't found, is running process_exception. -- Justin Holmes Head Instructor, SlashRoot Collective Sl

Re: locale UTF-8 error

2012-03-27 Thread Horacio Martínez Alfaro
Thank you very much. I edited the ~/.bash_profile file and change the LC_CTYPE env variable to a valid locale and the problem was solved. .. HMA. On Tue, Mar 27, 2012 at 11:08, Tom Evans wrote: > On Tue, Mar 27, 2012 at 5:51 PM, HMA wrote: > > I am following the tutorial part 2 and when cr

Re: Upgrading to 1.4, now a test is skipped?

2012-03-27 Thread Russell Keith-Magee
On 28/03/2012, at 2:02 AM, Tim Chase wrote: > I'm in the process of upgrading from 1.3 to 1.4, and noticed that my test > results now say that one of the tests is being skipped. As best I can tell, > this is an internal Django test, rather than one of mine. Since it's not an > actual failure,

Re: Upgrading to 1.4, now a test is skipped?

2012-03-27 Thread Tim Chase
On 03/27/12 18:22, Russell Keith-Magee wrote: On 28/03/2012, at 2:02 AM, Tim Chase wrote: I'm in the process of upgrading from 1.3 to 1.4, and noticed that my test results now say that one of the tests is being skipped. Any way to tell "./manage.py test" to be verbose, or to track down the ori

Re: LinearRing creation causing WindowsError

2012-03-27 Thread sfletche
The solution I found is as follows: I updated to the latest OSGeo4W (which still uses GEOS 3.2.2 as far as I can tell), added OSGeo4W to my PATH var and LinearRing is working fine. I had been using a work-around configuration referencing (in my PATH var) the GEOS binaries included with a Postgres

Need help creating model.

2012-03-27 Thread Zach
I have the following in my Student model. I am wanting to track the date of each point given to each student. The idea would be so that I could see not only how many points each student has, but also see the date each point was given. In the future I want to see the trend of each students' points.

Re: Http404 and process_exception

2012-03-27 Thread Russell Keith-Magee
On 28/03/2012, at 6:31 AM, Justin Holmes wrote: > Heretofore, I had always believed that Http404 did not cause Middleware > process_exception() to be run. Am I right in this thinking? > > I have a get_object_or_404 that, when the object in question isn't found, is > running process_exception.

TestCase Client.login() fails

2012-03-27 Thread jondbaker
I'm trying to write a unit test that will verify that the login form authenticates a user. Whenever I run 'manage.py test' the runner fails with this message: *AssertionError: False is not True* *tests.py* from django.test import TestCase from django.test.client import Client from django.contrib

Re: Need help creating model.

2012-03-27 Thread jondbaker
I think the Foreign Key route is the way to go. After setting up the fields on both the Student and Point models and establishing the FK relationship between the two, you could write a table-level method that returned the number of corresponding Points. On Tuesday, March 27, 2012 7:18:12 PM UTC