Hi *
I am trying to pass a variable to a Raw SQL in Django with the
following code :
Note on the function : forge and num are variables that I am getting
from an URL.
>From the Django error web :
all_info []
amount []
aux {}
forge u'objectweb'
forge_proj u'objectweb'
format u'rss'
num 0
Hello!
I noticed that there are two paginations 'engines' available for
django. The first one is in django distribution itself
(http://docs.djangoproject.com/en/1.0/topics/pagination/), and the
second one I found at code.google.com. (Url is
http://code.google.com/p/django-pagination/). Which one
Using sphinx for search in my django app and whilst it's great I can't
seem to get any date filtering happening. Sphinx conf is fairly
unremarkable:
source event_event_en : base
{
# main document fetch query
# mandatory, integer document ID field MUST be the first selected
column
Hi * again, auto-response.
but first I have to thanks to Drakonen of the Django IRC channel for
try to help me.
The error ( I do no knoe why yet ) was in this line :
sql = sql + 'AND f.url like "%%%s%%"' % (forge)
by a very strange reason the solution is to separate that sentence in
two of the
Hi Matthew, thank you very much for the response, I just see it a few
minutes ago. Thanks. :D
On Mar 30, 10:47 am, Matthew Somerville
wrote:
> Francisco Rivas wrote:
> > sql = sql + 'AND f.url like "%%%s%%"' % (forge)
>
> > cursor = connection.cursor()
> > cursor.execute(sql)
> > res
Hi,
I'm used to doing things like this;
resources = Resource.objects.all()
for resource in resources:
if resource.thetype == 'url':
resource.link = '/access/redirect?location=%s' % resource.uuid
else:
resource.link = '/access/download/%s/%s' % (resource.uuid,
resource.file
Hi All:
My first Django project is an app to manage a repository of
downloadable software. Individual downloads have a category
(multimedia, internet, office, etc, etc) assigned to them. Releases of
the repository are made at regular intervals and a changelog is
maintained in between release to t
Hi
I haven't actually used django's own pagination, so I guess I can't
really compare. Though working with django-pagination is really
easy and it's well written. Made by the people that made pinax...
~Jakob
On 30 Mar., 12:36, Konstantin S wrote:
> Hello!
>
> I noticed that there are two pagina
I should have spent the extra 10 minutes trying out the 'property'
solution (rather than the several hours I've spent on the generic view/
pagination code).
Adding this code to the model works perfectly well.
def _link(self):
from settings import ACCESS_PATH
if self.mimetype
Phil Edwards wrote:
> Hi All:
>
> First off, apologies if this message ends up appearing twice - I had a
> minor problem getting Google to recognise that I'd subscribed...
>
Somehow, I just *knew* that was going to happen... :-)
--
Regards
Phil Edwards | PGP/GnuPG Key Id
Brighton, UK
Konstantin S pisze:
> Hello!
> second one I found at code.google.com. (Url is
> http://code.google.com/p/django-pagination/). Which one would you
> recommend ?
This one works well for me (it uses the built-one), but remember not to
use {% if object_list %} before pagination tags in your template
On Mar 30, 10:43 am, PhilE wrote:
> Hi All:
>
> My first Django project is an app to manage a repository of
> downloadable software. Individual downloads have a category
> (multimedia, internet, office, etc, etc) assigned to them. Releases of
> the repository are made at regular intervals and a c
Updated translations as per django-trunk rev 10162 are available at:
http://github.com/foxbunny/django-sr-locale/tree/master
The translations include both Serbian Cyrillic (default `sr` locale)
and Serbian Latin (`sr_LA` locale) and full translations of both
`django.po` and `djangojs.po`. I'm st
On Mar 24, 11:05 am, gchuyun wrote:
> i tried this, but get a error similar.
>
> TypeError: [{'publish_time': datetime.datetime(2009, 3, 24, 16, 16,
> 18), 'is_deleted': 0, 'is_confirmed'
> : 0, 'title': u'1', 'content': u'111', 'id': 1L}, {'publish_time':
> datetime.datetime(2009, 3, 24, 16
> ,
Francisco Rivas wrote:
> sql = sql + 'AND f.url like "%%%s%%"' % (forge)
>
> cursor = connection.cursor()
> cursor.execute(sql)
> results = cursor.fetchall()
cursor.execute() expects placeholders, rather than direct parameters, so
needs % to be escaped on input - your one level of es
Hi All:
First off, apologies if this message ends up appearing twice - I had a
minor problem getting Google to recognise that I'd subscribed...
For my first 'teach myself Django' project, I'm implementing an
application to manage a software repository. Programs in the repository
have a catego
More info here: http://djangogigs.com/gigs/588/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group,
Hi,
I've got the following class:
CarForm(ModelForm):
def __init__(self, *args, **kwargs):
super(CarForm, self).__init__(*args, **kwargs)
id = self.instance.id
qs = CarPhoto.objects.filter(car__id = id)
self.fields['main_image'] = forms.ModelChoiceField(qs)
django-pagination makes use of the Djangos' built in pagination,
so it's more like a wrapper on top but no distinct 'engine'.
If you have a need for some special customized pagination,
I would recommend Djangos' own pagination,
but if you want easy setup and some more generic pagination funcional
Daniel Roseman wrote:
>
> Before answering, I'd point out you have a very significant potential
> bug. Each of your __unicode__ methods actually uses str(). This will
Thank you, that's useful to know - one more item in the (so far!) quite
empty bag of Django experience!
> Now, on to the questi
Hi all,
I have a model where I have defined a method :
def print_html(self):
[...]
I have changed this method but no change is observed in the web page. It is
still working the old model method.
How can update this?
python manage.py sqlall
and
python manage.py syncdb
doesn't seem to work.
Hi,
If you only change the method, but no model, you don't need to call 'syncdb'.
If your webserver is configured correct, then you just need to hit ctrl-r
(reload
in firefox).
This should work if you use the development server of django. If
you use apache with mod_wsgi you need to set maximu
Hi,
I don't have idea how to do simple task.
I have model with DateTimeField and I want to retrieve all objects
that have time for example lower than 2pm.
I know about Django queryset lookup like year, month, day. Is there
something similar but for time? If not what is the simplest way to
accomp
On 23-Mar-09, at 5:53 PM, AKK wrote:
> I'm working through chapter 7 of the djangobook online. and i've got
> the following:
>
> def search(request):
>if 'criteria' in request.GET:
>
> however, if i leave it blank rather than it saying "You submitted an
> empty form" it says:
>
> Can someone t
You need to give your ChangeLog model a __unicode__ method, then
you'll get titles that make sense.
On Mar 30, 12:45 pm, Phil Edwards wrote:
> Hi All:
>
> First off, apologies if this message ends up appearing twice - I had a
> minor problem getting Google to recognise that I'd subscribed...
>
>
I'm having an opera file upload issue, which may not be django's
fault, but I'm curious if anyone has seen it (and has a solution)...
When I upload an image *only in opera* (specifically 9.64 on mac osx)
it doesn't appear in request.FILES. However, if I upload a really
small image 8kb, it works.
Im having a small problem with my satchmo installation that i hope is
just something obvious i have overlooked.
I have my SHOP_BASE set to “/shop” and everything works fine when I go
to test.com/shop, but as soon as I navigate to a category or product
the url changes to test.com/test/shop/categor
Hello,
You will love this one,
models.py
*
class LayersOfUsers(models.Model):
name = models.CharField(max_length=50)
desc = models.TextField(null=True)
geouser = models.ForeignKey(User)
def __unicode__(self):
return self.name
class Species_d(models.Model):
speciesNam
thanks Herbert for your comment,
I'll give sphene a serious try then!!
stefano
On Mar 26, 9:24 pm, herbert wrote:
> hi,
>
> i can only comment on my ownforum- SCThttp://sct.sphene.net
> unfortunately it does not have a big developer community behind it
> (yet? :) ) just the occasional contribu
This is my first attempt to merge HTML design with a Django construct
provided by another developer. I have gone through the FAQ and
searched about, but it seems most information here is, understandably,
about development rather than design.
Frankly, I don't know where to begin. I see the HTML fi
I have been working hard lately to figure out as many of the pieces of
django as possible, and it occurs to me that the python manage.py
startapp script just isn't good enough.
Here's the problem, as I see it:
- The startapp script doesn't complete about 80% of the actions
necessary to make a ba
Sorry for the delay, i've been sidetracked multiple times in the last
few days. The code is post here:
http://dpaste.com/21221/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
btw, in regards to the 2001 forum post - I went into the upload
handler and had it raise an exception on the content-type, and this
was formed properly on one line
On Mar 30, 12:37 pm, Peter wrote:
> I'm having an opera file upload issue, which may not be django's
> fault, but I'm curious if any
On 30-Mar-09, at 10:21 AM, mjlissner wrote:
> - The startapp script doesn't complete about 80% of the actions
> necessary to make a basic app
> - There are eight files (!) that need to be completed/edited for an
> app to work (admin.py, forms.py, views.py, models.py, index.html,
> urls.py needs
Is it possible to use limit_choices_to with a dynamic model attribute?
Some background: I am using a StaffMember model for content creators
who do not have user accounts. Each staff member has a start and end
date and the model has a dynamic attribute called 'is_active' that
compares the start/en
Hi.
You really dont give much information, when this
happens traceback ect, but a wild guess would
be to check your imports.
~Jakob
On Mar 30, 7:04 pm, Adonis wrote:
> Hello,
> You will love this one,
>
> models.py
> *
> class LayersOfUsers(models.Model):
> name = models.CharField(max_lengt
So the fun continues. I realized that i did not need to use the
login_required decorator on this function since it's just tossed
around in the backend, so i took that out thinking it would prevent
decorators.py from being called. When i hit the function above now,
it posts the same error with a
In the documentation for Generic Relations, a Vegetable and Animal can
be Tagged via a GenericInline for each model.
I want to be able to choose a tag and subsequently add/remove which
models have that tag via a ManyToMany-style inline.
Is this already available, or do I have to roll my own? I
Hey All,
I seem to be getting into the habit of replying to myself. I hope
this means that my needs are esoteric, and not uninteresting.
I have posted a snippet that allows you to define a workflow like
contrib.formtools FormPreview, but for complex html forms that are
composed of more than one
> This has been discussed quite a few times before I believe, so maybe
> do a bit of googling on that first.
Huh. I looked before, and I'm looking now, and I don't see those
threads. Maybe I'm not thinking of the right way to search this.
Before I put my foot in my mouth, do you have any links t
Ah, after playing with the code some more I resolved my own problem.
Instead of relying on the 'is_active' dynamic model attribute for use
with limit_choices_to, I was able to get the following to accomplish
the same task:
limit_choices_to={ 'end_date__gte': datetime.date.today,
'start_date__lte'
On Mon, Mar 30, 2009 at 2:23 PM, Robocop wrote:
>
> So the fun continues. I realized that i did not need to use the
> login_required decorator on this function since it's just tossed
> around in the backend, so i took that out thinking it would prevent
> decorators.py from being called.
Did yo
Here is the 1st one I found -
http://groups.google.com/group/django-users/browse_thread/thread/12ef62e11d0ba806/a9573c82a6c672ab?lnk=gst&q=manage.py#a9573c82a6c672ab
On Mar 30, 9:46 pm, mjlissner wrote:
> > This has been discussed quite a few times before I believe, so maybe
> > do a bit of goo
Bingo! Looks like i was lazy with my code and threw decorators on ALL
the functions, not just my views. There was a lingering decorator on
the send_file function that i did not notice. Thanks for pointing out
my sloppines;) You saved me a ton of time today, double thanks!
On Mar 30, 12:02 pm,
After tooling around with it a bit, I simplified it so that each
Vegetable/Animal has a ManyToMany relationship with a Tag.
But I still would like to find a way of consolidating the editing of
where a Tag points on the actual TagAdmin page.
On Mar 30, 1:24 pm, Liquidrums wrote:
> In the documen
On Mar 30, 12:44 pm, Worldreptiles wrote:
> Im having a small problem with my satchmo installation that i hope is
> just something obvious i have overlooked.
>
> I have my SHOP_BASE set to “/shop” and everything works fine when I go
> to test.com/shop, but as soon as I navigate to a category or
Django is pretty flexible, so it's impossible to say exactly how to
integrate with your existing design since the original developer could
have done the template layout in a number of different ways. Since
the development process is a bit different that php, you might want to
step through the tut
felix wrote:
> class ContactAdmin(Admin):
>
> form = EditContactForm
>
>
> EditContactForm has a save method that is never called by the Admin
>
> but its clean() function does get called
>
> 60 def clean(self):
> 61 import pdb; pdb.set_trace()
>
> my confusion is that
Hello,
I'm new to django/python and I'm trying to use django-registration in
my first app but I'm having problems rendering the activation_key in
the email message i.e., the email_message.txt file passed as the first
argument to render_to_string() will render it's own content but the
dictionary p
thank you, you were right. It was an apache problem.
Miguel
Sent from: Madrid Spain.
On Mon, Mar 30, 2009 at 4:43 PM, Thomas Guettler wrote:
>
> Hi,
>
> If you only change the method, but no model, you don't need to call
> 'syncdb'.
>
> If your webserver is configured correct, then you just ne
Hello folks. I'm new to python, new to Django, but very old to ORMs
(via Java's Hibernate, mostly)...
I naively assumed that QuerySet.filter() would return me None, if
there were no results. Instead it returns an empty list. That's not
terrible, but for some things, it can make code more cumberso
I think you are looking for get()
facilityList = Facility.objects.get(name = facilityName)
http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups
Dougal
---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/
2009/3/30 famousactress :
>
> Hello folks. I'm new to python
I don't think so.. because I was using .get() first, and found that it
throws an exception if the query returns no results. Isn't that true?
I prefer my exceptions to be, exceptional :)
Phill
On Mar 30, 3:07 pm, Dougal Matthews wrote:
> I think you are looking for get()
>
> facilityList = Facil
On Mon, Mar 30, 2009 at 5:20 PM, famousactress wrote:
>
> Hello folks. I'm new to python, new to Django, but very old to ORMs
> (via Java's Hibernate, mostly)...
>
> I naively assumed that QuerySet.filter() would return me None, if
> there were no results. Instead it returns an empty list. That's
On Mon, Mar 30, 2009 at 6:26 PM, famousactress wrote:
>
> I don't think so.. because I was using .get() first, and found that it
> throws an exception if the query returns no results. Isn't that true?
> I prefer my exceptions to be, exceptional :)
>
> Phill
>
> On Mar 30, 3:07 pm, Dougal Matthews
Ooooh. Thanks, Karen.. This is exactly what I wanted. Although I still
wouldn't mind a function for when I'm not planning to immediately
create the object. Thanks for the tip!
On Mar 30, 3:27 pm, Karen Tracey wrote:
> I think you missed get_or_create:
>
> http://docs.djangoproject.com/en/dev/ref
On Mon, Mar 30, 2009 at 6:34 PM, famousactress wrote:
>
> Ooooh. Thanks, Karen.. This is exactly what I wanted. Although I still
> wouldn't mind a function for when I'm not planning to immediately
> create the object. Thanks for the tip!
>
> On Mar 30, 3:27 pm, Karen Tracey wrote:
> > I think you
Your permission is appreciated :)
That said, wrapping up functions for utility is kinda the point of an
API so I figured I'd toss the question out to see whether or not
something that does this already exists or if enough folks think it
ought to to merit a patch. I'm curious what the motivation
On Mar 31, 1:43 am, Thomas Guettler wrote:
> Hi,
>
> If you only change the method, but no model, you don't need to call 'syncdb'.
>
> If your webserver is configured correct, then you just need to hit ctrl-r
> (reload
> in firefox).
>
> This should work if you use the development server of dj
On Mon, 2009-03-30 at 15:53 -0700, famousactress wrote:
>
> Your permission is appreciated :)
>
> That said, wrapping up functions for utility is kinda the point of an
> API so I figured I'd toss the question out to see whether or not
> something that does this already exists or if enough folks
With django 1.0.2 and Python 2.5, when I use the keyword
DateField.input_formats, I get the error that __init__() got an
unexpected keyword argument 'input_formats'. When I look in the
__init__ definition, I don't see input_formats as one of the
acceptable keyword arguments.
I thought that input_
I have my first Django app running, but with very basic html. I'm
trying to add my first tag and finding it difficult to serve up
the image file.
I've read this: http://docs.djangoproject.com/en/dev/howto/static-
files/?from=olddocs, which points out that having django serve static
conten
On Mon, 2009-03-30 at 16:24 -0700, Mitch wrote:
> With django 1.0.2 and Python 2.5, when I use the keyword
> DateField.input_formats, I get the error that __init__() got an
> unexpected keyword argument 'input_formats'. When I look in the
> __init__ definition, I don't see input_formats as one of
On Mon, Mar 30, 2009 at 7:24 PM, Mitch wrote:
>
> With django 1.0.2 and Python 2.5, when I use the keyword
> DateField.input_formats, I get the error that __init__() got an
> unexpected keyword argument 'input_formats'. When I look in the
> __init__ definition, I don't see input_formats as one of
On Mon, Mar 30, 2009 at 7:40 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
> Presumably you are talking about calling the constructor of
> forms.DateField here, since you don't mention what __init__ method you
> are calling. Support for the input_formats argument to
> DateField.__init_
On Mon, 2009-03-30 at 19:48 -0400, Karen Tracey wrote:
> On Mon, Mar 30, 2009 at 7:40 PM, Malcolm Tredinnick
> wrote:
> Presumably you are talking about calling the constructor of
> forms.DateField here, since you don't mention what __init__
> method you
> are call
On Mar 31, 10:37 am, Jack Orenstein wrote:
> I have my first Django app running, but with very basic html. I'm
> trying to add my first tag and finding it difficult to serve up
> the image file.
>
> I've read this:http://docs.djangoproject.com/en/dev/howto/static-
> files/?from=olddocs, wh
You don't say whether you are using mod_python, mod_wsgi or fastcgi.
Knowing may be important.
Graham
On Mar 31, 11:59 am, dls wrote:
> I'm running a Django blog on Webfaction using the Byteflow engine, and
> I'm having an issue where this url:
>
> http://realvelour.com/blog/2009/
>
> works fin
I'm running a Django blog on Webfaction using the Byteflow engine, and
I'm having an issue where this url:
http://realvelour.com/blog/2009/
works fine on my development server (the default Django dev server),
but triggers a 404 error on the real Apache server. My site has been
running for a whil
I have a grid of 51 items that I want to display in 6 columns.. Column
1-5 contain 9 elements, Column 6 contains 6 elements.
This is done by creating 6 div's that are float-left and only 50px
wide. So what I would do is just count in a for loop and when I hit
the row limit just output a "" and i
On Mon, 2009-03-30 at 19:37 -0400, Jack Orenstein wrote:
> I have my first Django app running, but with very basic html. I'm
> trying to add my first tag and finding it difficult to serve up
> the image file.
>
> I've read this: http://docs.djangoproject.com/en/dev/howto/static-
> files/?fr
Ah.. makes sense. I'd noticed that filter() returns QuerySet, but
since QuerySet is essentially polymorphic as a list, I keep forgetting
that's not what it is.. Obviously then, throwing an exception at filter
() can't work, and throwing the exception upon iteration (even if
possible) would be nast
Sorry! This application is running using:
Django (1.0.2)
mod_python (3.3.1)
Python (2.5)
Interestingly, if I try this url:
http://realvelour.com/blog/2009/01/
it works on the live server, but does not display any entries from
that month (January). I'm wondering if the queryset is empty or
some
On Mon, 2009-03-30 at 18:20 -0700, IanR wrote:
> I have a grid of 51 items that I want to display in 6 columns.. Column
> 1-5 contain 9 elements, Column 6 contains 6 elements.
>
> This is done by creating 6 div's that are float-left and only 50px
> wide. So what I would do is just count in a for
On Mon, Mar 30, 2009 at 9:30 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
>
> On Mon, 2009-03-30 at 18:20 -0700, IanR wrote:
> > I have a grid of 51 items that I want to display in 6 columns.. Column
> > 1-5 contain 9 elements, Column 6 contains 6 elements.
> >
> > This is done by cre
Sorry, the post was meant for the satchmo users group. I just wasn't
paying enough attention.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
On Mar 30, 6:11 am, Alfonso wrote:
>
> And in my search view I have a simple filter (which is where I think
> the problem lies):
>
> if date == "next30":
> results = queryset.filter(date_time>=(datetime.datetime.now))
>
> (Attempting to pull future dates just to see something happen)
>
> W
Hello , am wondering , how to auto-populate fields as ( User field , and
current datetime filed ) , i follow up those tips , and created a custom
manager / and manipulator
http://www.b-list.org/weblog/2006/nov/02/django-tips-auto-populated-fields/,
though am wondering if there is another way around
On Mar 30, 10:12 am, LD wrote:
> Hi,
>
> I don't have idea how to do simple task.
> I have model with DateTimeField and I want to retrieve all objects
> that have time for example lower than 2pm.
>
> I know about Django queryset lookup like year, month, day. Is there
> something similar but for t
On Tue, Mar 31, 2009 at 10:45 AM, nick wrote:
>
> Has anyone bought and read "Django 1.0 Template Development" by Scott
> Newman? I'd like to know your opinion before I get it.
Luke Plant (one of the Django core developers) reviewed it on his
website a while back:
http://lukeplant.me.uk/blog.ph
Try this more recent one:
http://www.b-list.org/weblog/2008/dec/24/admin/
On 30-Mar-09, at 7:29 PM, Dr.Hamza Mousa wrote:
> Hello , am wondering , how to auto-populate fields as ( User field ,
> and current datetime filed ) , i follow up those tips , and created
> a custom manager / and mani
On Mar 30, 7:45 pm, Karen Tracey wrote:
> On Mon, Mar 30, 2009 at 7:24 PM, Mitch wrote:
>
> > With django 1.0.2 and Python 2.5, when I use the keyword
> > DateField.input_formats, I get the error that __init__() got an
> > unexpected keyword argument 'input_formats'. When I look in the
> > __ini
On Mar 30, 7:45 pm, Karen Tracey wrote:
> On Mon, Mar 30, 2009 at 7:24 PM, Mitch wrote:
>
> > With django 1.0.2 and Python 2.5, when I use the keyword
> > DateField.input_formats, I get the error that __init__() got an
> > unexpected keyword argument 'input_formats'. When I look in the
> > __ini
Has anyone bought and read "Django 1.0 Template Development" by Scott
Newman? I'd like to know your opinion before I get it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group
On Mar 30, 7:45 pm, Karen Tracey wrote:
> On Mon, Mar 30, 2009 at 7:24 PM, Mitch wrote:
>
> > With django 1.0.2 and Python 2.5, when I use the keyword
> > DateField.input_formats, I get the error that __init__() got an
> > unexpected keyword argument 'input_formats'. When I look in the
> > __ini
85 matches
Mail list logo