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
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
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:
>
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
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:
>
>
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)
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
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
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.
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
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(
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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.
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.
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
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
32 matches
Mail list logo