On Mon, Jan 5, 2009 at 11:59 PM, Ronny Haryanto wrote:
> On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake
> wrote:
>> for category in category_list:
>>results = results.filter(categories__slug = category.slug)
>
> How about results.filter(category__in=category_li
On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake
wrote:
> for category in category_list:
>results = results.filter(categories__slug = category.slug)
How about results.filter(category__in=category_list)?
Ronny
--~--~-~--~~~---~--~~
You received this message bec
On Fri, Jan 2, 2009 at 11:57 PM, Mathieu Steele wrote:
> Here is an example of the data model for the type of filter I would
> like to do:
>
> class Student
> name
>
> class Absence
> foreign key Student
> date
>
> Is there a way to filter Students with no absences?
>
> somethin
G'day all,
Let say I have a wiki-like Django app. I wanted to allow many people
edit a wiki page without any locking, yet have the system prevent two
people saving page updates at almost the same time (one of the updates
would be lost, overwritten by the other one).
This is what I have in mind.
On Wed, Dec 10, 2008 at 12:50 AM, aparajita
<[EMAIL PROTECTED]> wrote:
> I am using django release 1.0.2, nothing modified. My admin interface
> works fine, but the documentation link never appears. I have
> 'django.middleware.doc.XViewMiddleware' in the list of middleware, I
> have my IP address
On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote:
> How do wire Userprofile to UserAdmin ?
Here's one way to do it:
# admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from myproj.myapp.models im
On Tue, Dec 9, 2008 at 4:50 AM, Andrew Fong <[EMAIL PROTECTED]> wrote:
>
> When I'm poking around in my Django app, my development server
> (manage.py runserver) will sometimes quit without raising an exception
> or leaving any messages. I am not tinkering around with the code or
> doing anything
On Sat, Dec 6, 2008 at 2:42 PM, vierda <[EMAIL PROTECTED]> wrote:
> today I try to make login page with follow example code in
> djangoproject (user authentication chapter), code as following below :
>
> def my_view(request):
> username = request.POST['username']
> password = request.POST['pas
On Fri, Nov 28, 2008 at 9:31 AM, Malcolm Tredinnick
<[EMAIL PROTECTED]> wrote:
> On Thu, 2008-11-27 at 07:33 -0800, Benjamin Wohlwend wrote:
> [...]
>
>> but suggesting on an official
>> Django mailing list to pirate a book written by one of the Django core
>> devs is stretching it a bit, don't y
On Sun, Nov 16, 2008 at 12:14 PM, Low Kian Seong <[EMAIL PROTECTED]> wrote:
> Could anyone here please let me know of the logic or example of doing
> a form with dynamic number of fields (ie. a field with a 'Add more
> field' button). I know how to do it using javascript. However it's the
> logic
On Sun, Nov 16, 2008 at 11:50 PM, Ben Gerdemann <[EMAIL PROTECTED]> wrote:
> I've got everything working correctly except for one problem. When
> adding a new foreign key by clicking on the "+" the hidden field is
> correctly updated with the primary key of the new object, but the
> autocomplete f
On Wed, Nov 12, 2008 at 9:39 AM, Eric <[EMAIL PROTECTED]> wrote:
> Hi folks, I am using the default Admin pages for my site, and I have a
> modification/customization question.
>
> I am wondering what the best approach would be to modify the admin
> change list page so that there can be a new row
On Tue, Nov 11, 2008 at 4:20 PM, Alex Rades <[EMAIL PROTECTED]> wrote:
> Is there a way to do it? Here in europe we really use DD-MM-
Yes.
Look for DATE_FORMAT in:
http://docs.djangoproject.com/en/dev/ref/settings/
See also http://code.djangoproject.com/ticket/2203 if you have
USE_I18N = Tr
On Wed, Nov 5, 2008 at 6:30 PM, ammo <[EMAIL PROTECTED]> wrote:
> I have a 'Country' model and I have set its 'verbose_plural_name' to
> 'Countries'. This displays fine in the site administration page
> (earlier it showed Countrys there).
Not sure if this has any relation to your problem, but sho
On Wed, Nov 5, 2008 at 8:23 PM, JoeJ <[EMAIL PROTECTED]> wrote:
> I would guess that this version:
> messages = Message.objects.order_by('-created')[:2]
>
> would be more memory efficient than the:
> messages = Message.objects.all()
> (and then using |slice:":2" to cut out the top 2)
>
> a
On Wed, Nov 5, 2008 at 6:34 PM, Bobo <[EMAIL PROTECTED]> wrote:
> In my Django project I've on the front page a table where I wish to
> load the two newest messages. Then I've a link to a message archive
> where all messages are listed.
>
> My problem is that I don't know how to "filter" my list a
On Wed, Nov 5, 2008 at 5:41 PM, kele <[EMAIL PROTECTED]> wrote:
>
> the debug flag in settings.py .
>
> what i want to do is to only change the DEBUG varialbe to True when
> just the specific remote address( ip) to send the request .
> cause i do not hope all my users can read the err msg while i
On Thu, Oct 30, 2008 at 8:31 AM, megrez80 <[EMAIL PROTECTED]> wrote:
> I want to do something like the following:
>
> my_query_set = my_table.objects.filter(field1 = some_val and
> field2 = another_val)
>
> or
> my_query_set = my_model.objects.filter(field1 = some_val or
> fiel
On Fri, Oct 17, 2008 at 12:23 AM, AmanKow <[EMAIL PROTECTED]> wrote:
> I need to limit choices dynamically by an object, not a class:
> When adding or changing a
> participation object, either in the admin or via model forms, I need
> to limit the choices for cert type to those offered by the
On Fri, Oct 17, 2008 at 12:55 AM, AndyB <[EMAIL PROTECTED]> wrote:
> I've googled and the only problems seem to be with people trying to do
> case-sensite lookups.
>
> What could be going wrong here?:
>
b.filter(name__icontains='Saff')
> []
b.filter(name__icontains='saff')
> []
Could yo
On Mon, Oct 13, 2008 at 3:38 PM, raeldc <[EMAIL PROTECTED]> wrote:
> One of the things I'm wondering about is how to implement mini-content
> boxes. It is known to Joomla as modules, in Drupal as blocks, to
> others they are called widgets or side bars. In CMS systems, I can
> assign a content-box
On Tue, Oct 7, 2008 at 7:31 PM, Leon Yeh | New Avenue.net
<[EMAIL PROTECTED]> wrote:
> Hi Ronny, terima kasih... :-)
Sama-sama :-)
> I am trying to generate different output for css styling purpose.
>
> For example for select widget I need to generate
>
>
> and for other controls, I need to g
On Tue, Oct 7, 2008 at 7:09 AM, Leon Yeh | New Avenue.net
<[EMAIL PROTECTED]> wrote:
> I need to generate a different output based if it is a select input type
> or it is a text field.
>
> This code does not work. I am trying to do something like this:
>
> {% for field in form %}
> {% ifequal fiel
On Thu, Sep 11, 2008 at 5:28 PM, Petar Marić <[EMAIL PROTECTED]> wrote:
> Unfortunately I was unable to participate on DjangoCon because of my
> Master thesis. Will there be a video of some/all the talks?
I saw this at http://twitter.com/djangocon/statuses/917078011:
"DjangoCon videos will be
On Fri, Sep 5, 2008 at 1:53 AM, bkev <[EMAIL PROTECTED]> wrote:
>
> Ronny,
>
> Thank you so very much for your input; it has helped this newbie user
> a great deal. The one outstanding problem I'm having here (and it's
> the last field in my model...) is that I'd actually like to use a
> FloatFiel
On Wed, Sep 3, 2008 at 12:56 AM, Weber Sites <[EMAIL PROTECTED]> wrote:
> I'm trying to follow the Tutorial02 and once i uncomment the admin
> lines in urls.py i get :
>
> ImproperlyConfigured at /mysite/
> Error while importing URLconf 'mysite.urls': name 'admin' is not defined
This probably sou
On Fri, Aug 29, 2008 at 2:54 AM, bkev <[EMAIL PROTECTED]> wrote:
>
> Ronny,
>
> This is fabulous...thank you so very much. If you don't mind me
> asking, can you give me an example of how you implemented this method
> in your Class? In my case, I've defined the field as a DecimalField
> type, but
On Thu, Aug 28, 2008 at 8:27 AM, PENPEN <[EMAIL PROTECTED]> wrote:
> I have a question on the site concept.
> While reading the source code, I found that there is the site related
> statement in django.contrib.auth.views.login:
>
>if Site._meta.installed:
>current_site = Site.objects.g
On Wed, Aug 27, 2008 at 3:13 AM, bkev <[EMAIL PROTECTED]> wrote:
> I'm working on a site that has several imperial measurements (feet and
> inches) and I'd like to implement a field in my model that uses a
> regular expression like:
> ^(\d{1,5})\'((\s?)(-?)(\s?)([0-9]|(1[0-1]))\")?$
> to parse of
On Wed, Aug 20, 2008 at 4:16 PM, coulix <[EMAIL PROTECTED]> wrote:
> Yes, if you can check the Restfull book from Oreilly there is a good
> example on using
> a queue system to submit lengthy job. You submit the work and it gives
> you back an url
> that you can check 'repeatedly' to see the progr
2008/8/20 laspal <[EMAIL PROTECTED]>:
> Can anyone give a link for doing corn job.
Cron is Unix-based scheduler, it's not part of or related to Django.
You most likely need to use a system external to Django to achieve
what you want. One of such systems is cron.
There are plenty of info regardin
On Thu, Jul 17, 2008 at 2:03 AM, Tim Chase
<[EMAIL PROTECTED]> wrote:
>
>> I have a list: data = ['apple', 'orange', 'banana']
>> in my template: {{ data }} will output: ['apple', orange, banana]
>> but {{ data[0] }} will throw an error
>
>
> {{ data.0 }} should do the trick.
Or {{ data|first }}.
On Tue, Jun 17, 2008 at 9:02 AM, saxon75 <[EMAIL PROTECTED]> wrote:
> I'm working on a CMS application and had a question about
> automatically setting certain model fields.
>
> Suppose I have the following model (this is simplified from the actual
> application):
>
> class Item(models.Model):
>
On Tue, Jun 17, 2008 at 9:02 AM, saxon75 <[EMAIL PROTECTED]> wrote:
>
> I'm working on a CMS application and had a question about
> automatically setting certain model fields.
>
> Suppose I have the following model (this is simplified from the actual
> application):
>
> class Item(models.Model):
>
On Sun, Jun 15, 2008 at 1:40 AM, Szymon <[EMAIL PROTECTED]> wrote:
> What I need to import to handle DoesNotExist in process_exception?
> Because DoesNotExist is part of every single model, so I can't import
> it from model, because I don't know which model raises exception.
from django.db import
On Wed, Jun 11, 2008 at 10:00 AM, ge <[EMAIL PROTECTED]> wrote:
> I have what I hope is a simple question here. I do have a working
> solution, but I'd like to know if anyone has any thoughts on cleaner
> or perhaps more proper way to do this.
>
> For simplicities sake, lets assume I am trying to
On Wed, May 21, 2008 at 5:58 PM, sebey <[EMAIL PROTECTED]> wrote:
> I know css does not not have any variables but I was thinking that
> python/django could look though the css file and have
> background-color:{{insert python varible here}}
Django's templating is not restricted to HTML only. You
On Sat, May 17, 2008 at 6:11 PM, mwebs <[EMAIL PROTECTED]> wrote:
> I am using something like this:
>
> model.objects.filter(field = variable)
>
> Is it possible to pass the field that is used for the lookup
> dynamically, so that field is also a variable ?
It's python kwargs (keyword arguments).
On Sun, May 11, 2008 at 11:55 AM, M.Ganesh <[EMAIL PROTECTED]> wrote:
> I am displaying a list of records in a page. I have a link in that page
> which will take me to a form for adding one more record. How do I come
> back to the previous page after adding a record?
If the "previous page" is alw
On Wed, May 7, 2008 at 4:21 PM, Alessandro Ronchi
<[EMAIL PROTECTED]> wrote:
> I want to make the change of the password possible only for administrators
> and
> not the whole staff. Is it possible? How I can do that?
How do you currently allow staff to change password?
Ronny
--~--~-
On Fri, May 2, 2008 at 10:04 AM, Rit Lim <[EMAIL PROTECTED]> wrote:
> "Mary may change news stories, but only the ones she created
> herself..."
>
> How do I go about doing that? I was told I need to write an ACL.
> However, I'm not sure how to do it.
>
> Anyone has some sample code?
The doc
On Wed, Apr 30, 2008 at 12:03 PM, Mike Chambers <[EMAIL PROTECTED]> wrote:
>
> Name
> {{ form.user_name }} {{ form.user_name.errors }}
>
> Is there any way to just get the raw error string?
You should be able to treat form.user_name.errors as
On Tue, Apr 29, 2008 at 9:33 AM, skunkwerk <[EMAIL PROTECTED]> wrote:
> I've got two forms included in my base template, from which a few
> others inherit. Currently I'm passing a newly-constructed form to
> each of the inherited templates in the functions using
> render_to_response, like so:
On Thu, Apr 3, 2008 at 7:36 AM, Julien <[EMAIL PROTECTED]> wrote:
> We're using SVN between several developers to work on the same project
> and it's working quite well. But it's not as simple concerning the
> database.
>
> Each of us has a local database to muck around with, and if one of us
Try:
r'^test/fullpath/(?P[\w/]+)
Ronny
On Mon, Mar 31, 2008 at 4:08 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I'm trying to setup my urls.py file and am having trouble getting the
> args to be passed correctly to my view. I basically have something
> link this:
>
45 matches
Mail list logo