Like Statement in Raw SQL

2009-03-30 Thread Francisco Rivas
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

pagination

2009-03-30 Thread Konstantin S
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

Date Filtering in Django-Sphinx

2009-03-30 Thread Alfonso
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

Re: Like Statement in Raw SQL

2009-03-30 Thread Francisco Rivas
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

Re: Like Statement in Raw SQL

2009-03-30 Thread Francisco Rivas
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

_clone method in list_detail (generic views) loses information?

2009-03-30 Thread tonemcd
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

First Django project - Admin question

2009-03-30 Thread PhilE
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

Re: pagination

2009-03-30 Thread Briel
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

Re: _clone method in list_detail (generic views) loses information?

2009-03-30 Thread tonemcd
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

Re: Admin interface question

2009-03-30 Thread Phil Edwards
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

Re: pagination

2009-03-30 Thread Bartek SQ9MEV
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

Re: First Django project - Admin question

2009-03-30 Thread Daniel Roseman
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

Note to serbian language translators/users

2009-03-30 Thread foxbunny
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

Re: JSON Model Serialization

2009-03-30 Thread Mateusz Wawrzyniak
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 > ,

Re: Like Statement in Raw SQL

2009-03-30 Thread Matthew Somerville
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

Admin interface question

2009-03-30 Thread Phil Edwards
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

Talented Django Developer required for short-term project

2009-03-30 Thread ldm999
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,

Using model instance properties in QuerySets in ModelForm's __init__()

2009-03-30 Thread Marek Wawrzyczek
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)

Re: pagination

2009-03-30 Thread Benjamin Buch
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

Re: First Django project - Admin question

2009-03-30 Thread Phil Edwards
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

Updating a model method

2009-03-30 Thread Miguel
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.

Re: Updating a model method

2009-03-30 Thread Thomas Guettler
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

Time lookup

2009-03-30 Thread LD
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

Re: DjangoBook forms

2009-03-30 Thread Andy Mckay
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

Re: Admin interface question

2009-03-30 Thread John Smith
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... > >

Opera File Upload Issue

2009-03-30 Thread Peter
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.

project name in url?

2009-03-30 Thread Worldreptiles
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

weird name error

2009-03-30 Thread Adonis
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

Re: Snap and SCT - any reviews?

2009-03-30 Thread StefanoC
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

Skinning a project with pre-designed DIV?

2009-03-30 Thread Ape Science
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

Script the New App Process

2009-03-30 Thread mjlissner
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

Re: Confused by attribute error

2009-03-30 Thread Robocop
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

Re: Opera File Upload Issue

2009-03-30 Thread pcoles
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

Re: Script the New App Process

2009-03-30 Thread Andy Mckay
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

limit_choices_to using a dynamic model attribute

2009-03-30 Thread Jamie
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

Re: weird name error

2009-03-30 Thread Briel
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

Re: Confused by attribute error

2009-03-30 Thread Robocop
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

[Django Admin + Generic Relations] ManyToMany Model Inline?

2009-03-30 Thread Liquidrums
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

Re: formtools and formsets

2009-03-30 Thread James Smagala
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

Re: Script the New App Process

2009-03-30 Thread mjlissner
> 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

Re: limit_choices_to using a dynamic model attribute

2009-03-30 Thread Jamie
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'

Re: Confused by attribute error

2009-03-30 Thread Karen Tracey
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

Re: Script the New App Process

2009-03-30 Thread TomBurke
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

Re: Confused by attribute error

2009-03-30 Thread Robocop
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,

Re: ManyToMany Model Inline?

2009-03-30 Thread Liquidrums
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

Re: project name in url?

2009-03-30 Thread Rajesh D
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

Re: Skinning a project with pre-designed DIV?

2009-03-30 Thread Doug B
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

Re: custom form in admin debugging confusion

2009-03-30 Thread Rajesh Dhawan
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

django-registration - newbie - rendering dictionary values

2009-03-30 Thread neri...@gmail.com
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

Re: Updating a model method

2009-03-30 Thread Miguel
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

QuerySet.only()?

2009-03-30 Thread famousactress
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

Re: QuerySet.only()?

2009-03-30 Thread Dougal Matthews
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

Re: QuerySet.only()?

2009-03-30 Thread famousactress
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

Re: QuerySet.only()?

2009-03-30 Thread Karen Tracey
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

Re: QuerySet.only()?

2009-03-30 Thread Alex Gaynor
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

Re: QuerySet.only()?

2009-03-30 Thread famousactress
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

Re: QuerySet.only()?

2009-03-30 Thread Alex Gaynor
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

Re: QuerySet.only()?

2009-03-30 Thread famousactress
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

Re: Updating a model method

2009-03-30 Thread Graham Dumpleton
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

Re: QuerySet.only()?

2009-03-30 Thread Malcolm Tredinnick
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

Why isn’t keyword DateField.input_formats recognized in django 1.0.2 and Python 2.5?

2009-03-30 Thread Mitch
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_

Serving static content

2009-03-30 Thread Jack Orenstein
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

Re: Why isn’t keyword DateField.input_formats recognized in django 1.0.2 and Python 2.5?

2009-03-30 Thread Malcolm Tredinnick
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

Re: Why isn’t keyword DateField.input_formats recogniz ed in django 1.0.2 and Python 2.5?

2009-03-30 Thread Karen Tracey
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

Re: Why isn’t keyword DateField.input_formats recognized in django 1.0.2 and Python 2.5?

2009-03-30 Thread Karen Tracey
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_

Re: Why isn’t keyword DateField.input_formats recognized in django 1.0.2 and Python 2.5?

2009-03-30 Thread Malcolm Tredinnick
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

Re: Serving static content

2009-03-30 Thread Graham Dumpleton
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

Re: dev server vs. real server oddity

2009-03-30 Thread Graham Dumpleton
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

dev server vs. real server oddity

2009-03-30 Thread dls
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

How would you code a template to do this (template logic)

2009-03-30 Thread IanR
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

Re: Serving static content

2009-03-30 Thread Malcolm Tredinnick
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

Re: QuerySet.only()?

2009-03-30 Thread famousactress
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

Re: dev server vs. real server oddity

2009-03-30 Thread dls
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

Re: How would you code a template to do this (template logic)

2009-03-30 Thread Malcolm Tredinnick
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

Re: How would you code a template to do this (template logic)

2009-03-30 Thread Alex Gaynor
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

Re: project name in url?

2009-03-30 Thread Worldreptiles
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-

Re: Date Filtering in Django-Sphinx

2009-03-30 Thread Brian Neal
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

Auto-populate fields in django?

2009-03-30 Thread Dr.Hamza Mousa
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

Re: Time lookup

2009-03-30 Thread Brian Neal
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

Re: Django 1.0 Template Book

2009-03-30 Thread Russell Keith-Magee
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

Re: Auto-populate fields in django?

2009-03-30 Thread Andy Mckay
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

Re: Why isn’t keyword DateField.input_formats recogniz ed in django 1.0.2 and Python 2.5?

2009-03-30 Thread Mitch
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

Re: Why isn’t keyword DateField.input_formats recogniz ed in django 1.0.2 and Python 2.5?

2009-03-30 Thread Mitch
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

Django 1.0 Template Book

2009-03-30 Thread nick
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

Re: Why isn’t keyword DateField.input_formats recogniz ed in django 1.0.2 and Python 2.5?

2009-03-30 Thread Mitch
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