Hello Django-users,
Actually it's more of a basic Python problem than a Django problem.
I'll try to be brief:
In the view, I'm looping through my posts as such:
---
def archive(request):
years = Post.objects.dates('pub_date', 'year')
for year in years:
print year.year
mon
I've used named URLs for some time now, never had any trouble with
them.
But now I have added an app 'website' to a new Django project.
(version 1.1 beta 1 SVN-10924)
My root urlconf (as defined in settings.py) contains an include to
website.urls:
---
urlpatterns = patterns('',
(r'^admin/doc/
Hello django-users,
I'm having some trouble with a date-range filter.
My goal is to prevent a model from being saved when it's date-range
overlaps with existing records.
Apparently, the math is quite straightforward:
( start1 <= end2 and start2 <= end1 )
if TRUE, the ranges overlap (*)
Still
Thanks for the quick reply.
I almost gave up, but I just found something that seems to work for
me.
So I've tried:
---
filename = codecs.BOM_UTF8.decode(postfile['filename'])
---
...which gave a LookupError.
Then I tried casting to Unicode:
---
filename = unicode(postfile['filename'])
---
...whi
Hello,
I'm running Django r7548 using PostgreSQL 8.3 on Leopard.
The problem: When I upload a file with a filename like '.jpg', I
get the following error:
---
UnicodeDecodeError at /library/documents/12114/addFile/
'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in
range(128)
I had to define the callable function before it gets called.
So in your case I'd put it right under class Product(models.model)
Then you should be able to just do:
upload_to=get_image_path
Cheers,
On Sep 18, 10:20 pm, lingrlongr <[EMAIL PROTECTED]> wrote:
> According to the documentation, I ca
Hello django-users,
What is the preferred way of extending the Admin interface with
functionality (not just a template override) (using the newforms
admin)? I ask because I'm trying to build something simple.
I have a model NewsletterSubscriber which has just a name, an active
boolean, and an e-
Hello Django-users,
Say I have a model that returns its name like this:
def __unicode__(self):
return str(self.distance_min) + "-" + str(self.distance_max)
I want to filter this model based on those two values:
Distance.objects.filter("241-250")
this obviously does not work, but is it p
Ok I need some thoughts on the following. For a client, we need to
redesign their website. The back-end was coded a couple of years ago
in classic ASP. It's fairly complex, with a webshop, uploading and
parsing of excel files with new collections of clothing, and stuff
like that. It took people ab
I'm sorry if the formatting in my post is messed up... (safari &
google groups)
if the example is not clear, I will try to attach it as plain text.
On Apr 17, 10:42 am, gnijholt <[EMAIL PROTECTED]> wrote:
> Hello Django-users,
>
> Could there be a bug in PyTextile that
Hello Django-users,
Could there be a bug in PyTextile that's currently 'shipped' with
Django? (textile-2.0.11)
If I filter the following through textile:
"[EMAIL PROTECTED]":mailto:[EMAIL PROTECTED]
I get the following output as a result:
mailto:[EMAIL PROTECTED]">john.mailto:[EMAIL PROTECTED]"
Just watched a co-worker demonstrate fixtures in Django, which worked
fast and flawlessly.
>From what I understand, it takes JSON or XML files, but is it also
possible to do Rails-style dynamic fixtures?
Would be nice to generate a fixture with a few lines of Python instead
of having to extract fr
I would like to do this as well, and I have no idea where to start in
order to solve the problem in an elegant and DRY way.
On Jan 18, 6:26 pm, "Scott Zheng" <[EMAIL PROTECTED]> wrote:
> I working on an cms site with django ,I use the admin site too.there is
> a departmenttreelike below :
>
> Big
13 matches
Mail list logo