Hey guys,
Do we have any upcoming Django conference in Asia Pacific region or any
Django conference at all here?
Cheers,
Dealshelve Team
http://dealshelve.com
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Is there no one who has had similar problem with django1.3? Could
anyone please help me on this? I have almost hit a dead on this one.
Thanks & Regards,
Divkis01
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
You don't need mocks or dependency injection in this case. Just separate the
message construction code, so you can test it in isolation:
# myapp.views
from django.http import HttpResponse
from myapp.models import CurrentState
from myapp.exceptions import ApiFailureException
from third_party.api
Hello!
When I run syncdb it returns an error ending in
"_mysql_exceptions.OperationalError: (1050, "Table 'people_person'
already exists")." I know that the table 'people_person' already
exists because I used syncdb to make it earlier (and because I can see
it in my database).
Of course if I
Thanks for your reply, Shawn.
I'll think about that - but I think I would prefer to use more boiler-
plate Django form behavior and just get a formset with errors returned
to my template in the full-page response.
On Jun 21, 5:44 pm, Shawn Milochik wrote:
> One good way is
On Wed, Jun 22, 2011 at 1:31 AM, Cesar Canassa wrote:
> I am working in a large Django project that is currently using the 1.2.3
> version. The project test suite has around 500 test which take ~50 seconds
> to run in my machine.
> I recently did a upgrade to the Django
One good way is to just use AJAX: If it's a 'get' request, return your
rendered template as normal. If it's a 'post' request, return a JSON
response that has a success/failure status and confirmation/error
messages (form.errors.as_text()).
I'm doing this using jquery-notify to tell the user
In the case of editing a form, I want to display the original value of
a field prior to validation failure, as well as the validation
errors. This doesn't seem to work:
if fs.is_valid():
fs.save()
else:
# return original data - not default
On 2011-06-20, at 12:52 PM, Nan wrote:
> I'm not testing the third-party service. I need to test *what I send
> to them*.
Use Mock and assert_called_with:
http://www.voidspace.org.uk/python/mock/mock.html#mock.Mock.assert_called_with
In this case you'd set theAPI.call as your mock and check
Hello,
I have a question for all you django wizards. I want to use different forms
for managing a model in Django's admin. I thought it's common problem, but I
cannot find a good solution even after reading through google, stackoverflow
and django's source code. (My apologies if this is a often
I only got as far as reading the project overview, but it looks incredibly
sweet. Will have to give it a try over the weekend.
Keep up the good work!
Sincerely,
André Terra
On Tue, Jun 21, 2011 at 6:29 PM, Thomas Weholt wrote:
> On Tue, Jun 21, 2011 at 11:16 PM,
OK, this "virtual" method calls a MySQL command that need to be translated
in SQLite language if I need it.
One solution is to check the engine used in settings.
Y
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the
On Tue, Jun 21, 2011 at 11:16 PM, Calvin Spealman wrote:
> Interesting project. My first question was going to be "Why aren't you
> just using Celery?" until I got to the part of the description that
> says it is built on *top* of celery.
Yes, it might be a good idea to put
Interesting project. My first question was going to be "Why aren't you
just using Celery?" until I got to the part of the description that
says it is built on *top* of celery.
The first question that comes up for me is how or if you track which
processes have already been run, to keep them from
Proof of concept. Need comments. Released under a modified BSD-license.
http://pypi.python.org/pypi/Kolibri/0.1.0a
or better
https://bitbucket.org/weholt/django-kolibri
There's a blogpost with two screencasts at http://weholt.blogspot.com/ as well.
NB! If anybody can tell me why my my
Dnia 2011-06-21, wto o godzinie 14:31 -0300, Andre Terra pisze:
> I'm not sure this has anything to do with your issue, but it's easy to
> miss when reading the docs.
It's kind of related, but not directly. The similarity to the issue
mentioned above is that the default ordering field is added to
Dear Malcolm
Thanks, this is a good clue. I'll try it out tomorrow and report back.
Best wishes
Ivan
On 21/06/11 17:54, Malcolm Box wrote:
On 21 June 2011 16:48, Ivan Uemlianin wrote:
With tsung you record a site visit (called a session) --- log in, view
various
I'm trying to add functionality to my django project to catch anybody
accidentally sending a write to a readonly replicated DB slave. Is
there a "best practices" way to do this?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
Which solution did You use?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/cTfGWDuX48UJ.
To post to this group, send email to
What is the best way to set language that is in DB in UserProfile? I have
option to select language for users and after selecting it, I update
UserProfile table to set the language. While logging in, i need to get user
language from his profile and set it. User changes are made by selecting
Anyone here using django-wmd-editor?
https://github.com/jpartogi/django-wmd-editor
If so, could you tell me what its url.py file is supposed to look like? :D
Maybe I am missing something obvious here, but wmd/urls.py does not
exist... What am I missing?
Thanks so much!
Micky
--
You received
Hello,
I am experiencing an inconvenience in regards to working with signals
on model instances with deferred attributes. Specifically I am trying
to get a post_save signal to fire from a save() call on such a model
instance.
The problem is that the sender class (`origin` in
Woops, I forgot to include the super's save method call in my
example. Just want to make sure no one thinks that was the problem...
def save(self, *args, **kwargs):
if not self.considered.filter(id=self.requested.id):
self.considered.add(self.requested)
super(Person,
I have these models:
class Widget(models.Model):
name
class Person(models.Model):
requested = models.ForeignKey(Widget, related_name='requested')
considered = models.ManyToManyField(Widget,
related_name='considered')
def save(self, *args, **kwargs):
if not
BIG FAT DISCLAIMER
I'm not sure this has anything to do with your issue, but it's easy to miss
when reading the docs.
https://docs.djangoproject.com/en/dev/topics/db/aggregation/#interaction-with-default-ordering-or-order-by
If your model has an 'ordering' attribute defined in Meta, make sure
I am working in a large Django project that is currently using the 1.2.3
version. The project test suite has around 500 test which take ~50 seconds
to run in my machine.
I recently did a upgrade to the Django 1.3 version, the upgrade was smooth
so far, most problems came from the SQL Server
On 21 June 2011 16:48, Ivan Uemlianin wrote:
> With tsung you record a site visit (called a session) --- log in, view
> various pages, do a few things, log out --- and tsung will then hit
> the site with lots of randomised versions of this session.
>
> Many of the views
On 06/21/11 15:27, Satyajit Sarangi wrote:
Yes I know thats the problem . But , want to know whats the way out .
Theway out is to read documentation:
https://docs.djangoproject.com/en/1.3/
especially
https://docs.djangoproject.com/en/1.3/topics/http/urls/
zalun
On Tue, Jun 21, 2011 at 7:52
You are kidding right?
The job of a developer isn't just to write code, it's to solve problems.
django-users is *not* your personal tutor.
On Tue, Jun 21, 2011 at 3:27 PM, Satyajit Sarangi wrote:
> Yes I know thats the problem . But , want to know whats the way out
sorry. Problem is not User object but login from django.contrib.auth.
login(request,user)
On Jun 21, 6:21 pm, "T'mas" wrote:
> Hi there,
>
> I am having problem with User model from django.contrib.auth.models.
> When making instance in view:
>
> user =
Hi there,
I am having problem with User model from django.contrib.auth.models.
When making instance in view:
user = User.objects.get(username='tmas')
it results in error: maximum recursion depth exceeded while calling a
Python object
I am running Xubuntu 11.04, python 2.7.1+ and django 1.3.
>
> But why do you need to get that value via the *field* object? The usual way
> to do it is simply to access the attribute directly on the model instance:
>
> unicode(dev.distro)
>
> or, if you have the field name as a string as you imply originally, use
> `getattr`:
>
>
On Tuesday, June 21, 2011 11:00:37 AM UTC-4, Tom Evans wrote:
>
> On Tue, Jun 21, 2011 at 3:47 PM, Jeff Blaine wrote:
> > Any ideas? I really want (concept)
> > "myfield.unicode_representation_of_object(myobject)"
> >
>
> unicode(myobject.myfield) // unicode(getattr(myobject,
> That's what I was suggesting; that way the view becomes simple enough that
> anyone looking at it can be assured of its correctness, without a host of
> unit tests. Those tests can be applied to the functions that actually
> construct the messages.
Right, it's really those supporting
Dear All
I have a live(ish) django website which I'm testing with tsung.
With tsung you record a site visit (called a session) --- log in, view
various pages, do a few things, log out --- and tsung will then hit
the site with lots of randomised versions of this session.
Many of the views are
Hi all,
I'm not sure it's actually supposed to work, but looks like a common
enough approach that it should.
Say you have an aggregate query:
> Model.objects.values('field').annotate(Sum('count'))
that results in an aggregate query that follows:
> SELECT "models_model"."field",
On Tue, Jun 21, 2011 at 7:30 AM, Nan wrote:
>
>
> > Your view function may indeed be too complex to test properly, and it
> sounds
> > like it is too tightly coupled with with the API call -- there is no way
> to
> > call the view without having it call the actual 3rd-party
On Tuesday, 21 June 2011 15:47:32 UTC+1, Jeff Blaine wrote:
>
> Okay, here's the problem.
>
> >>> f = dev._meta.get_field('distro')
> >>> f.value_from_object(dev)
> 2L
>
> value_from_object is defined as:
>
>
> def
On 21 June 2011 15:47, Jeff Blaine wrote:
> Okay, here's the problem.
>
> >>> f = dev._meta.get_field('distro')
> >>> f.value_from_object(dev)
> 2L
>
> >>> f.attname
> 'distro_id'
> >>>
>
> As others guessed, value_from_object() is returning the pk ID in this
> case.
>
>
On Tue, Jun 21, 2011 at 3:47 PM, Jeff Blaine wrote:
> Any ideas? I really want (concept)
> "myfield.unicode_representation_of_object(myobject)"
>
unicode(myobject.myfield) // unicode(getattr(myobject, 'myfield'))
Am I being dense?
Tom
--
You received this message because
Okay, here's the problem.
>>> f = dev._meta.get_field('distro')
>>> f.value_from_object(dev)
2L
value_from_object is defined as:
def value_from_object(self, obj):
"Returns the value of this field in the given model instance."
> Your view function may indeed be too complex to test properly, and it sounds
> like it is too tightly coupled with with the API call -- there is no way to
> call the view without having it call the actual 3rd-party API as imported at
> the top of the file.
I'd be a little confused as to how
Yes I know thats the problem . But , want to know whats the way out .
On Tue, Jun 21, 2011 at 7:52 PM, Piotr Zalewa wrote:
> In urls.py you've got:
> url(r'^accounts/', include('registration.urls')),
>
> and later:
>(r'^accounts/', include('userprofile.urls')),
>
> /me
In urls.py you've got:
url(r'^accounts/', include('registration.urls')),
and later:
(r'^accounts/', include('userprofile.urls')),
/me is no expert, but that smells like asking for trouble.
zalun
On 06/21/11 14:48, Satyajit Sarangi wrote:
I am using 1.3
This is my settings.py
I am using 1.3
This is my settings.py
http://dpaste.com/556954/
This is my urls.py
http://dpaste.com/556955/
On Tue, Jun 21, 2011 at 7:14 PM, Piotr Zalewa wrote:
> On 06/21/11 14:15, Satyajit Sarangi wrote:
>
>>
On 06/21/11 14:15, Satyajit Sarangi wrote:
https://bitbucket.org/ubernostrum/django-registration This is what I
am using for user registration . Once , I log in the user is not able
to get into the userprofile page .
Thus I installed this https://bitbucket.org/ubernostrum/django-profiles/
for
https://bitbucket.org/ubernostrum/django-registration This is what I
am using for user registration . Once , I log in the user is not able
to get into the userprofile page .
Thus I installed this https://bitbucket.org/ubernostrum/django-profiles/
for user profile .
Now , this produces a conflict
Oh silly me. I was not returning user in the HttpResponse. I don't why
I assumed that it would be automatically available.
Thanks all.
2011/6/20 没必要吧 :
> Do you remember return user in HttpResponse?
>
> --
> You received this message because you are subscribed to the Google
Oh silly me. I was not returning user in the HttpResponse. I don't why
I assumed that it would be automatically available.
Thanks all.
On Mon, Jun 20, 2011 at 9:13 PM, Kenneth Gonsalves
wrote:
> On Mon, 2011-06-20 at 16:15 -0500, Kevin Miller wrote:
>> Can anyone please
Yes, seems that way, Malcom, but *why*
class Device(models.Model):
# ...
status = models.ForeignKey(Status,
blank=True,
null=True,
verbose_name="Status",
On Tuesday, 21 June 2011 13:16:47 UTC+1, Satyajit Sarangi wrote:
>
> Lets say one template helps me in uploading a file . When I go to an app
> called permissions , directly from that template . I want to carry that file
> name with me , so that I can assign permissions to it .
>
>
You really
On Jun 21, 4:54 pm, Daniel Roseman wrote:
> On Tuesday, 21 June 2011 12:17:26 UTC+1, Divkis wrote:
>
> > Hi all,
> > I am facing some really weird issue with csrf token handling
> > in django 1.3. Until now I was using 1.2 and my views were working
> > fine with
Lets say one template helps me in uploading a file . When I go to an app
called permissions , directly from that template . I want to carry that file
name with me , so that I can assign permissions to it .
On Tue, Jun 21, 2011 at 5:39 PM, Andre Terra wrote:
> It seems you
I'm reading this on my phone, so I apologize in advice if I missed
something crucial, but what's stopping you from subclassing and
overriding just the relevant parts?
Sincerely,
Andre Terra
On 6/17/11, Nikhil Somaru wrote:
> Hi,
>
> Is there a way to reduce the repetition in
Thanks derek.
On Sat, Jun 18, 2011 at 8:03 AM, Nikhil Somaru wrote:
> Hi,
>
> Is there a way to reduce the repetition in the following form classes:
>
> class ItemsStep2(ModelForm): #approval
> class Meta:
> model = OrderItem
> fields = ('item',
It seems you have an issue and you are asking for help on making your
solution work, when you should be telling us what it is that you want
to do. Only then will we be able to advise you.
Sincerely,
Andre Terra
On 6/20/11, Satyajit Sarangi wrote:
> Lets say I work on
On Tue, 2011-06-21 at 12:49 +0100, Tom Evans wrote:
> >> It will still work perfectly with ForeignKey(unique=True),
> >
> > the docs say one2one
> >
>
> That doesn't negate my statement.
>
> You said that User.get_profile() will only work with OneToOneField,
> which is incorrect, it will also
+1 on that link needing some review. Questions about dynamic models
pop up often enough to warrant a canonical explanation.
Sincerely,
Andre Terra / airstrike
On 6/21/11, Satyajit Sarangi wrote:
> I went through this link , but couldn't really understand where to put
On 06/21/2011 12:17 AM, Ian Clelland wrote:
On Mon, Jun 20, 2011 at 1:49 PM, Shawn Milochik > wrote:
I know that, whenever someone finds a "bug" in Django they're
usually doing something incorrectly. Hopefully someone will point
out
On Tuesday, 21 June 2011 12:17:26 UTC+1, Divkis wrote:
>
> Hi all,
> I am facing some really weird issue with csrf token handling
> in django 1.3. Until now I was using 1.2 and my views were working
> fine with ajax post requests by setting the X-CSRFToken. I upgraded to
> django1.3
On Mon, Jun 20, 2011 at 10:15 PM, Kevin Miller wrote:
> Hi all,
>
> I am in the process of finishing up an app. However, I just cannot
> integrate django-registration and sessions properly. I can allow a
> user to register and also log in. But
> I am a bit confused in
Sorry for the flood !
yomguy
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/_taQC4J9xTMJ.
To post to this group, send email to
Sorry Daniel, you're right !
I thought the exception pointed out the "if" statement in the template, but
it is in fact the "IF" command in my MediaCollectionQuerySet.
Here is a part of the MediaCollectionManager with its "enriched" method:
class MediaCollectionManager(CoreManager):
"Manage
On Sat, Jun 18, 2011 at 8:27 AM, Kenneth Gonsalves
wrote:
> On Thu, 2011-06-16 at 12:13 +0100, Tom Evans wrote:
>> On Thu, Jun 16, 2011 at 11:55 AM, Kenneth Gonsalves
>> wrote:
>> > those entries are old. The point is that the built in
>>
Hi all,
I am facing some really weird issue with csrf token handling
in django 1.3. Until now I was using 1.2 and my views were working
fine with ajax post requests by setting the X-CSRFToken. I upgraded to
django1.3 and cleared all the cookies in my browser and I see that no
csrktoken
On 21 Jun 2011, at 01:53, Jeff Blaine wrote:
> >>> from hostdb.models import Device, Interface
> >>> hostname = 'beijing.mitre.org'
> >>> dev = Interface.objects.get(fqdn=hostname).device
> >>> dev.status
>
> >>> f = dev._meta.get_field('status')
> >>> f.value_from_object(dev)
> u'Online'
> >>>
On Tue, Jun 21, 2011 at 9:20 AM, philippw wrote:
> hi.
>
> i have weird caching problems with the 1.3 version of django. I
> probably have something configured wrong, but am not sure what.
>
You don't mention how you have configured caching, which is relevant.
By
Hi !
MySQL and SQLite3 seem to have different behaviour here :
when I have {% if collections %} in a template, where collections is a queryset,
using SQlite3 gives this exception :
"Caught DatabaseError while rendering: no such function: IF"...
No pb with MySQL... Any idea please ?
Thanks ;)
hi.
i have weird caching problems with the 1.3 version of django. I
probably have something configured wrong, but am not sure what.
A good example is django-avatar, which uses caching and many people
use it. Even if I dont have a cache backend defined the avatar seems
to be cached, which by
Guys i also have a problem. Its like I have a many to many field. My
Models are :
class Catogary(models.Model):
catogary = models.CharField(max_length=50 , unique=True,
primary_key=True)
def __unicode__(self):
return self.catogary
class Preferences(models.Model):
user=
Hi all,
A site which was caching through django caching backend db cache) it was
working well. When we changed it to https instead of http, the system
suddenly stopped caching. Is there any thought's regarding this?
Anyone got the same issue?
regards,
Anoop
atm
___
Life is short, Live it hard.
On Tuesday, 21 June 2011 11:13:35 UTC+1, yomguy wrote:
>
> collections is a queryset coming from urls.py:
>
> all_collections = { 'queryset': MediaCollection.objects.enriched(), }
>
But what is 'enriched()'? Honestly, if you're using custom code to get
objects, and are having trouble in a view
collections is a queryset coming from urls.py:
all_collections = { 'queryset': MediaCollection.objects.enriched(), }
and passed to the template like this:
url(r'^collections/$', 'django.views.generic.list_detail.object_list',
dict(all_collections, paginate_by=20,
On Tuesday, 21 June 2011 10:17:35 UTC+1, yomguy wrote:
>
> Hi !
>
> MySQL and SQLite3 seem to have different behaviour here :
>
> when I have {% if collections %} in a template, where collections is a
> queryset,
> using SQlite3 gives this exception :
>
> "Caught DatabaseError while rendering:
Hi !
MySQL and SQLite3 seem to have different behaviour here :
when I have {% if collections %} in a template, where collections is a queryset,
using SQlite3 gives this exception :
"Caught DatabaseError while rendering: no such function: IF"...
No pb with MySQL... Any idea please ?
Thanks
On Tuesday, 21 June 2011 01:53:23 UTC+1, Jeff Blaine wrote:
>
> I can't seem to figure out what is causing this: According to the
> following 2 models
> and the 'python manage.py shell' session shown after them, I am getting 2L
> as a
> return value from a certain call when I would expect
Thank you very much Francesco,
Works like a charm...
On 20 juin, 15:33, francescortiz wrote:
> Try doing this in your models.py:
>
> def get_profile(self):
> ...your code to get the profile for a the user...
>
> User.get_profile = get_profile
>
> On Jun 20, 9:54
On Jun 18, 4:33 am, Nikhil Somaru wrote:
> Hi,
>
> Is there a way to reduce the repetition in the following form classes:
>
> class ItemsStep2(ModelForm): #approval
> class Meta:
> model = OrderItem
> fields = ('item', 'quantity_requested',
Do we have a group FAQ?
On 06/20/11 22:44, Cal Leeming [Simplicity Media Ltd] wrote:
On Mon, Jun 20, 2011 at 10:32 PM, Shawn Milochik > wrote:
Is it just me or are we having a sudden spurt of e-mail that goes
like this:
Q: How do
All the Mozilla sites are open source. Start with the presentation I gave at
djangocon.eu here:
https://github.com/andymckay/presentations/tree/master/djangoconeu-2011
On 2011-06-20, at 4:42 AM, benregn wrote:
> Thank you very much. I was not aware of that site.
>
> On Jun 20, 12:48 pm,
I went through this link , but couldn't really understand where to put
where . A little more help as to how to go about it would be very
helpful .
https://code.djangoproject.com/wiki/DynamicModels
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
On Mon, 2011-06-20 at 22:57 -0700, muzhig wrote:
> I have models: User and Photo
> User can "like" photos. So I have another model, Like, that has
> foreign keys
> to User and Photo.
>
> I cannt figure out howto filter all Users that liked one photo
it would be easier if you paste the models.
82 matches
Mail list logo