Re: Admin URL for filtering

2008-02-22 Thread sanrioyt
Thanks Julien for the reply. However, it does not work. When I go to: http://:8000/project/app/student__id__in=15__id__in=2 It only displays the student whose id is 2 (i.e., takes the second part and ignores the first part). And if I go to: http://:8000/project/app/student__id__in=2__id__in=15

Re: How to compare between two attributes of the model?

2008-02-22 Thread johan de taeye
An extra clause allows you to do this: Project.objects.extra(where=['expected_start_date > actual_start_date']) On Feb 23, 8:16 am, shabda <[EMAIL PROTECTED]> wrote: > I have a model like, > > class Project(models.Model): >    name = models.CharField() >    expected_start_date =

Re: How to compare between two attributes of the model?

2008-02-22 Thread Malcolm Tredinnick
On Fri, 2008-02-22 at 23:16 -0800, shabda wrote: > I have a model like, > > class Project(models.Model): >name = models.CharField() >expected_start_date = models.DateField() >actual_start_date = models.DateField() > > I want to translate the SQL query, > SELECT * FROM project WHERE

Re: TestClient assertFormError method.

2008-02-22 Thread Russell Keith-Magee
On Sat, Feb 23, 2008 at 9:43 AM, Ian Macdonald <[EMAIL PROTECTED]> wrote: > > If I separate the form out from the dictionary however, the test > works, so it appears that it's the secondary lookup that this > assertion cannot handle. Does anyone know if that's correct, and/or if > there's a

Re: Issues with IE7 and {% for %} {% endfor %} tag

2008-02-22 Thread John M
for those of us who don't know enough about cookies and IE7, could you expand on the issue, and how u found it was cookies please. John On Feb 21, 8:30 am, merric <[EMAIL PROTECTED]> wrote: > It was a cookie issue. I had looked over this... but missed it on > first glance. My apologies > >

mysqldb fails to import after following directions

2008-02-22 Thread newbiedoobiedoo
Hello, I am running Mac OS X 10.4, have installed Python 2.3, and MySQL 14.7, Distrib 4.1.22 Am in the process of setting up the mysqldb and it succeeds to install and build, however, the import mysqldb test command still fails. I downloaded the folder MySQL-python-1.2.2 from the sourceforge

Re: inspect models in view

2008-02-22 Thread Malcolm Tredinnick
On Fri, 2008-02-22 at 16:49 -0800, Carl wrote: > Hi there, > > I don't find a solution to this problem even if it sounds quite simple > to me. I want to inspect a model, that means a class derived from > django.db.models.Model in order to get it's fields and their types - > that's all! Look at

inspect models in view

2008-02-22 Thread Carl
Hi there, I don't find a solution to this problem even if it sounds quite simple to me. I want to inspect a model, that means a class derived from django.db.models.Model in order to get it's fields and their types - that's all! Anyone an idea? Thanks in advance! Carl

TestClient assertFormError method.

2008-02-22 Thread Ian Macdonald
I'm fairly new to Django, but seem to be getting the hang of it. I do have a small issue that's been bugging me a bit with the test client: I've been writing tests for a form on a small site using the TestClient. When I test for invalid data in the form I'm getting odd errors. The problem

زواج وتعارف

2008-02-22 Thread seo
أكبر موقع زواج وتعارف http://www.zw2j.com/ar --~--~-~--~~~---~--~~ 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,

Re: Need some help with a query if you can :)

2008-02-22 Thread Julien
If you look at my code, I put "related_name='threads'" If you don't specify that, then it is automatically set to "thread_set" (see here: http://django.tomsk.ru/documentation/models/reverse_lookup/) Also, in your view, do this instead: return render_to_response('people/threads.html', {

Re: Need some help with a query if you can :)

2008-02-22 Thread Darthmahon
Ok, just tried this: View: - # get threads for friends threads = [] for friend in friends: threads.append([friend, friend.thread_set.all()]) - This appears to print something back, but it looks like it is just printing my friends. Not sure how to loop through this result properly

Re: Need some help with a query if you can :)

2008-02-22 Thread Darthmahon
Hi Julien, Just gave that a go, getting an error: 'User' object has no attribute 'threads' I'm guessing that because I am referring to the User model, which has no direct relation to the Thread module, this won't work? Julien wrote: > Hi, how about this? (I haven't tested it myself) > >

Re: Problem with custom filter

2008-02-22 Thread Julien
And don't forget to create an emtpy __init__.py file in that templatetags/ or you may still get the same error. On Feb 23, 8:14 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-02-22 at 22:11 +0100, Florian Lindner wrote: > > Hello, > > I want to write a custom filter. > > > I

Re: Admin URL for filtering

2008-02-22 Thread Julien
Hi, If I recal, you need to repeat the variable name in the URL to actually pass a list of values. Try this and see how you go: http://:8000/project/app/student__id__in=15__id__in=2 On Feb 23, 7:55 am, [EMAIL PROTECTED] wrote: > Hi all. > > Is it possible to pass the following using the admin

Re: How to query ManyToManyFields

2008-02-22 Thread Albert Hopkins
On Thu, 2008-02-21 at 17:17 -0600, Brett Hoerner wrote: > On Thu, Feb 21, 2008 at 5:06 PM, Albert Hopkins <[EMAIL PROTECTED]> wrote: > > I have a model with a M2M field and I want to filter based on the field > > being empty. How do I do this? I tried > > MyModel.objects.filter(m2mfield=[])

Re: Need some help with a query if you can :)

2008-02-22 Thread Julien
Hi, how about this? (I haven't tested it myself) Models: --- class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) friends = models.ManyToManyField(User, blank=True, related_name='friends') class Thread(models.Model): title =

Re: self referential manytomany

2008-02-22 Thread Michael Newman
I was afraid of that. Thanks Malcolm. On Feb 22, 4:10 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-02-21 at 08:44 -0800, Michael Newman wrote: > > I am a bit confused as to why it is that this gives me an error. I > > hope someone could explain it to me. > > > Let's say I

Need some help with a query if you can :)

2008-02-22 Thread Darthmahon
Hey, I have three models but I can only handle the relationship between two at any one time. Basically I have a page that needs to show a threads the current user's friends are currently participating in. I.E. something like this: Thread: ABC Participating: Friend 1 Thread: XYZ Participating:

Re: Problem with custom filter

2008-02-22 Thread Malcolm Tredinnick
On Fri, 2008-02-22 at 22:11 +0100, Florian Lindner wrote: > Hello, > I want to write a custom filter. > > I have a file called markdown.py inside my application directory with: Inside your application directory isn't the correct place. It must be inside a directory called templatetags/ which

Problem with custom filter

2008-02-22 Thread Florian Lindner
Hello, I want to write a custom filter. I have a file called markdown.py inside my application directory with: register = Library() @register.filter def markdown(value, arg): print type(value) return value settings.py contains: INSTALLED_APPS = ( 'django.contrib.auth',

Re: self referential manytomany

2008-02-22 Thread Malcolm Tredinnick
On Thu, 2008-02-21 at 08:44 -0800, Michael Newman wrote: > I am a bit confused as to why it is that this gives me an error. I > hope someone could explain it to me. > > Let's say I have users with Profiles that can be connected to the one > Web page that they can author. The other Users can

Admin URL for filtering

2008-02-22 Thread sanrioyt
Hi all. Is it possible to pass the following using the admin url: http://:8000/project/app/student__id__in=15,2 I am looking for a value of 15. Currently, both admin and newadmin translates it to the query: student__id__in ('1','5',','2') Is there a way to only let it translate to:

Re: MEDIA_URL doesnt work

2008-02-22 Thread Justin Lilly
You should def. read those articles. A quick fix (if you're in a time crunch) is to add this to your base urls.py inserting the proper values: if settings.DEBUG: urlpatterns += patterns('', (r'^my_sites_media_folder/(?P.*)$', 'django.views.static.serve', {'document_root':

Re: MEDIA_URL doesnt work

2008-02-22 Thread Pete Crosier
Have a look at the links below, I think you're over-estimating what MEDIA_URL does for you - http://www.djangoproject.com/documentation/static_files/ http://www.djangoproject.com/documentation/settings/#media-url On Feb 22, 7:54 pm, troeten <[EMAIL PROTECTED]> wrote: > Hi, > i have a problem

Re: MEDIA_URL doesnt work

2008-02-22 Thread Alex Koshelev
http://www.djangoproject.com/documentation/static_files/ troeten wrote: > Hi, > i have a problem with the MEDIA_URL in django. > My settings.py section looks like this: > > # Absolute path to the directory that holds media. > # Example: "/home/media/media.lawrence.com/" > MEDIA_ROOT =

MEDIA_URL doesnt work

2008-02-22 Thread troeten
Hi, i have a problem with the MEDIA_URL in django. My settings.py section looks like this: # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '/Users/stefan/Development/ju_amerang/media/' # URL that handles the media served from

Re: wordpress hooks and actions system in django?

2008-02-22 Thread [EMAIL PROTECTED]
I had an idea about this, I would just like to say it is porbably un- pythonic, scary, and completely untested, here goes: Create a model for plugins, it should have a filefield and a few other fields for meta data(these should not be editable), plus a boolean field for enabled. Essentially what

Re: django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
Please ignore the previous message. I think I am too sleepy now, and am seeing things which do not exist. :) . On Feb 22, 11:57 pm, shabda <[EMAIL PROTECTED]> wrote: > Aww, I seems a call to c.get('/dashboard/') gets an object of type > HttpResponse while c.get('/dashboard/', {}) gets a Response

Re: django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
Aww, I seems a call to c.get('/dashboard/') gets an object of type HttpResponse while c.get('/dashboard/', {}) gets a Response object. On Feb 22, 11:50 pm, shabda <[EMAIL PROTECTED]> wrote: > I have some test code written like, > > def testDashBoard(self): > c = Client() > print

django.test.client.Client returns HttpResponse/ How to make the test client follow 302 status codes?

2008-02-22 Thread shabda
I have some test code written like, def testDashBoard(self): c = Client() print c.login(username = 'Shabda', password= 'shabda') response = c.get('/dashboard/') print response.headers['X-View'] This is giving me error

Don't Miss It ................

2008-02-22 Thread raja vathani
Adobe photoshop cs3 [image: Adobe photoshop cs3] Foreground Lighting mprove your portraits with this easy and effective foreground lighting

Hi Friend.........Tips 4u

2008-02-22 Thread raja vathani
Interior Design Ideas Episode Hi friends here u learn about interior design and how to make in AutoCAD u want any details please comments have a nice day enjoy and Learn This site provides great tutorials / lessons for the student of

Re: wordpress hooks and actions system in django?

2008-02-22 Thread canen
Just chiming in here. There is a Wordpress 'clone' written in Python called Textpress [1]. It implements a lightweight events/actions system[2] akin to the one you mentioned. [1] http://textpress.pocoo.org/ [2] http://dev.pocoo.org/projects/textpress/browser/textpress/application.py#L271 On

Re: offline application for searching entire disks of images

2008-02-22 Thread stoKes
On Feb 22, 12:03 pm, stoKes <[EMAIL PROTECTED]> wrote: > offline application searches an entire disk for images, this is going > to be out of the scope and control of media_url. i thought about using > static serve, however, i think that will conflict with the other > existing views. > > anyone

offline application for searching entire disks of images

2008-02-22 Thread stoKes
offline application searches an entire disk for images, this is going to be out of the scope and control of media_url. i thought about using static serve, however, i think that will conflict with the other existing views. anyone know of a way to make this work? thanks adam

Re: Issues with select_related()

2008-02-22 Thread John Leith
right i figured it out: i had " nulls=true " in the field and so it wasn't followed :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Issues with select_related()

2008-02-22 Thread John Leith
I'm noticing some oddness with select_related()... >>> invoice = Invoice.objects.select_related().get(pk=7000) >>> len(connection.queries) 1 >>> invoice.Student_ID >>> len(connection.queries) 2 Shouldn't it be the same number of queries? Here we have an Invoice with a foreign key to a

Re: Newforms-admin Imagefield issues

2008-02-22 Thread Michael Newman
How are you getting the URL for the image? I am not having this same issue using get_image_url in the templates. On Feb 20, 1:23 pm, Aaron Fay <[EMAIL PROTECTED]> wrote: > Hey List,In newforms-admin, when I use an ImageField and specify > (upload_to="myfolder") or (upload_to="myfolder/") the

Re: wordpress hooks and actions system in django?

2008-02-22 Thread Kyle Fox
The part that I'm struggling to wrap my head around is how to make plugins "installable". I think one of the reasons Wordpress's plugin framework is so successful is how easy it is to manage your plugins: install / uninstall buttons on a page means the user doesn't have to write any glue code or

Re: self referential manytomany

2008-02-22 Thread Michael Newman
I am still having this problem. The simple solution is to put all of the Models together, but I would prefer not to do this. I am pretty sure that I have done this before. Is this something that has broken recently in Django? On Feb 21, 12:53 pm, Michael Newman <[EMAIL PROTECTED]> wrote: >

Re: __init.py__ executed more than once?

2008-02-22 Thread Michael Newman
I have been having this issue with newforms admin a lot recently including in a patch for the Auth code. I really think that this is a problem with newforms admin. I think that the Already Registered error should be called silently to fix this issue or admin.py should be imported when the apps

[no subject]

2008-02-22 Thread Ashfaq ali
Hi Here is an opportutnity for you to earn money for your opinion. Click the link below https://paydotcom.com/r/11804/drali1984/3272604/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: ordering by foreignkey again

2008-02-22 Thread bobhaugen
On Feb 22, 9:38 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > See the doc: > > http://www.djangoproject.com/documentation/model-api/#ordering > > where it states: "Note that, regardless of how many fields are in ordering, > the admin site uses only the first field." Ooops...how did I miss

Re: ordering by foreignkey again

2008-02-22 Thread Karen Tracey
On Fri, Feb 22, 2008 at 9:43 AM, bobhaugen <[EMAIL PROTECTED]> wrote: > > Tryingg to work around the problem: > > Previous Avail ordering statement: > > ordering = ('week', 'orders_product.name', > 'orders_producer.name',) > > Changed my models to have sortable foreign key values: > >

Re: Django for xml api based sites

2008-02-22 Thread mg
Bob, I think that django would be a good match for what you want. > 1.need an equivalent option to tomcats servlet filters, to read the > headers and modify the request before it is processed. It sounds like you are looking for the middleware option:

barcode

2008-02-22 Thread Omar Abid
http://barcodemaker.freehostia.com No Need to Purchase Expensive Barcode creator Software when it is Totally Free. Barcodemaker Features : Supports Code 3 of 9 Code 128 Interleaved 2 of 5 EAN-8 EAN-13 Customize print size New => Print many barcode in a page with our Tabling System New => Add

Re: loaddata on big fixture doesn't seem to end

2008-02-22 Thread msoulier
On Feb 21, 10:57 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > I've logged this as #6643. I'm hoping to have some time tonight to > look at a few outstanding fixture tickets; I'll add this one to the > list. Thanks, you guys rock. Mike

Re: ordering by foreignkey again

2008-02-22 Thread bobhaugen
Tryingg to work around the problem: Previous Avail ordering statement: > ordering = ('week', 'orders_product.name', 'orders_producer.name',) Changed my models to have sortable foreign key values: class Producer(models.Model): name = models.CharField(max_length=32, primary_key=True)

Re: TemplateDoesNotExist at /admin/

2008-02-22 Thread Karen Tracey
On Tue, Feb 19, 2008 at 4:28 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Feb 19, 2008 4:06 PM, RichardH <[EMAIL PROTECTED]> wrote: > > > > > Karen, > > Thanks for your analysis. Yes, I can confirm that I don't have the > > locale files either. > > Deleting my Django install and "running

Re: run external script from view

2008-02-22 Thread sector119
I just want run simple external script and don't want to run any daemon for it :) I know about django-queue-service. when I use django.utils.daemonize.become_daemon at script.py and spawnl('script.py') in view I can run script.py in another process and send some HttpResponse, but browser still

Re: run external script from view

2008-02-22 Thread cbmeeks
How about having the view store an entry in something like Amazon's SQS. Then, a daemon would monitor SQS for "script jobs" and then run them. That would give you a good asynchronise (spelling?) system. cbmeeks http://codershangout.com On Feb 22, 5:23 am, sector119 <[EMAIL PROTECTED]> wrote:

ordering by foreignkey again

2008-02-22 Thread bobhaugen
Django newbie wants admin list to be ordered by foreignkey names. I understand from googling that this is a known problem, and has apparently been fixed in the newforms admin branch. (Do I understand correctly?) Questions: 1. This is a new project. (On the other hand, I want to take it all

Re: How to put some data from view the form

2008-02-22 Thread Mintaka
Many thanks Daniel's advice solve the problem. I also try call initial value, form = MyForm(initial={'someArg': 'value',}) It look better, to send data without create __init__ but this doesn't work to me. And this working well: def __init__(self, someArg, *args, **kwargs):

Generic relation lookups

2008-02-22 Thread Daniel Roseman
Hi, I'm working on a project which makes extensive use of generic relations. I'm having trouble with lookups across the generic relation. Cut-down version of the models: class Post(models.Model): text = models.TextField() content_type = models.ForeignKey(ContentType) object_id =

Re: How to put some data from view the form

2008-02-22 Thread Daniel Roseman
On Feb 22, 10:14 am, Mintaka <[EMAIL PROTECTED]> wrote: > Hi > > I would like to put some data from view to form when I create it. > Standard way is to use __init__ metod, but after using __init__ in > form class, > form stop working. > > Pleas what I'am doing wrong? > > Fragments of example > >

run external script from view

2008-02-22 Thread sector119
Hi ALL! How to run some python script from view and not wait and of work of this script, and execute some view code after script call in this view? This python script use django.utils.daemonize.become_daemon to become a daemon. When I run this script from view at _development_ server using

Re: How to put some data from view the form

2008-02-22 Thread Mike H
Hi, Don't implement __init__ yourself, you can pass initial data to the form like this : form = MyForm(initial={'someArg': 'value',}) Hope that helps, Mike On 22 Feb 2008, at 10:14, Mintaka wrote: > > Hi > > I would like to put some data from view to form when I create it. > Standard way

How to put some data from view the form

2008-02-22 Thread Mintaka
Hi I would like to put some data from view to form when I create it. Standard way is to use __init__ metod, but after using __init__ in form class, form stop working. Pleas what I'am doing wrong? Fragments of example - view - def MyView(request):

__init.py__ executed more than once?

2008-02-22 Thread Almir Karic
http://dpaste.com/36380/ here is my code as well as the error, it seems that __init__.py is executed more than once, any ideas why? any ideas how to fix it? (i am trying to follow the reccommandations from http://code.djangoproject.com/wiki/NewformsAdminBranch ) -- error: one bad user found

Re: Converting relational data to hiechical data

2008-02-22 Thread [EMAIL PROTECTED]
Exactly. Django-mptt is very easy to use, and takes away a lot the pain trying to manage hierarchical data in a relational database (and django-mptt does it in an efficient manner). Write if you have any problems with it, and I can help out. Cheers, Lars On Feb 21, 8:25 pm, "Ramiro Morales"

Get Rich off of 12 dollars

2008-02-22 Thread jimdizzle
go to http://jimdizzle420.angelfire.com/ for more details --~--~-~--~~~---~--~~ 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