Re: Client testing with custom http request referrer

2008-07-02 Thread Collin Grady
Please do not re-post your question - you already submitted this 7 hours before you posted this one, so you should just wait for replies to that :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Tutorial method was_published_today() - problem

2008-07-02 Thread Collin Grady
You can use tabs, but you have to /always/ use tabs if you do so - you can't mix tabs and spaces, or you hit issues like this :) Especially if your editor is showing tabs as four spaces, since python would use eight. --~--~-~--~~~---~--~~ You received this message

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Collin Grady
Yes, an empty form field would be an empty string, not None, by design. Adding a null would be odd, but possible with custom clean behavior on a form :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Database API reference:

2008-04-02 Thread Collin Grady
You forgot to use person in front of the values of course, since they're still attributes of that dict :) So instead of pnr which is just printing static text "pnr", you need to do {{ person.pnr }} just like every other variable access :) --~--~-~--~~~---~--~~ You

Re: Template Inheritance and Template Context Processors

2008-04-02 Thread Collin Grady
You must use RequestContext in every view for context processors to be active - they won't somehow add the data to the base template automatically without RequestContext being used :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Strange AttributeError when import'ing twitter

2008-02-11 Thread Collin Grady
Don't suppose you called your project or app 'twitter' also? Or any other file on pythonpath? --~--~-~--~~~---~--~~ 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@goo

Re: about dpaste

2008-01-17 Thread Collin Grady
On Jan 17, 6:28 am, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > Hi folks, I need to know how can I search, explore for codes > inhttp://dpaste.com/ > I really can't figure out how. You can't - it is not a database of snippets like djangosnippets.org, but instead a pastebin - p

Re: These waters aren't so friendly after all

2008-01-17 Thread Collin Grady
On Jan 17, 4:01 pm, LRP <[EMAIL PROTECTED]> wrote: > Hmmm, I'm wondering... I'd have little to contribute beyond my > personal blunders, but I'd be delighted to work with any folks who'd > like to prepare a Debian-specific addendum to the on-line Django > tutorial. Personally, I don't think the t

Re: read only in Admin interface

2008-01-16 Thread Collin Grady
On Jan 16, 3:49 am, Serxio <[EMAIL PROTECTED]> wrote: > Overriding the admin/change_form.html template, and wiping out the > line {% submit_row %} may do the trick. If that only hides the HTML, it won't be safe at all. --~--~-~--~~~---~--~~ You received this messag

Re: Django Tutorial02 / TEMPLATE_DIRS

2008-01-16 Thread Collin Grady
On Jan 16, 11:22 am, code_berzerker <[EMAIL PROTECTED]> wrote: > I put my templates somewhere in /var/www/ just beside project code and > media files. If /var/www is a web root, your project code should *not* be there. Don't ever put django code in a web-readable directory if you can help it :) -

Re: help

2008-01-16 Thread Collin Grady
Make sure you did not name an app or project 'csv' as that will conflict with the default csv module. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Unable to find custom filters

2008-01-16 Thread Collin Grady
He did add it - 'test2.test' Did you restart the webserver handling this? Even the dev server needs to be restarted for some things, and template tags are often one of them :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Collin Grady
It doesn't have to be a callable, you just need to use the FORM's initial arg, as Malcolm was initially referring to, not the field's initial argument. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: XML Rendering. Template issue - sub cats

2008-01-07 Thread Collin Grady
Of course it's listing the same clients, you looked up the full list, instead of, say, using the relations to category to get only those clients which belong to that category :) If a client has an fkey to category, then you need to be doing something like {% for client in category.client_set.all

Re: Getting current user id

2008-01-07 Thread Collin Grady
On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > When I used request.user, it outputs the username of the currently > logged in user. When I try and use this as part of the entry into the > table, it won't let me as it's expecting an integer. You are mistaken. When /printing/ the user o

Re: CSS Issues

2008-01-07 Thread Collin Grady
As zodman is getting at, django does not map your media for you - you have to do that. http://www.djangoproject.com/documentation/modpython/#serving-media-files --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Should logic appear in views.py

2008-01-07 Thread Collin Grady
It depends a lot on the use case. Does the function operate on a single model? Will it be run when you already have the instance of the model? If so, it may be a good case for a model function, since it will already have access to the object it's a part of. General purpose helpers can go in view

Re: IRC Channel

2007-11-27 Thread Collin Grady
Er, no, I don't own any IRC channel on freenode :) #django still isn't registered, we need one of the devs to do that before anyone can get op status and actually do anything --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Setting "blank" to one Field?

2007-09-16 Thread Collin Grady
You've misunderstood - you need blank=True /and/ null=True. blank=True will tell admin to let you pick nothing for it, and null=True will then allow the NULL value to be entered. NULL is what you use to signify "unset" on a ForeignKey --~--~-~--~~~---~--~~ You r

Re: Obtaining newforms field values in a template

2007-09-16 Thread Collin Grady
What exactly is your use case here? This should all be handled automatically when you do {{ form.fieldname }}, depending on if it's bound or not :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: concatenating querysets

2007-09-15 Thread Collin Grady
You're going about it the wrong way - you should be combining all the Q objects into one, then just filter with that - it'll do all the queries at once, and give you one queryset back :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Setting "blank" to one Field?

2007-09-15 Thread Collin Grady
There is no such thing as blank, especially on a ForeignKey. blank=True has absolutely nothing to do with the database, as the documentation for it clearly states :) It merely makes it so you can give it no value in form validation, like in admin. --~--~-~--~~~---~-

Re: Problem with generic views (404)

2007-09-15 Thread Collin Grady
Do you actually have any Abbreviation objects? If you don't tell the view to allow empty results, it'll 404 if it has nothing to show :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Sign Up button

2007-09-15 Thread Collin Grady
You can't use a form button - just use a link --~--~-~--~~~---~--~~ 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: HELP needed POST and Python

2007-09-12 Thread Collin Grady
1) The newforms documentation shows you how to pass request.POST into the form (see the view example): http://www.djangoproject.com/documentation/newforms/ 2) You don't need to put the user in your form in order to do initial data. Just pass the form an initial dict when you make an instance of

Re: ManyToMany and save()

2007-09-12 Thread Collin Grady
While I believe you were the one asking this in IRC, I will answer here for anyone else stumbling across this :) ManyToManyField entries are just two IDs - one for each object. As such, it's impossible to add an m2m link until the object is saved - this means that admin's code can't possibly set

Re: Master Page Code

2007-09-12 Thread Collin Grady
Another option is to use template tags. Different apps can provide template tags that can be embedded in other pages. Specifically, inclusion tags basically render a stub template with their own context, so something like a polls app, for example, could render a poll form wherever you do {% show_

Re: subclassing flatpages model

2007-09-12 Thread Collin Grady
For the record, you cannot subclass django models yet :) --~--~-~--~~~---~--~~ 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 t

Re: error: psycopg requires a datetime module

2007-09-12 Thread Collin Grady
If it's complaining about mxDateTime, you need to install that separately - I do not think it is included in most python distributions. This isn't anything against python itself though - every piece of software has pre-requisites, and you have to install them to use the software :) --~--~--

Re: Linux django_settings_module problem

2007-09-11 Thread Collin Grady
You can also just fix the imports to reference things properly, including the site name :) --~--~-~--~~~---~--~~ 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@goog

Re: Ordering of admin form fields when using edit_line?

2007-09-11 Thread Collin Grady
I don't believe that is possible. --~--~-~--~~~---~--~~ 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, send email t

Re: 404 Page Help

2007-09-11 Thread Collin Grady
You don't need a custom 404 handler in order to use RequestContext - the default handler already does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: Custom validation for models in admin

2007-09-11 Thread Collin Grady
You need to write a validator and use validator_list in the field attributes to do custom validation in admin. http://www.djangoproject.com/documentation/model-api/#validator-list --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Email model

2007-09-10 Thread Collin Grady
You are likely going to have to write that sort of app yourself. --~--~-~--~~~---~--~~ 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 unsubscrib

Re: localflavor - UKPostcodeField

2007-08-21 Thread Collin Grady
The same question applies though :) You didn't import the "forms" bit, you imported the field directly, so you should just be using it as UKPostcodeField :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: db-api optimization

2007-08-21 Thread Collin Grady
That probably isn't what you want, though it will work (technically speaking) The way you're doing it, that's going to chain the filters with AND, not OR, so only things that match the title and description for all words will show up. You probably want to build a Q object with | for an OR lookup

Re: localflavor - UKPostcodeField

2007-08-21 Thread Collin Grady
You're importing UKPostcodeField - so why are you trying to use models.UKPostcodeField ? :) --~--~-~--~~~---~--~~ 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@goo

Re: index page

2007-08-21 Thread Collin Grady
Make template tags for your various apps, and use them on the index page :) --~--~-~--~~~---~--~~ 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

Re: Foreign Key chaining in templates

2007-08-21 Thread Collin Grady
question.choice.all is wrong :) The default reverse relation name is FOO_set where FOO is the lower- case name of your model. So in your case, it would be question.choice_set.all --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Newforms file upload

2007-08-16 Thread Collin Grady
The change is just that this: form = MyForm(request.POST) changes to this: form = MyForm(request.POST, request.FILES) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Why isn't my app appearing in the admin?

2007-08-14 Thread Collin Grady
On Aug 14, 8:39 am, "Rob Hudson" <[EMAIL PROTECTED]> wrote: > Is it odd that I don't see an error? Just the admin page without the > models I'm looking for? Nope. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Generalizing media files URLs

2007-08-14 Thread Collin Grady
You've pretty much summed up your only choices that I can see :) If you like 4 the best, go with that :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Using queryset values() spanning relationships

2007-08-14 Thread Collin Grady
Author.objects.filter(book__publisher__id=1).distinct() doesn't work? --~--~-~--~~~---~--~~ 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 unsub

Re: Filter on related model problem...

2007-08-13 Thread Collin Grady
Regroup generates a list of dicts with two keys - grouper (the value of the field you're grouping by) and list (the list of objects that match that) So in this case, you get entries like {'grouper': , 'list': [, , ...]} :) --~--~-~--~~~---~--~~ You received this

Re: error with Admin

2007-08-13 Thread Collin Grady
Your problem is completely unrelated to INSTALLED_APPS, if your django/ contrib/admin/templates dir is missing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Filter on related model problem...

2007-08-13 Thread Collin Grady
view: poems = Poem.objects.filter(approved=True).select_related().order_by('auth_user.username') template: {% regroup poems by user as grouped %} {% for group in grouped %} {{ group.grouper }} {% for poem in group.list %} {{ poem.title }} {% endfor %} {% endfor %} Perhaps something like that?

Re: Proper way to extend contrib.auth

2007-08-13 Thread Collin Grady
Copying the code out will not work. Nothing in django will be looking in your new location, so your changes will be ignored. If you absolutely must change the User model itself, you are stuck with editing the django source directly. --~--~-~--~~~---~--~~ You rece

Re: error with Admin

2007-08-13 Thread Collin Grady
Do you have "django.contrib.admin" in INSTALLED_APPS? Are the templates actually present in django/contrib/admin/ templates/ ? Are the permissions on that directory and every directory above it such that the webserver can read them? --~--~-~--~~~---~--~~ You rec

Re: Django database API - What is it good for?

2007-08-13 Thread Collin Grady
> >>> users = User.objects.filter(groups__contains="Staff") ? This line doesn't work because "groups" is a ManyToManyField, not a CharField, so __contains="Staff" doesn't make any sense. Something like users = User.objects.filter(groups__name="Staff") should work a little better :) --~--~-

Re: Generic View Pagination

2007-08-13 Thread Collin Grady
As the documentation for object_list says, it will append _list to template_object_name, so you should actually be checking "products_list" based on your line there :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Feed question

2007-08-12 Thread Collin Grady
http://www.djangoproject.com/documentation/syndication_feeds/#a-complex-example The example here is pretty much what you want, you just need to change how you lookup the objects for the feed. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: How to rewrite SQL for Django

2007-08-12 Thread Collin Grady
You cannot. Django does not do aggregates like GROUP BY yet. You will have to use manual sql to get those values. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: Saving a copy of a model

2007-08-12 Thread Collin Grady
Model subclassing does not work. --~--~-~--~~~---~--~~ 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, send email to

Re: FileField / ImageField problem on update

2007-08-12 Thread Collin Grady
You can't access the old value once you've sent in a new one, unless you query the database again for the old record before you save the new. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Question concerning blank and null in model fields

2007-08-12 Thread Collin Grady
There is no model-level validation. The "blank" option in fields applies /only/ to the forms handlers, like the forms in Admin. It will not stop you from saving an object manually with nothing in it. --~--~-~--~~~---~--~~ You received this message because you are

Re: no cookie vs. expired cookie

2007-08-12 Thread Collin Grady
When a cookie expires, the browser gets rid of it. Your site will never see it, and the user will be no longer logged in, since they will have no link to the session :) As such, it's impossible to tell if a user with no cookie has never had one or simply had one but it expired. --~--~-~

Re: newforms - form for multiple models

2007-08-10 Thread Collin Grady
Do you need validation that ties between fields in both models? If not, just pass each form into the template individually. A newforms form will only pay attention to POST keys that match its own fields, so the others will just be ignored, and everything just works :) --~--~-~--~~-

Re: Rails-like Flash in Django

2007-08-10 Thread Collin Grady
http://code.djangoproject.com/ticket/4604 --~--~-~--~~~---~--~~ 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, send

Re: newforms + multiple sister forms submitted/processed in one user action

2007-08-10 Thread Collin Grady
One method is to include a hidden input somewhere that indicates the number of forms present. Then you can just use a for loop from 1 to that number in the view to build the right number of forms again. --~--~-~--~~~---~--~~ You received this message because you a

Re: how to define a User?

2007-08-10 Thread Collin Grady
To fkey to User, you should be importing it, not typing out a full path like that (unless you're doing "import django" but that's a bit unwieldy) You cannot set the fkey to the current user in save(), as request is not available. You also can't do it in admin because of that. It's very easy in a

Re: editing newforms field

2007-08-10 Thread Collin Grady
Yes, you can do something like form.fields['fieldname'].widget = forms.TextInput() or whatever --~--~-~--~~~---~--~~ 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@

Re: urlconf for multiple page slugs

2007-08-10 Thread Collin Grady
About the only way to do that is just grab (.*) from the url, and parse it in your view, looking up slugs as needed --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: editing newforms field

2007-08-10 Thread Collin Grady
Yes, just edit the fields in form.fields :) --~--~-~--~~~---~--~~ 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, se

Re: scheduling job

2007-08-10 Thread Collin Grady
cron is definitely the proper way to do this (or the scheduled tasks if you're stuck on windows) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: Newforms validations & request.user

2007-08-10 Thread Collin Grady
Makes the most sense to me :) --~--~-~--~~~---~--~~ 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, send email to [E

Re: django built-in web server

2007-08-10 Thread Collin Grady
No, this will not work well at all. Django's dev server is single-threaded, and as such, nobody else could use it while it's serving a request - if even 2 people were browsing around at any speed, you'd start running into delays. Apache is easy. Use it :) --~--~-~--~~~-

Re: Is this not allowed select_related()

2007-08-09 Thread Collin Grady
What do you mean by "get the history" ? --~--~-~--~~~---~--~~ 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, send e

Re: Multi field validation with clean method

2007-08-09 Thread Collin Grady
Reverse the field order in the form, otherwise not that I'm aware of. --~--~-~--~~~---~--~~ 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 unsub

Re: Multi field validation with clean method

2007-08-09 Thread Collin Grady
The clean_foo functions are run in order. So in your situation, clean_annotationtype will only have access to the annotationtype value, but clean_annotationvalue will be able to see both, since clean_annotationtype has already been run. --~--~-~--~~~---~--~~ You

Re: Access the request object in a filter?

2007-08-09 Thread Collin Grady
{% if item|in_cart:request %} --~--~-~--~~~---~--~~ 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, send email to [E

Re: about templates tags

2007-08-09 Thread Collin Grady
Yes, a tag file is a tag library, it does not represent a single tag :) --~--~-~--~~~---~--~~ 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 uns

Re: Newforms validations & request.user

2007-08-09 Thread Collin Grady
Add an __init__ function to your form that you can pass request to. def __init__(self, request=None, *args, **kwargs): self.request = request super(MyForm, self).__init__(*args, **kwargs) Something like that should work to add request to the form, and you can then use it in t

Re: OperationalError 1054 Unknown column

2007-08-09 Thread Collin Grady
Why did you add _id to your model definition for levelID ? The column does not have that. --~--~-~--~~~---~--~~ 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@googl

Re: how to display an error

2007-08-09 Thread Collin Grady
You cannot do that from save() - you need to add a validator for the admin forms to use, using the validator_list attribute for a field. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: filter a list of objects?

2007-08-08 Thread Collin Grady
Is price a ForeignKey? If so, the issue is you're trying to lookup an object by a number. You'll need something like y.filter(price__price=149) or such (whatever the field in price is that stores the value) --~--~-~--~~~---~--~~ You received this message because

Re: context vs request context

2007-08-08 Thread Collin Grady
Yes, the generics use RequestContext because it will call all enabled context processors. Normal Context does not do so. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: direct_to_template and extra_content

2007-08-08 Thread Collin Grady
No, it's impossible to use values from the URL or request right there in the url dispatcher. You would need a small wrapper view. See http://www.b-list.org/weblog/2006/11/16/django-tips-get-most-out-generic-views :) --~--~-~--~~~---~--~~ You received this messag

Re: Is this not allowed select_related()

2007-08-08 Thread Collin Grady
Because you have an infinite loop there. Why are you linking both directions? There's a reverse relation available to get from EmployeeAssignment and EmployeeContract back to the Employee model, you don't need to explicitly define it. --~--~-~--~~~---~--~~ You re

Re: Templates: dynamic attribute referencing?

2007-08-08 Thread Collin Grady
Your filter would work fine, you just need to stop trying to add quotes and {{}} to it ;) {{ obj1|get_attr_by_name:obj2.foo }} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Using Filter on a list of objects?

2007-08-08 Thread Collin Grady
Why are you doing request['price'] ? Do you perhaps mean request.POST['price'] or request.GET['price'] ? :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Changing filter_interface for groups in User model?

2007-08-08 Thread Collin Grady
Only if you edit the django source :) --~--~-~--~~~---~--~~ 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, send ema

Re: DateField() , AttributeError: 'str' object has no attribute 'strftime'

2007-08-08 Thread Collin Grady
This is not a backend issue at all - the problem is you're assigning a string to the DateField, which is not what it needs. DateField/TimeField/DateTimeField need the python objects for them, not strings. They convert it to a string internally before save, so that the database gets the right val

Re: Overriding save methot problem

2007-08-08 Thread Collin Grady
There is no solution, really - the links can't be added until the model is saved, so they will not be available in save() The only way you could work with m2m data is in a custom view, since then you can connect them and do whatever. --~--~-~--~~~---~--~~ You rec

Re: How to specify engine type for particular table?

2007-08-08 Thread Collin Grady
Nope. You have to change that manually. --~--~-~--~~~---~--~~ 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, send e

Re: Single-line comment doesn't seem to work

2007-08-08 Thread Collin Grady
What version of django are you using? I seem to remember the single line comments being added after 0.96, though I could be mistaken. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Queryset of instances bound to particular ForeignKey

2007-08-02 Thread Collin Grady
I feel silly for not trying this earlier, but it appears to work :) >>> B.objects.filter(a__isnull=False) [, ] Models used for this test: http://dpaste.com/15931/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Queryset of instances bound to particular ForeignKey

2007-08-02 Thread Collin Grady
Neither of those is correct. He wants every B that has an A fkeyed to it. In other words, every instance of B where b.a_set.count() > 0 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Best Practices to Make your Apps Portable

2007-07-24 Thread Collin Grady
apps are portable if you don't make them in a project directory - as for copying them to another server, nothing stops you from making a "3rd_party" or some such folder in there that you add to pythonpath, so that they don't have to be referenced by project.app Or maybe make an "apps" directory t

Re: 4 arguments (5 given), in part 4 of tutorial

2007-07-22 Thread Collin Grady
If you're using 0.96, you must follow the 0.96 tutorial instead, at http://djangoproject.com/documentation/0.96/tutorial04/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: edit_inline and empty models

2007-07-22 Thread Collin Grady
Don't set a FileField or ImageField as core=True, it won't work as expected. Maybe make the alt text core=True instead, or require a name for the model? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: removal of Django

2007-07-20 Thread Collin Grady
> Hi all.Django auto loaded onto my computer from( I believe) a Harry > Potter web site.I want to remove it,as it is messing up one of the web > sites that I frequent.The site shows a 404 error. That's impossible. --~--~-~--~~~---~--~~ You received this message b

Re: 4 beginner's questions

2007-07-19 Thread Collin Grady
> Oh, it's not creating the ID, my question was whether I can safely > assume that I will always get an IntegrityError (and nothing else) and > whether just inserting stuff and catching errors is the recommended > Pythonic way. IntegrityError is what you will get on a unique conflict, yes. Howev

Re: Request Context and Generic Views

2007-07-19 Thread Collin Grady
They all use RequestContext already. --~--~-~--~~~---~--~~ 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, send emai

Re: Multiple URLconfs per app?

2007-07-18 Thread Collin Grady
You'll need two files. --~--~-~--~~~---~--~~ 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, send email to [EMAIL PR

Re: Problem when inserting into a table with a MySQL auto_increment primary key

2007-07-18 Thread Collin Grady
If there's a problem, it will raise an exception, so you won't just slide past invisibly. --~--~-~--~~~---~--~~ 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@googl

Re: MEDIA_URL MEDIA_ROOT problem.

2007-07-17 Thread Collin Grady
The key here is that django does not automatically map your media - you have to do it manually. --~--~-~--~~~---~--~~ 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

Re: Problem installing django on dreadhost

2007-07-17 Thread Collin Grady
Check your DATABASE_HOST setting in settings.py - if you have it set to a path you can't write to, that would explain the error. Also, you should be using "manage.py syncdb" not "django-admin.py syncdb" --~--~-~--~~~---~--~~ You received this message because you

Re: anybody help me! raise EnvironmentError

2007-07-17 Thread Collin Grady
If you don't use "manage.py shell" you must set your environment properly - set the DJANGO_SETTINGS_MODULE and PYTHONPATH properly, similar to how the modpython docs show you to set them for that to work. --~--~-~--~~~---~--~~ You received this message because you

Re: What version of Django do I have?

2007-07-15 Thread Collin Grady
'svn info' --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For

Re: Best Practice for translating db-stored values

2007-07-15 Thread Collin Grady
I like this method: http://code.google.com/p/i18ndynamic/ --~--~-~--~~~---~--~~ 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

  1   2   >