i18n translation in forms?

2008-10-21 Thread chris
ces", "Dates" and so on, but I can't figure out how to tell the i18n framework that this should be translated. Any help appreciated! Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: i18n translation in forms?

2008-10-22 Thread chris
ield(label = _("Places")) dates = forms.CharField(label = _("Dates")) works = forms.CharField(label = _("Works")) As for the paginator, I ended up doing this clumsy thing: <{% trans "Page"%} {{ results.number }} / {{ results.paginator.num_pages}}&g

can't delete many-to-many related record from admin inline

2008-10-30 Thread chris
Apparently, something is going wrong with the deletion, which lets part of the record hang in empty air. But I have no idea where to look or how to fix this. Does anybody has any idea? Any help appreciated, Chris --~--~-~--~~~---~--~~ You received this message b

Re: link to other record in admin change list

2008-11-04 Thread chris
Dear Fabio, That did the trick! I have searched all over the manuals, but must have overlooked this. It is a bit confusing that this seems to be different from is_safe and mark_safe, but for the moment I am happy that its working now. Thanks a lot for pointing it out! Chris On Nov 4, 4:06

link to other record in admin change list

2008-11-03 Thread chris
d.character, d.unicode) for d in obj.vars.all()])) return mark_safe(safestr) varchars.short_description = "Variant Characters" varchars.is_safe = True However, I still see the HTML markup escaped in the admin client. I also tried to use an {% autoescape off %} block, but to no avail. Any help appr

Re: Using FileField and existing files

2008-11-06 Thread Chris
t; The file_object now references the file at /myuploads/the_file.txt. > You can read it etc. > > (I personally dislike assignment overloading - that should rightfully > have reassigned my FileField object to a string, not made a hidden > mystical call to f

SQL in queryset extra method not showing in results

2008-11-09 Thread chris
ot show up in the results. I guess I am doing something wrong, but can't quite figure out what. Any help appreciated, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: SQL in queryset extra method not showing in results

2008-11-10 Thread chris
#x27;title', 'title_count') This query returns only one row, the total count of all titles. What I am trying to achieve is what the SQL above does, namely aggregating the titles and give the count for the occurrence of each title. I wonder if this could be done with the Django ORM? Ch

Re: SQL in queryset extra method not showing in results

2008-11-10 Thread chris
number of occurrences. The trick with group_by is undocumented, but mentioned in this blog post by Eric Florenzano: http://www.eflorenzano.com/blog/post/secrets-django-orm/ Chris On Nov 11, 7:43 am, chris <[EMAIL PROTECTED]> wrote: > Thanks Malcolm, > > This brings me one step closer

Models Not Showing In Admin

2008-11-15 Thread Chris
bled. Is there some other step the guide's not mentioning, or some obscure gotcha that would prevent models from showing in admin? Thanks, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

Re: Models Not Showing In Admin

2008-11-15 Thread Chris
wrote: > On Sat, 2008-11-15 at 19:28 -0800, Chris wrote: > > I'm trying to get my models to show in admin. I've followed > >http://www.djangobook.com/en/1.0/chapter06/and while I'm able to > > login to admin and view the Auth and Sites sections, I can't see my &

Multithreaded Dev Server

2008-11-15 Thread Chris
e. Is there any way to make the dev server multi-threaded? Thanks, Chris --~--~-~--~~~---~--~~ 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

Re: Multithreaded Dev Server

2008-11-15 Thread Chris
OTECTED]> wrote: > On Sun, Nov 16, 2008 at 12:11 AM, Chris <[EMAIL PROTECTED]> wrote: > > I'm trying to write a basic Ajax app, which submits a file in one long- > > running request, and periodically polls the status in another request. > > However, it seems lik

Re: Multithreaded Dev Server

2008-11-15 Thread Chris
I understand what you're saying. It's just unfortunate we're throwing out the convenience of the dev server. What's up with http://code.djangoproject.com/ticket/3357 ? Looks like this idea isn't new. Chris On Nov 16, 12:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]&

Using Admin From a Sub-Directory

2008-11-16 Thread Chris
I'm trying to setup my app so it's accessible from a /myapp sub- directory. I defined BASEURL = '/myapp' in settings.py, and created a context preprocessor so this variable is available to all templates. I then insert this variable at the beginning of all paths for js/css includes, links, etc. Ev

dynamic method calling

2008-11-21 Thread Chris
Hello everyone, I have a quick python question. Is they a better way of calling a method dynamically then what I have below? Is there a more elegant approach? Thanks in advance. try: push = getattr(self, 'get_%s_content' % self.name) except AttributeError: raise "Method does not exist" if

OpenId

2008-11-30 Thread Chris
I have been looking into using OpenId and I discovered that there are to 2 django libraries that handle this: django_openId and django_authopenid. Any opinions on the two? Not sure which one I should go with. --~--~-~--~~~---~--~~ You received this message because y

Using random.random() while running on server

2008-12-09 Thread Chris
Hello, when django is running on a server, I want to make a call to: random.random(). When I make a call to this again, I can't. I think this related to a similar issue datetime.datetime.now() where you leave off the () to get a current date each time each time you call it. If you dont do that, d

Re: Using random.random() while running on server

2008-12-09 Thread Chris
this default=random.random. Any Ideas how I can fix this? thanks. On Dec 9, 6:00 am, Jeff FW <[EMAIL PROTECTED]> wrote: > Chris, > > It depends on where you're calling random.random().  If you're trying > to do it in a model definition, then you're always going to

Re: Using random.random() while running on server

2008-12-09 Thread Chris
> much easier to help you. > > -Jeff > > On Dec 9, 1:19 pm, Chris <[EMAIL PROTECTED]> wrote: > > > I found this snippet:http://www.djangosnippets.org/snippets/814/and > > noticed that it does not work as intended do to the issue that I > > described.

Re: Using random.random() while running on server

2008-12-09 Thread Chris
of the primary key. > > On Dec 9, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > > On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > when django is running on a server, I want to make a call to: > > >

populating a multi select list by passing in user obj to form

2008-12-18 Thread Chris
Hello all, I am trying to popular a multi-select form field by passing in a user object suchas request.user so that I can filter a table based on that object. Below is what I came up with but it is still not working. I get the following error: 'ChoiceForm' object has no attribute 'accounts' http:

Re: populating a multi select list by passing in user obj to form

2008-12-18 Thread Chris
Thank you very much for the great advice. I found that it is: self.base_fields['accounts'].choices = but I am sure that was just an example. Thanks again. On Dec 18, 1:52 am, Daniel Roseman wrote: > On Dec 18, 9:41 am, Chris wrote: > > > Hello all, > &

"Building you first Django app, Part 1" example not working

2008-12-20 Thread Chris
When I'm in the command line, and run the command django-admin.py startproject mysite, I don't get an error, but nothing happens... as far as I can tell! When I cd'd into the directory I'm working in, I did exactly what the tut said – I'm on OS X Leopard with Python 2.5, if that helps anyone help

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Chris
of installation, explained in dummy terms, if possible. I know I'm overlooking something stupid – it says it can't find django- admin.py... so I'm lost – thanks for the reply, though! On Dec 20, 5:58 pm, Jeff Anderson wrote: > Chris wrote: > > When I'm in the comma

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Chris
t I'll have more questions for you guys! Best, Chris On Dec 21, 12:41 am, Jeff Anderson wrote: > Chris wrote: > > it says it can't find django-admin.py > > I didn't see that for my most recent reply. Your problem is that > django-admin.py isn't on your PAT

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Chris
-- Pretty much the same as the errors I'm getting at the command line... Any insight would be appreciated - I think I'll just install MySQL locally and use that, as SQLite sounds like a limiting pain in the ass... Verification on this? A

Re: "Building you first Django app, Part 1" example not working

2008-12-21 Thread Chris
Oh shit, that's awesome! Thanks! I thought it had already created the DB and wanted me to fill in that info... I'm so stupid sometimes. Thanks a bunch mrtot... On Dec 21, 3:50 am, mrtot wrote: > Hi Chris, > > maybe it's the best to just do what the error message sugge

Re: "Building you first Django app, Part 1" example not working

2008-12-23 Thread Chris
Thanks :-) On Dec 22, 4:01 am, leveille wrote: > You're 14.  You recognize that you're having a problem and you post to > the Django group for help.  You're not stupid at all.  I would say > you're very intelligent! > > On Dec 21, 2:43 pm, Chris wrote: >

ModelForm Default Value for Foreign Key

2009-01-06 Thread Chris
I've created a ModelForm from a model containing a foreign key field (called user) linked to my User class. When the form is saved, I want this value to be set to the current authenticated user. What's the best way to do this? My form's save method takes the current user as an argument. I've trie

Django-OAuth Issue

2009-01-13 Thread Chris
Hello, I have been using django-oauth and am getting the below error using this code http://dpaste.com/108808/ I get this when running the dpaste code in the python shell. Traceback (most recent call last): File "", line 1, in File "", line 7, in get_unauthorised_request_token File "/usr/

Re: Django-OAuth Issue

2009-01-13 Thread Chris
this library. I will look into this. example documentation: http://code.larlet.fr/doc/django-oauth-provider.html This example seems to do things slightly different. Chris On Jan 13, 7:29 pm, Malcolm Tredinnick wrote: > On Tue, 2009-01-13 at 18:54 -0800, Chris wrote: > > Hello, >

Unique Case Sensitivity

2008-07-15 Thread Chris
is case-sensitive, I'd expect the creation and retrieval function to be consistent. If save() fails to insert "Abc" because "abc" has already been inserted, then I'd expect get(text="Abc") to return the record for "abc". I

Standard documentation method.

2008-07-18 Thread Chris
hello, Does django have a preferred method of commenting on code in docstrings? I notice that there is some specific ways that some applications write documentation in their code but didn't know if django had some kind of preferred method. I would like to be able to parse in my code documentation

Template Hiding Strings with Non-Ascii Characters

2008-07-20 Thread Chris
Forgive the repost, but after initially seeing my original post, Google appears to have deleted it, so here goes again. I'm running the current trunk, and I'm seeing a strange problem. I noticed Django's templates were occasionally displaying variables as empty strings, when there should have bee

Template Hiding Strings with Non-Ascii Characters

2008-07-20 Thread Chris
I'm running the current trunk, and I'm seeing a strange problem. I noticed Django's templates were occasionally displaying variables as empty strings, when there should have been something. Then I realized, all the strings that weren't being shown had a \x... character in them. I can understand wh

Streaming uploads help

2008-07-22 Thread Chris
Hello I have an image field in my photos model that has an upload_to='event-photos/%Y/%m/%d/' variable but I am not sure how I can reference this using streaming uploads. before streaming uploads you could do something like: p = Photo(**params) p.save_photo_file(photo.filename, photo.content) Is

Newbie admin site issue--login form action incorrect

2008-09-05 Thread Chris
id, all the other urls set up in urls.py work fine. Just the admin one is acting strange. Thanks! Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Persistent Global Imports

2008-09-10 Thread Chris
I have an application that uses some large packages, such as Wordnet, and the imports can take awhile. Is there a mechanism in Django to persist imported package across requests? I'm running Django via mod_wsgi, and it seems to re-import everything in my view files for *every* request, which makes

Accessing Settings from Flatpages

2008-09-22 Thread Chris
data gets passed to them, aside from the db page data? Thanks, Chris --~--~-~--~~~---~--~~ 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

Re: Accessing Settings from Flatpages

2008-09-22 Thread Chris
On Sep 22, 8:59 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Chris wrote: > > I have various global values, like SITE_NAME, defined in my > > settings.py. How would you make settings available inside Flatpage > > templates? For non-flatpages, I'm currently impor

How to View Raw Generated SQL

2008-09-24 Thread Chris
I'm trying to debug a usage of callproc, which doesn't return any rows when used inside Django. Is there anyway to view the SQL and escaped values sent from db cursor? I found http://docs.djangoproject.com/en/dev/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running by this doesn't show

ManyToMany relationship on self through other table

2008-09-30 Thread chris
desc = models.CharField(max_length=20) However, when I do this, I get a runtime error complaining about the two foreign keys. I wonder how to solve this problem? Any help appreciated, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: ManyToMany relationship on self through other table

2008-09-30 Thread chris
foreign keys in the Relationship table. BTW, I forgot to say that this is using the 1.0 release of django. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: ManyToMany relationship on self through other table

2008-10-01 Thread chris
think this is a bug, insofar as it does not work the way it is described in the docs. All the best, Chris On Sep 30, 9:12 pm, felix <[EMAIL PROTECTED]> wrote: > post the traceback.  I may not be able to help you since I haven't > tried to do person-to-person at all. > > it m

How to Create Real Foreign Keys

2008-10-01 Thread Chris
I'm running MySQL as my backend, and I've noticed Django doesn't create "real" foreign keys for the ForeignKey column. Just indexes. Is this by design, or am I somehow misusing ForeignKey()? I found http://code.djangoproject.com/ticket/5729, which seems to directly address this. It's marked as "f

Re: ManyToMany relationship on self through other table

2008-10-02 Thread chris
Dear Karen, Thank you very much for your response. It was very helpful and solved my problem! As I said, I am just beginning with Django, so could not quite understand where the problem lies. However, I will try to post a more useful and descriptive phrasing of the problem, including traceback

Django-Registration and NewForms Error

2008-10-08 Thread Chris
I installed django-registration via easy_install, and followed the directions for setting it up in my app, but when I go to /register, I get the error: File "/usr/lib/python2.5/site-packages/django_registration-0.5- py2.5.egg/registration/views.py", line 12, in File "/usr/lib/python2.5/site

Password Change Usage

2008-10-08 Thread Chris
Does anyone know of an example for using django.contrib.auth.views.password_change? All the docs seem to mention is how to specify it's template. After poking around in the code, I found it exposes new_password1 and new_password2 and I setup a basic form. However, it never redirects to the defaul

Using Block Tag in an Included File

2008-10-08 Thread Chris
Is there anyway to use {% block %} in an included template? I have a header template, that's included in a few generic base templates. I had hoped to declare some global stylesheets/javascript in the header, along with a {% block header %} tag, to allow other templates to insert their own depende

syntax for runtime evaluation of Q objects

2008-10-18 Thread chris
ains=names) etc and then concatenate and execute the whole at the end: results = Person.objects.filter("|".join(Q.values()) However this does not seem to work. I imagine that this is a rather frequent requirement, so there should be an easy way to do this, but I just can't fig

Re: syntax for runtime evaluation of Q objects

2008-10-18 Thread chris
: results = Person.objects.filter(reduce(operator.and_, qs)) which is blazingly fast and does exactly what I need. Great! All the best, Chris On Oct 18, 7:46 pm, Christian Joergensen <[EMAIL PROTECTED]> wrote: > chris wrote: > > Dear django users, > > > Being rather new

Installing Django on shared host

2009-01-15 Thread Chris
Anyone know how to install Django on a GoDaddy (shared) hosting plan with SSH access? --~--~-~--~~~---~--~~ 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@googlegroup

post login redirects with ssl rverse proxy

2009-01-19 Thread chris
{ form.password }} note this works fine with http://internal1 Can anyone give me some pointers?? Thanks Regards Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

How to get auth.login to redirect to a https URL

2009-01-20 Thread chris
Hi Does anyone know hot to get auth .login redirect to an https URL Currently i'm running my site behind an SSL enabled reverse proxy redirects to http. If i don't supply a URL login redirects http://accounts/profile I've tried to supply the full URL but auth.login does not allow this I was thin

Automatically Generating Non-Ajax Client-Side Form Validation

2009-01-23 Thread Chris
Is anyone aware of a simple way to automatically generate non-Ajax form validation? I've seen some useful posts about Ajax-form validation (e.g. http://eikke.com/django-generic-ajax-form-validation/), but I'd rather not waste bandwidth on validating integers/dates/phone- numbers/required-fields/et

Re: Multithreaded development server

2009-01-24 Thread Chris
i-threading in the dev server. Unfortunately, it's likely never to get adopted by Django, since the lead devs don't want to deal with the maintenance overhead it would entail. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Django-OAuth Issue

2009-01-24 Thread Chris
st) File "test.py", line 34, in fetch_request_token return oauth.OAuthToken.from_string(response.read()) File "/some/location/disk/oauth.py", line 70, in from_string key = params['oauth_token'][0] KeyError: 'oauth_token' Thanks for your response.

Cron Job Question

2009-01-29 Thread Chris
I have a python / django script that I have written which will be used as a cron. Basically this script goes out to my database and gets rows from a given table and performs a specific task then deletes the row once finished. What I would like to do is have multiple instances of this script runni

Re: free django hosting

2009-02-01 Thread Chris
On a similar note, http://code.google.com/p/app-engine-patch/ On Jan 30, 9:42 pm, felix wrote: > http://code.google.com/p/google-app-engine-django/ > of course > > some restrictions apply > your mileage may vary > >      felix :    crucial-systems.com > > On Sat, Jan 31, 2009 at 1:12 AM, xankya

Using Admin Datepicker in Other Apps

2009-02-21 Thread Chris
calendar.js core.js This gets the datepicker icon to show up, but clicking it does nothing. I'm assuming I probably need some CSS includes as well, but I'm not sure which CSS files to include, or if the admin style sheets will start to conflict with my apps

Displaying Generic Read-Only Model Data

2009-02-21 Thread Chris
What's the best way to display generic read-only model data on a template, without having to manually write the html for each column you want displayed? I'm toying around with a ModelForm, using custom form widgets to format the data into strings instead of form fields. Is there a better way? --~-

Conditional Logic in Template Loop

2009-02-22 Thread Chris
o is {% if request.user.is_superuser or request.user == record.user %} display controls {% endif %} inside the loop. However, Django's default template language doesn't seem to support this basic syntax. Is there a non-hackish way to accomplish this with the default langu

Conditional Logic in Template Loop

2009-02-22 Thread Chris
o is {% if request.user.is_superuser or request.user == record.user %} display controls {% endif %} inside the loop. However, Django's default template language doesn't seem to support this basic syntax. Is there a non-hackish way to accomplish this with the default langu

Conditional Logic in Template Loop

2009-02-22 Thread Chris
o is {% if request.user.is_superuser or request.user == record.user %} display controls {% endif %} inside the loop. However, Django's default template language doesn't seem to support this basic syntax. Is there a non-hackish way to accomplish this with the default langu

Re: Conditional Logic in Template Loop

2009-02-22 Thread Chris
encapsulate my permission logic, and call that for each row. Regards, Chris On Feb 22, 10:28 pm, Alex Gaynor wrote: > On Sun, Feb 22, 2009 at 10:27 PM, Chris wrote: > > > I'm displaying a list of records in a template. I want to > > conditionally display controls for each recor

Browser Testing - Selenium or Windmill

2009-02-28 Thread Chris
What's the best tool for doing automated browser testing with Django apps? I have some personal experience with Selenium (although not when testing Django), which seems fairly mature, and has a great Firefox extension, but has some serious problems dealing with frames and popups. I recently discov

Re: Using Admin Datepicker in Other Apps

2009-03-01 Thread Chris
On Feb 21, 10:03 am, Alex Gaynor wrote: > On Sat, Feb 21, 2009 at 7:48 AM, Chris wrote: > > > Is it a good idea to reuse admin's JS datepicker widget in other apps, > > and if so, what's the best way? > > > I'm using django.contrib.admin.widgets.Admi

Re: New to Django and a few basic questions

2009-03-04 Thread chris
d was the confirmation that it can be done with Django, I think. Thanks. Chris On 5 Mrz., 00:32, Russell Keith-Magee wrote: > On Wed, Mar 4, 2009 at 9:54 PM, ch...@secondfoundation.net > > > > > > > > wrote: > > > Hi group, > > > as the subj

Inserting Into Cleaned_Data Inside a ModelForm

2009-03-06 Thread Chris
ut I don't want the field included in the actual form (not even as a hidden field). Any help is appreciated. Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Read Only Form Field

2009-03-07 Thread Chris
ith the current version of Django. Using even one field with the ReadOnlyWidget causes the form to display no fields at all. Is there any reason why the default form fields don't include a readonly option? Thanks, Chris --~--~-~--~~~---~--~~ You received this mes

Problem Installing Fixture: Unbound Prefix

2009-03-11 Thread Chris
used by tags, like: Why is Django having problems parsing its own XML? Removing the "gd:" seems to silence the error, but how can I get Django to output valid XML that won't break the unittests? Regards, Chris --~--~-~--~~~---~--~~ You received this

Re: Problem Installing Fixture: Unbound Prefix

2009-03-11 Thread Chris
Note, I also get a similar error for loading JSON: ValueError: No JSON object could be decoded On Mar 11, 7:54 pm, Chris wrote: > I'm using Django 1.0.2, and I dumped out a sample database as XML > using dumpdata. When I run my unittests using this XML as a fixture, I >

Test Client Missing Response Meta Data

2009-03-13 Thread Chris
If it is supported, how can I ensure the response contains this meta data? Thanks, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Backend Neutral DictCursor

2009-08-10 Thread Chris
.extras.DictCursor, but I'd rather avoid having to code around each specific backend. Regards, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Dumping Large Databases

2009-08-10 Thread Chris
I'm trying to dump a 3GB MySQL database using manage.py dumpdata, but it's getting killed after 2 hours. Is there any way to get it to use less memory/cpu so it doesn't get killed and completes the dump? --~--~-~--~~~---~--~~ You received this message because you ar

Re: Backend Neutral DictCursor

2009-08-24 Thread Chris
There's no way to do this? On Aug 10, 8:47 am, Chris wrote: > You can get a backend neutral database cursor with > django.db.connection.cursor(). However, any results executed are > returned as nameless lists. Is there a way to get results returned as > dictionaries, via Dict

Re: Backend Neutral DictCursor

2009-08-24 Thread Chris
ed keyword argument 'cursor_factory' On Aug 24, 9:55 pm, Chris wrote: > There's no way to do this? > > On Aug 10, 8:47 am, Chris wrote: > > > You can get a backend neutral database cursor with > > django.db.connection.cursor(). However, any results execut

Re: duplicate primary key problem

2009-08-25 Thread Chris
I had this identical problem. Thanks for the help. Chris On Jul 10, 8:12 pm, adelaide_mike wrote: > Very cool, Rajesh D.  Thanks. > > Mike > > On Jul 11, 12:31 am, Rajesh D wrote: > > > On Jul 10, 11:06 am, adelaide_mike > > wrote: > > > > I suspec

Unique Field Combinations

2009-04-04 Thread Chris
How would you enforce a unique column constraint on a combination of fields? For example, say I have the model: class Company(models.Model): name = models.CharField(unique=True) class Article(models.Model): company = models.ForeignKey(Company) title = models.CharField(max_length=500

trying to use the aggregate functions

2009-04-10 Thread chris
Hi there, Here I am trying to use the aggregate functions available in SVN trunk (I am not sure if they have been released). The following is a simplified version of the models involved: class Edition(models.Model): edkey = models.TextField() class TextChar(models.Model): edition = mod

Re: trying to use the aggregate functions

2009-04-10 Thread chris
On Apr 10, 6:55 pm, Malcolm Tredinnick wrote: > However there could be, and likely are, many TextChar objects with the > same edition value, so it would be ambiguous as to which particular > object to return. Since there's no natural choice, there's no API to ask > Django to guess or provide a

Strange Templatetag Error

2009-04-22 Thread Chris
Hello, I am getting a strange error: TemplateSyntaxError: 'docktags' is not a valid tag library: Could not load template library from django.templatetags.docktags, No module named docktags So then I went to the shell and tried to import the docktags template library: $ ./manage.py shell >>> fro

Disabling PRG Pattern

2009-04-26 Thread Chris
I've noticed a Redirect/Get is issued automatically after every Post made. Is there any way to disable this feature? I can't find anything in the docs about this. Regards, Chris --~--~-~--~~~---~--~~ You received this message because you are subscri

Disabling PRG Pattern

2009-04-26 Thread Chris
I've noticed a Redirect/Get is issued automatically after every Post made. Is there any way to disable this feature? I can't find anything in the docs about this. Regards, Chris --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Disabling PRG Pattern

2009-04-26 Thread Chris
On Apr 26, 7:40 pm, Alex Gaynor wrote: > On Sun, Apr 26, 2009 at 7:39 PM, Chris wrote: > > > I've noticed a Redirect/Get is issued automatically after every Post > > made. Is there any way to disable this feature? I can't find anything > > in the docs ab

Finding Reason for Form.is_valid()

2009-04-28 Thread Chris
What's the easiest way to get a quick synopsis of why form.is_valid() returns false? I'm trying to unittest a form, and whenever is_valid() fails, it takes me forever to find out why. Regards, Chris --~--~-~--~~~---~--~~ You received this message becau

Finding Reason for Form.is_valid()

2009-04-28 Thread Chris
What's the easiest way to get a quick synopsis of why form.is_valid() returns false? I'm trying to unittest a form, and whenever is_valid() fails, it takes me forever to find out why. Regards, Chris --~--~-~--~~~---~--~~ You received this message becau

Detecting Disabled Cookies

2009-04-29 Thread Chris
I thought this would be a common question, but Google doesn't show any Django-specific solutions. What's the general best practice for detecting disabled cookies in a single request? Regards, Chris --~--~-~--~~~---~--~~ You received this message becau

pos small int, admin and max value errors

2009-05-13 Thread Chris
Hi All, I've been looking for a simple way to spec a "max_value" limit on a (model) positive small integer field to prevent admin from throwing an "out of range value" error. I realize that the concept "small int" may be db specific so I sought a simple way to trap the error in admin when too lar

modelling question / many-to-many / intermediary

2009-05-14 Thread chris
lf', through='AuthorCollaboration', symmetrical=False This is not symmetric - I could try to create two PersonCollaboration- objects, but this is not really clean... Thanks a lot for your support, chris --~--~-~--~~~---~--~~ You received this messa

Re: modelling question / many-to-many / intermediary

2009-05-14 Thread chris
I can add additional fields. I have to take care about the missing symmetrical property for myself, but this is okay. Have a nice day, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Historical Records (as introduced in the Pro Django book)

2009-06-04 Thread chris
that satisfy certain conditions? I guess this stuff is a bit over my head, so any pointers are really appreciated, All the best, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

FlatPage.objects.filter method: content_icontains attribute does not exist

2009-10-11 Thread chris
looks like the content_icontains attribute isn't recognize by the 'filter' method. I've tried looking through the django api but don't understand how it's set up. What is the fix required here? Chris --~--~-~--~~~---~--~~ You received t

domains vs sub-domains

2009-11-09 Thread Chris
I've recently been in discussion about which is better to have. http://media.example.com OR http://example.com/media/ 1) The first method, I've been told, allows you to make more requests. IE for example can only make like 4 requests at a given time on a given domain. but, if you use sub-domains

QuerySet Question

2009-11-12 Thread Chris
Hi all, I am new to Django and I am having a little trouble. The situation: I am setting up a music selling website (similar to iTunes) for a uni project. There are Tracks, Albums and Artists as well as users via Django auth. A user can own a track. This is accomplished with a many to many field

Re: QuerySet Question

2009-11-13 Thread Chris
track model (owned) that checks if the track is owned by the user in the request and then returns a bool. Thanks again. On Nov 12, 8:12 pm, Tomasz Zieliński wrote: > On 12 Lis, 16:12, Chris wrote: > > > Is there a way of getting a model function to access user details so > > th

Re: QuerySet Question

2009-11-14 Thread Chris
id and user_id='+str(user.id)}) in the view. Does anyone know if there is a way to achieve this? I tried but it didn't seem to work. Any other suggestions would be much appreciated. On Nov 13, 10:19 pm, Matt Schinckel wrote: > On Nov 14, 1:01 am, Chris wrote: > > > >

Request POST String

2009-11-26 Thread Chris
Hi all, Sorry for bothering you with something that is probably fairly straight forward but I cant seem to find the solution myself. I am using Google Checkout on my site. It calls one of my pages after processing an order. It posts XML. Django seems to evaluate the XML into a QueryDict, with rat

Re: Request POST String

2009-11-26 Thread Chris
d to get at POST before Django tries to interpret it. Thanks. On Nov 26, 4:05 pm, Daniel Roseman wrote: > On Nov 26, 3:55 pm, Chris wrote: > > > Hi all, > > > Sorry for bothering you with something that is probably fairly > > straight forward but I cant seem to fi

  1   2   3   4   5   6   7   8   9   10   >