return u', '.join(self.facet.all()) does not work. I believe from
Dive into Python .join expects a String:
"join works only on lists of strings; it does not do any type
coercion. Joining a list that has one or more non-string elements will
raise an exception."
But in the Python docs it says .
adambossy wrote:
> My problem is that I am trying to _write_ session variables before
> calling my view. For example:
Django really falls down here, especially compared to Brand X. Stuff a
session like this:
def assemble_session(self, dictionary):
from django.conf import settings
On Wed, Mar 31, 2010 at 9:09 PM, jeff wrote:
>
>page_title='Add a Pair'
>if request.method == 'POST':
>form=SymForm(request.POST)
>if form.is_valid:
is_valid is a call - you want this:
if form.is_valid():
Nick
--
You received this message beca
so i've searched high and low on this error. lots of answers about
having used old versions of django. i did this:
j...@earth:/home/samba/raymour/v1/rrsite$ django-admin.py --version
1.1.1
then a lot of stuff about python path having been done with an easy
installer and having an 'egg' in it. doe
Hehe, that's kinda funny...Thanks for your help Russell. =)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr.
On Thu, Apr 1, 2010 at 7:55 AM, Russell Keith-Magee
wrote:
> On Wed, Mar 31, 2010 at 11:13 PM, Wiiboy wrote:
>> Hi guys,
>> I've gotten two emails from "Mail Delivery Subsystem
>> " with the subject "Your message was NOT
>> received by django-us...@googlegroups.com!".
>> The body is below. Anyon
hi all,
i'm building an application that models the literature, biology and
ecology of a group of insects. i have been playing around with the
admin site and have noticed some odd behavior. For example, I have a
class for species names, that has several inline model objects in the
admin - one for
thanks for your reply... your tip got me thinking and I found the docs
at:
http://docs.cksource.com/CKFinder/Developers_Guide/PHP/CKEditor_Integration
under manual integration
On Mar 31, 10:16 pm, Sam Lai wrote:
> On 1 April 2010 13:05, Bobby Roberts wrote:
>
> > I'm trying to get ckfinder
On 1 April 2010 13:05, Bobby Roberts wrote:
> I'm trying to get ckfinder to integrate with ckeditor. I can go
> directly to the ckfinder sample standalone and it uploads to the right
> directory and everything so I know that ckfinder is configured
> properly... anyone know how to get the upload t
I'm trying to get ckfinder to integrate with ckeditor. I can go
directly to the ckfinder sample standalone and it uploads to the right
directory and everything so I know that ckfinder is configured
properly... anyone know how to get the upload tab on the image popup
with ckeditor so that ckfinder
On Wed, Mar 31, 2010 at 11:13 PM, Wiiboy wrote:
> Hi guys,
> I've gotten two emails from "Mail Delivery Subsystem
> " with the subject "Your message was NOT
> received by django-us...@googlegroups.com!".
> The body is below. Anyone know why I'm getting these? Is anyone else
> getting them? I ha
On Thu, Apr 1, 2010 at 1:16 AM, wchildsuk wrote:
> Hi,
>
> I'm using the django app, django-schedule (http://github.com/thauber/
> django-schedule) and am adding an additional table to map users to
> calendars (see line 253 on dpaste). When I run syncdb it completely
> ignores my table and doesn'
I know how to do this with 3 queries:
object = Model.objects.filter(pk=pk)
previous =
Model.objects.filter(votes__lt=object.votes).order_by('-votes')[:1][0]
next = Model.objects.filter(votes__gt=object.votes).order_by('votes')[:1][0]
My only problem with this is if there is any object with the sa
On Wed, Mar 31, 2010 at 5:22 PM, Federico Capoano
wrote:
> Thanks,
>
> how many things i've learnt today, to optimize the number and length
> of query by using:
>
> * select_related
> * only
> * extra
>
> Do you think the performance gain is worth the work?
Yes. Specially in loops where you have:
Hello,
I'm trying to figure out a simple way to get a known record from a
database but also get the "previous" and "next" records too. My model
is a Photo table with user's votes :
ID Votes
1 24
2 5
3 102
4 21
5 10
So, if I query for the photo with ID=4 (21 votes) I'd like
Thanks,
how many things i've learnt today, to optimize the number and length
of query by using:
* select_related
* only
* extra
Do you think the performance gain is worth the work?
And I've a curiosity more to ask:
If I use the cache framework, once the results are cached the will the
database
Okey I want to answer this :) just add a unicode method to your model
something like this
def __unicode__(self):
return "%s" % self.name
On 31 Mart, 16:37, Asim Yuksel wrote:
> I have a people table and a bridge table which are related. bridge
> table has a foreignkey field for people ta
On Wed, Mar 31, 2010 at 3:30 PM, Federico Capoano
wrote:
> Hello to all,
>
> has been a while i've been wondering how to optimize Django's queries
> to the database, for example by setting it to use JOIN to retrieve
> foreign keys instead of multiple selects.
>
> for example if I have a blog objec
The people and publication are not related so I cant use manytomany
On 31 Mart, 15:30, "Giovannetti, Mark" wrote:
> > I am entering them on the same page otherwise I will have to note down
> > the ids of people and publications table and then go to bridge table
> > and insert the ids there. So th
I have a people table and a bridge table which are related. bridge
table has a foreignkey field for people table.
When I click add from django admin it shows the peopleid in a drop
down list. What I want to do is I want to show the people.name field
instead of peopleid foreignkey field? How can I
Hello to all,
has been a while i've been wondering how to optimize Django's queries
to the database, for example by setting it to use JOIN to retrieve
foreign keys instead of multiple selects.
for example if I have a blog object that has a category foreign key
and I write in a template
{{ blog.c
On Mar 31, 8:26 pm, Daniel wrote:
> Hi guys,
>
> I'd appreciate a little advice on the following:
>
> I'm trying to get a unicode string representation of my model named
> Sample. But that Sample model has a many to many relationship with
> another model, Facet.
>
> So Sample's unicode method:
>
Thierry,
Thanks for the response and the code sample.
To be clear, the "variables" in accounts/accueil/ are session
variables? I assume your view for that URL looks like this:
def accueil(request):
...
request.session['domaine'] = Domaine.objects.get(nom='DomaineAdmin')
.
>
> I am entering them on the same page otherwise I will have to note down
> the ids of people and publications table and then go to bridge table
> and insert the ids there. So the reason I want to enter in the same
> page is I will insert the ids into bridge table whenever I click save.
> I am
Hi guys,
I'd appreciate a little advice on the following:
I'm trying to get a unicode string representation of my model named
Sample. But that Sample model has a many to many relationship with
another model, Facet.
So Sample's unicode method:
def __unicode__(self):
retu
Final approach:
in the forms.py excluded the courses foreign key field
in models.py made courses blank and nullable
didn't pass any initial values to the form
in the view, saved the form like this:
item = Courses.objects.get(pk=whatever)
obj = form.save(commit=False)
Hi everyone,
I am still having issues with my data models. I can't tell if the
underlying problem is my model definitions or my inability to do the
queries to manipulate my models to get the output that I want.
Could someone please tell me if this is the right way to do it in my
models.py?
Agai
Hello all,
I just posted a reply to a message here via the web interface and got
an email like this.
Toodle-lo..
creecode
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@goo
I ended up using jezdez's fork of Piston, and it works as expected:
https://bitbucket.org/jezdez/django-piston/
On Mar 31, 9:57 am, Brandon Taylor wrote:
> Hi everyone,
>
> I know there's a Google Group for django-piston, but there's not very
> much conversation on that group, so I'm re-posting h
Apparently the question has been answered.
On Mar 31, 1:51 am, Simone Orsi wrote:
> anyone using RPC4Django has faced
> thishttps://bugs.launchpad.net/rpc4django/+bug/552437?
Toodle-loo.
creecode
--
You received this message because you are subscribed to the Google Groups
"D
Hi,
I'm using the django app, django-schedule (http://github.com/thauber/
django-schedule) and am adding an additional table to map users to
calendars (see line 253 on dpaste). When I run syncdb it completely
ignores my table and doesn't through any errors. Can anyone shed any
light on way it mig
Walt,
Thanks for the clarification. That helped a lot.
I did get this working. Yeah!
Had to do a slight tweak to the surrounding elements on the page to
get it to look right (minor change to widgets.css).
Now I can see all of the data for the profiles. Seems like there
should be a way to auto scal
Thanks but I get error when I try to extend it
it says:Caught an exception while rendering: opts
and it highlights
{% submit_row %}
Any ideas?
On 31 Mart, 11:23, Brandon Taylor wrote:
> You can extend the change_form.html and change_list.html templates for
> those views, or the base_s
You can extend the change_form.html and change_list.html templates for
those views, or the base_site.html template.
Look in your: django/contrib/admin/templates/admin/ folder to see all
of the templates. Also, check out the documentation at:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#
I getting those too.
__
Vinícius Mendes
Solucione Sistemas
http://solucione.info/
On Wed, Mar 31, 2010 at 12:14 PM, Brandon Taylor wrote:
> I'm getting those from this forum as well.
>
> On Mar 31, 10:13 am, Wiiboy wrote:
> > Hi guys,
> > I've gotten two emails from "Mail D
At The Texas Tribune (texastribune.org), we use a combination of
TinyMCE and django-reversion. It doesn't track changes between
versions, but it maintains a history table of each previous version of
our main content types.
Cheers,
Brandon
On Mar 30, 4:18 pm, John Griessen wrote:
> Some potential
Brandon, Thanks for your suggestion.
I tried passing it an ID, but as you say, I also have to override the
save. What I don't understand is why it does it fine if the form
includes the foreign key in a popup? They are both passing back
integers after all.
Also failed to get the save method worki
On 31 Mar, 06:04, Continuation wrote:
> On Mar 30, 8:33 am, Tomasz Zieliñski
>
> wrote:
> > If you take a look at TransactionMiddleware source:
>
> >http://code.djangoproject.com/browser/django/tags/releases/1.1.1/djan...
>
> > then you'll see that it's just commit_on_success in disguise:
>
> >
I'm getting those from this forum as well.
On Mar 31, 10:13 am, Wiiboy wrote:
> Hi guys,
> I've gotten two emails from "Mail Delivery Subsystem
> " with the subject "Your message was NOT
> received by django-us...@googlegroups.com!".
> The body is below. Anyone know why I'm getting these? Is an
Hi guys,
I've gotten two emails from "Mail Delivery Subsystem
" with the subject "Your message was NOT
received by django-us...@googlegroups.com!".
The body is below. Anyone know why I'm getting these? Is anyone else
getting them? I have no affiliation with Dreamhost or at all, so this
is...stra
Hmm, you should be able to do that. I do exactly that in one of my
models.
The only I differences I see between yours and mine is that you return
a unicode string, rather than just a string, and you wrote self.user,
rather than self.user.something.
--
You received this message because you are s
Test if self.instance.user is not None, if so, change the queryset to
exclude the self.instance.user:
http://gist.github.com/350440
__
Vinícius Mendes
Solucione Sistemas
http://solucione.info/
On Wed, Mar 31, 2010 at 11:24 AM, Emanuel wrote:
> Hi all!
>
> I have a modelfor
Hi there,
When calling def clean_name(self):, you can see if your instance has
an id or not:
def clean_name(self):
if not self.id:
#this would be a new record
else:
#this would be an existing record
HTH,
Brandon
On Mar 31, 9:24 am, Emanuel wrote:
> Hi all!
>
> I have a
Hi there,
Instead of using the course object in your initial data, which will
pass in the __unicode__ representation of the object, pass in the id:
form = CouseBook(initial = {'course': course.id})
That should get you the numeric id, but you'll also need to override
your save method to get the c
Hi everyone,
I know there's a Google Group for django-piston, but there's not very
much conversation on that group, so I'm re-posting here as well.
I'm getting an error when running the "blogserver" example site
included with Piston:
AttributeError at /api/posts/
'Blogpost' object has no attribu
On Mar 30, 10:53 am, bruno desthuilliers
wrote:
> Uh. Oh, well - then you indeed have a problem :(
> Hum... Is that legacy code ? Looks pretty ugly to me - wouldn't pass a
> code review here.
> Well, assuming you're using at least Django 1.0, I suggest you get rid
> of this mess and make appropri
Hi all!
I have a modelform and I want to customize validation.
I'm overriding the method clean_().
When I'm saving the form I want to see if a specific user has been already
assigned to a project. The only way he can ben assigned again is if he's an
inactive user, so:
models.py
Class User(mod
can anybody tell me how to write a script to import hotmail contacts
with windowslivelogin.py library,i have a web based script used for
django environment below:
from lib.WindowsLiveLogin import ConsentToken
import urllib, urllib2
def hotmail_login(request):
wll =
WindowsLiveLogin(appid=
sett
> The problem is that this expanding of callables are done on
> "formfield" method of the field class and this method is called in the
Sorry by this email guys, I just found a ticket talking about it:
http://code.djangoproject.com/ticket/11940
It seems the problem is fixed.
Thanks!
--
Michel
Hi all!
I have a modelform and I want to customize validation.
I'm overriding the method clean_().
When I'm saving the form I want to see if a specific user has been already
assigned to a project. The only way he can ben assigned again is if he's an
inactive user, so:
models.py
Class User(mod
Hi guys,
I'm working on a cms running over django1.1.1 and I'm facing a weird
problem.
I have a BlogPost model that uses a callable (datetime.datetime.now)
as default value for some field.
I created my own views for manage blog posts. The view make use of a
BlogPostForm ModelForm class, defined
can anybody tell me how to write a script to import hotmail contacts
with windowslivelogin.py library,i have a web based script used for
django environment brlow:
from lib.WindowsLiveLogin import ConsentToken
import urllib, urllib2
def hotmail_login(request):
wll =
WindowsLiveLogin(appid=sett
i have the SDK with me,
source code for getting hotmail contacts in DJANGO environment:
--
from lib.WindowsLiveLogin import ConsentToken
import urllib, urllib2
def hotmail_login(request):
wll =
WindowsLiveLogin(appi
Displayed fields resolve as expected, hidden fields cause errors.
This works:
in the model
CourseBook has a foreign key to Course
In the view:
course = Course.objects.get(pk=whatever)
form = CouseBook(initial = {'course': course})
in the Form:
class CourseBook(ModelForm):
class Meta:
On Mon, Mar 29, 2010 at 9:28 AM, xin wrote:
> I am unsure if this a bug in Django, or django-multidb-router, or
> something I've done wrong.
>
> I'm using django-multidb-router from here:
> http://github.com/jbalogh/django-multidb-router
> With two database definitions, a read_only_user and a rea
Hi everybody,
I'm using django (integrated in an application, omero) as a production
server with mod_python (v3.3.1-147.35) and apache (v2.2.10-2.8.1).
Unfortunately after rebooting the server apache seems to hang-up. When
opening the website I just see the progress-indicator gif.
When restarting
Dear Django Users,
There is a part in my code where i check if there is an IntegrityError
on certain values and is so the error is caught and saved in a list.
To be able to do this i imported from psycopg2 the IntegrityError.
This all does work like it should the only thing is that after that i
c
Hi,
anybody using rpc4django has faced this?
https://bugs.launchpad.net/rpc4django/+bug/552437
Cheers,
SimO
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe fro
Hi,
anyone using RPC4Django has faced this
https://bugs.launchpad.net/rpc4django/+bug/552437 ?
Cheers,
SimO
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from
Le mercredi 31 mars 2010 05:40:43, adambossy a écrit :
> The behavior of Django sessions changes between "standard" views code
> and test code, making it unclear how test code is written for
> sessions. Googling this yields two relevant discussions about this
> issue:
>
> 1. "Easier manipulation o
Hi,
I've this model:
--
class Person(models.Model):
user = models.ForeignKey(User)
Can I display the user.email or user.first_name in the admin site
administration?
I try this:
---
def __unicode__(self):
return u"%s %s" % (self.u
Please help me out
On Mar 29, 11:04 pm, Eximius wrote:
> Hi all,
> I have created a django application using app engine sdk, and have
> stored data in database using forms. But the problem i am getting when
> i deploy it, the data I stored is not there in the app engine
> datastore.
> So how
62 matches
Mail list logo