Re: Django 1.6.0 over python 3: mysql?

2012-12-06 Thread Ian Clelland
rt [2] [1] https://github.com/petehunt/PyMySQL [2] http://mysql-python.blogspot.ca/2012/09/a-brief-history-of-mysqldb.html -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Disabling CSRF is not working.

2012-10-05 Thread Ian Clelland
> 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<javascript:;> > . > To unsubscribe from this group, send email to > django-users+unsubscr

Re: Django on legacy Postgres database with encoding WIN1252

2012-10-04 Thread Ian Clelland
view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/EXpvuuttJ64J. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit t

Catch or raise exception designissue

2012-07-31 Thread Ian Clelland
ct an issue with a request, as a courtesy to clients. We should never deliberately be creating 500 errors. The only responsible thing to do when a 500 is seen in the logs is to track down the source of it and fix the bug. -- Regards, Ian Clelland <clell...@gmail.com <javascript:_e({},

Re: Ignore apostrophes using django-postgresql

2012-07-20 Thread Ian Clelland
ers@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Regards, Ian Clelland <clell...@gmail.com> -- You received

Re: model translationissue

2012-07-12 Thread Ian Clelland
the first argument, and again as a named parameter. If the argument "_('name')" is supposed to be the field label, then you should pass it explicitly as that keyword art, like this: name = forms.CharField(label=_('name'), max_length=100) Ian -- Regards, Ian Clelland <clell..

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread Ian Clelland
f this is here or not > No, if you have the CSRFViewMiddleware installed, then you don't need this line at all. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: What is Django's behavior when a request is interrupted?

2012-05-29 Thread Ian Clelland
legroups.com');> > . > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com <javascript:_e({}, 'cvml', > 'django-users%2bunsubscr...@googlegroups.com');>. > For more options, visit this group at > http://groups.google.com/group/django-use

Re: HELP with unicode!!!!!

2012-05-01 Thread Ian Clelland
ve tried and hopefully we can find a solution Ian > i tried decoding the value as > > val.decode('utf-8') > > ...this helped to reduce a few encodings but gets stuck for > the encoding "\xa0" > Please HELP! > > > > -- Regards, Ian Clelland <clell...@gma

Re: HttpResponse_is_string is removed Django 1.4

2012-04-06 Thread Ian Clelland
https://code.djangoproject.com/ticket/16494, and you can see the changes that were made for 1.4 here: https://code.djangoproject.com/changeset/16829) -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django

Re: Questions about UnicodeDecodeError

2012-04-04 Thread Ian Clelland
On Monday, April 2, 2012, Ali Mesdaq wrote: > I did have UTF-8 in the db before but then when I was inserting(done by a > script) values in I would get errors. I really want to avoid doing > conversions before I insert the data so I can maintain the data in the > exact format as it was seen in.

Re: internationalization makemessage don't work

2012-02-27 Thread Ian Clelland
... > > Does your INSTALLED_APPS setting contain the apps that should be translated? -- Regards, Ian Clelland <clell...@gmail.com> -- 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: Using query set in views.py

2012-02-26 Thread Ian Clelland
eived 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<javascript:_e({}, 'cvml', > 'django-users@googlegroups.com');> > . > To unsubscribe from this group, sen

Re: internationalization makemessage don't work

2012-02-26 Thread Ian Clelland
be from this group, send email to > django-users+unsubscr...@googlegroups.com <javascript:_e({}, 'cvml', > 'django-users%2bunsubscr...@googlegroups.com');>. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Regards, Ian Clelland

Re: django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-22 Thread Ian Clelland
ll the current version -- if you can wait a couple of weeks, you'll see 1.4 released as well. > With the commas missing, all requests to nonexistent URLs returned a > 500 error. > > > On Feb 22, 12:31 am, Ian Clelland <clell...@gmail.com> wrote: > > By 'miss

Re: django 1.1: nonexistent URLs display 500.html instead of 404.html

2012-02-21 Thread Ian Clelland
go-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: saving in a view

2012-01-27 Thread Ian Clelland
customer' object. You would do that like this: this.number = this.number + 1 or customer.reference = number Then, when you save the objects (and just use "customer.save()", the force_update=True isn't really necessary), then the new values you have assigned will be saved in the da

Re: Please help with complex aggregation/annotation issue

2012-01-19 Thread Ian Clelland
x in highest_counts) You might be better off writing raw SQL for it, though; you could probably get it all with one (convoluted) query. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Django orm and no primary key

2012-01-10 Thread Ian Clelland
ith the admin; most of that framework is built around the idea of rows uniquely addressable by their primary key. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Can I escape or delimit the "{{ }}" template braces?

2011-12-19 Thread Ian Clelland
On Monday, December 19, 2011, J. Marc Edwards < marc.edwa...@nimbisservices.com> wrote: > I'd like to write a paragraph on my page that describes the {{ }} syntax, but the template interpreter is interpreting the braces. I think what you need is the {% templatetag %} tag -- it outputs template

Re: Django 1.2.1 strange problem

2011-12-15 Thread Ian Clelland
ns a response, the transaction will be committed to the database, and if the view raises error, the transaction will be rolled back automatically. In almost every case, this behaviour will be exactly what you want. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message beca

Re: Can a template extend a template?

2011-12-13 Thread Ian Clelland
uot;base_template": base_template...})) Template: (my_template.html) {% extends base_template %} (In a real app, I would use a base class for the view which would set the base template for every request automatically, or I would do it in a context processor, rather than putting those fo

Re: Query with no-correspondence results

2011-12-08 Thread Ian Clelland
On Thu, Dec 8, 2011 at 12:45 PM, wgis <alpha.sh...@gmail.com> wrote: > Ian Clelland, it worked! Thanks a lot for your perseverance > > Tom's secret sauce it's not working, unfortunately =( > Just (Carrots, Flavour, 3.0) > I guess since some 'contexts' don't have an

Re: Django E-Commerce Framework

2011-12-08 Thread Ian Clelland
odular. > > -- > 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 django-users+unsubscr...@googlegroups.com. > F

Re: Django E-Commerce Framework

2011-12-08 Thread Ian Clelland
odular. > > -- > 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 django-users+unsubscr...@googlegroups.com. > F

Re: Query with no-correspondence results

2011-12-07 Thread Ian Clelland
f I remove the WHEREs (not filtering by user or thing), it still > presents without nulls (or 0.0) > Is there other way you can see? > Again, thanks > On 6 Dez, 21:48, Ian Clelland <clell...@gmail.com> wrote: > > On Tue, Dec 6, 2011 at 1:35 PM, Reinout van Rees <rein...@van

Re: Query with no-correspondence results

2011-12-06 Thread Ian Clelland
atabase_vote on (mydatabase_vote.context_id = mydatabase_votecontext.id) where thing='Carrot' and user='Me' There still might be a way to do it with the ORM; but you can definitely use raw sql for this. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you a

Re: models.Q raising exception

2011-12-01 Thread Ian Clelland
ls as django_models ... GameProfile.objects.get( django_models.Q(nick=nick) | django_models.Q(user=self.user), world=self.world, ) to see if the problem goes away. If it does, it's almost definitely a redefined name. -- Regards, Ian Clelland <clel

Re: unit tests and 'system' tests with history

2011-11-30 Thread Ian Clelland
gestions > > > -- > 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 > django-users+unsubscr...@googlegroup

Re: Retrieve object model admin userid & password?

2011-11-30 Thread Ian Clelland
> Yes, yes and yes. If you have console access, you can also do this: manage.py changepassword username_goes_here That will allow you to reset anybody's password; superuser or otherwise. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subsc

Re: Boolean test on queryset

2011-11-28 Thread Ian Clelland
> 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 django-users+unsubscr...@googlegroups.com. > For more options, visit this

Re: django.conf.urls import question

2011-11-28 Thread Ian Clelland
evelopment version. (There used to be a big warning about this at the top of all every page in the development docs, but it seems to have disappeared.) Try following the tutorial starting at https://docs.djangoproject.com/en/1.3/intro/tutorial01/ instead, and see how far you can get. -- Regards,

Re: string indices must be integers, not str

2011-11-21 Thread Ian Clelland
g issue, but "settings.DEFAULT_FROM_EMAIL[settings.CONTACT_EMAIL_TO]" looks like you're trying to use a string to index into another string variable. Ian -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "

Re: Forbiden 403 error

2011-11-16 Thread Ian Clelland
ut of CSRF protection, then you can do that too -- it's not baked into Django that deeply. You will need to change your settings, and remove the CSRF middleware from MIDDLEWARE_CLASSES. That will completely remove this feature from your project. (and, of course, remove all of the security benefits that it

Re: How can I serve static files while requiring Django-based access permissions?

2011-11-08 Thread Ian Clelland
ubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Ian Clelland
might end up with one object created, or you might end up with 70M objects, or anywhere in between. Again: odd, undocumented, and potentially surprising behaviour, and I'd recommend explicit over implicit, especially in this case. -- Regards, Ian Clelland <clell...@gmail.com> -- You received

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Ian Clelland
On Wed, Nov 2, 2011 at 10:46 AM, Tom Evans <tevans...@googlemail.com> wrote: > On Wed, Nov 2, 2011 at 5:30 PM, Ian Clelland <clell...@gmail.com> wrote: > > On Wed, Nov 2, 2011 at 8:25 AM, Thomas Guettler <h...@tbz-pariv.de> wrote: > >>

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Ian Clelland
j.pk).*exists*(): # yes, it is special I believe that in some cases, the exists() query can be optimized to return faster than a count() aggregation, and I think that the intent of the code appears more clearly. Ian -- Regards, Ian Clelland <clell...@gmail.com> -- You received this m

Re: Long usernames in auth_user?

2011-10-28 Thread Ian Clelland
to process addresses which are that long, even though they are rarely encountered. 320 characters suffices for any valid email address. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Database management commands

2011-10-28 Thread Ian Clelland
"SHOW TABLE STATUS", and you can see the engine used by all of your tables. -- Regards, Ian Clelland <clell...@gmail.com> -- 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: Using .filter() on a constant expression

2011-10-21 Thread Ian Clelland
of.day) )) )) | ( Q(dob_year_max=alive_y2+1) & ( Q(dob_month=1) & ( Q(dob_day=None) | Q(dob_day__lt=1) )) )) -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups &quo

Re: django.db.models import Q help!

2011-10-21 Thread Ian Clelland
other object, then just use that! Try something like fi = request.user.get_profile().financial_institution txn = Transaction.objects.extra( where=['(tpin=%s or teller_no=%s or identifier=%s) AND financial_institution_id=%s'], params=[value, str(value), value, fi.id])

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
s going to compute some value, probably a list of Entry instances in this case, and then it will create a new context variable, with the statement; context[self.related_entries] = And that is what is going to create the context variable {{related_entries}}, or {{cheeseburger_hotel}}, or whatever th

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
om/d/msg/django-users/-/KsGYSEO2NUkJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
visit > https://groups.google.com/d/msg/django-users/-/yYKP0Xoz9XkJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http:/

Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
On Wed, Jul 27, 2011 at 9:29 AM, Ian Clelland <clell...@gmail.com> wrote: > > > On Mon, Jul 25, 2011 at 11:29 AM, Alfredo Alessandrini < > alfreal...@gmail.com> wrote: > >> Hi, >> >> I've a model testDB with a foreignkey "country" r

Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http

Re: in my model, how can I tell when I'm saving a new item

2011-07-25 Thread Ian Clelland
. If there is code that absolutely has to run when a new object is created, (or code that needs to run on update, but absolutely cannot run on new objects before insertion), then you may be better off using a post-save signal handler, and checking the "created" argument that gets passed

Re: 'settings' referenced before assignment

2011-07-20 Thread Ian Clelland
overwrite it), or remove the assignment to the 'settings' variable (if you don't), or change the name of the variable you assign to (if it was an accident). -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Djang

Re: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
> http://groups.google.com/group/django-users?hl=en. > > Are you loading the template tag library in the template that extends the base? -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "D

Re: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
ge 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at &g

Re: Strip_tags and non english char issue

2011-06-26 Thread Ian Clelland
in the html header that specifies unicode. If those aren't there, then your browser will have to guess the document encoding, and might be guessing wrong. Hopefully that should get you enough visibility on the problem to see what is happening. If none of that provides any clarity, then try

Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Ian Clelland
ical difference in performance -- I would hope that any decent SQL query optimizer should be able to change select payee.* from payee join person on (payee.person_id = person.id) where person.id = 26 into select payee.* from payee where person_id = 26 -- Regards, Ian Clelland <clell...@gmail.c

Re: Unit-Testing Dilemma

2011-06-21 Thread Ian Clelland
logic, so testing what the API receives makes the most > sense to me. > If this is all for a refactoring, then you're probably on the right track there -- instrument the existing object for testing, rather than restructuring the view first. Get the code into a state where you can trust it, and the

Re: Possible bug in form validation

2011-06-20 Thread Ian Clelland
lsewhere, but it is not used internally by the form machinery. > > However, this is looking like a legitimate bug to me. > > http://dpaste.com/hold/556603/ > > I've updated with a working example, as http://dpaste.com/hold/556805/ -- Regards, Ian Clelland <clell...@gmai

Re: Unit-Testing Dilemma

2011-06-20 Thread Ian Clelland
ou 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > h

Re: storing django object into javascript variable/array

2011-06-15 Thread Ian Clelland
y that you know JavaScript, so what you're going to have to do is come up with a sample of what you'd *like* to see as the template output, and hopefully we can help you with the Django template code to produce that output. [Also, it really doesn't help to be posting and reposting the same question, just hou

Re: Could not decode to UTF-8 column 'cpostal'

2011-06-13 Thread Ian Clelland
base in the python shell, then can you save it from there as well? If everything above works, then try doing this: > object_from_database.save() and see if you get the same error. If so, posting a traceback from that might help pinpoint the problem. -- Regards, Ian Clelland <clell...@gmail.com&g

Re: forms messing up css, help?

2011-06-11 Thread Ian Clelland
ld() > > > name = forms.CharField() > > > > > #urls.py > > > urlpatterns = patterns('', > > > ... > > > (r'^contact-form/', views.contact), > > > ... > > > ) > > > > > I have my static folder and e

Re: storing django object into javascript array

2011-06-10 Thread Ian Clelland
do something like this: from django.utils.simplejson import dumps ... school_list = dumps([school.name for school in city.school_set.all()]) and then add school_list to the context variables that are passed to the template. Then in the template, you can just use {{ school_list }}, and it will be

Re: 'ValuesListQuerySet' object has no attribute 'META'

2011-06-10 Thread Ian Clelland
ying META attribute. Check to see if that's the case, and rename your list() view if it is. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: 'ValuesListQuerySet' object has no attribute 'META'

2011-06-09 Thread Ian Clelland
; doesn't even occur in the db package, so I can't imagine how simply wrapping a QuerySet in a list() call could trigger an exception like that. Can you post the rest of the code around this, or at least more of a traceback, unless that is really all that there is? And if it is, then I'd really lik

Re: Trouble with simple aggregation

2011-06-08 Thread Ian Clelland
idea being that you group the objects by category, and then count the number of distinct ids within each category. The docs mention that the default ordering can get in the way of this sometimes, so you probably want to clear it first, like this: Article.objects.values('category').annotate(

Re: SystemError from django.conf.settings

2011-05-30 Thread Ian Clelland
turned up. See if there are any other compiled modules in the system that you can update first. -- Regards, Ian Clelland <clell...@gmail.com> -- 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

Re: json serialization question

2011-05-27 Thread Ian Clelland
... records = models.Residents.objects.extra( where=[], params=[...]) data = json.dumps(records.values('fname','lname','pt')) return HttpResponse(data, mimetype='application/json') records.values(...) should return just the dictionary that you want to use. json.dumps(...) will

Re: Email app is breaking long lines, any fix?

2011-05-17 Thread Ian Clelland
the headers yourself, and call send() on it. (Also, 'text/us-ascii' is not a registered MIME type; you probably want to say something like 'text/plain; charset=us-ascii') [1] http://docs.djangoproject.com/en/1.3/topics/email/#the-emailmessage-class -- Regards, Ian Clelland <clell...@gmail.com>

Re: Encrpting urls to hide PKs

2011-05-12 Thread Ian Clelland
ser comes back to the confirmation view. If your tokens are actually random, and large enough (say, 64 bits), then anybody trying to guess them will be wasting their time. -- Regards, Ian Clelland <clell...@gmail.com> * By looking at the database IDs, people can gauge how heavily the system is

Re: Decimal * Float problem

2011-05-11 Thread Ian Clelland
value *back* into a float; you should use .quantize() instead. -- Regards, Ian Clelland <clell...@gmail.com> -- 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. T

Re: 500 message with POST

2011-05-02 Thread Ian Clelland
direct anyway, buy the user agent is *not* supposed to just blindly post the data to the new URL without some sort of user interaction. To eliminate this as a possible error source, try putting the trailing "/" on the URL in the command line: $ wget --post-data 'data=Something' http://localhos

Re: compressing uploaded file

2011-04-20 Thread Ian Clelland
ess it. > > When I try to do this: > > file.write(zlib.compress(file.read())) Don't do that -- I'm pretty sure that writing a file that you already have open for reading will produce undefined results. (Also, I'd try to stay away from using 'file' as a variable name -- it just hides t

Re: Debugging a unittest

2011-04-20 Thread Ian Clelland
g And only the one test that you specify will actually be run. -- Regards, Ian Clelland <clell...@gmail.com> -- 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: how to call user-defined database functions through the Django query syntax?

2011-04-20 Thread Ian Clelland
(title__icontains="test").extra(where='oe_matches(structure.smiles, "[C;!H0]")') You could encapsulate the extra() call in a function call that annotates a QuerySet that you pass to it, but it's 'outside' of the ORM at that point. -- Regards, Ian Clelland <clell...@

Re: Unidirectional relations

2011-04-20 Thread Ian Clelland
) would give a child a reference to their parent, without the parent having a child_set attribute. I think Mike has the right idea; using a separate 1:many table to avoid explicit fields on the child model, but, of course, SQL being what it is, it is still possible to construct a query that joins

Re: Using composition in Django

2011-04-16 Thread Ian Clelland
ll generate SQL like this: CREATE TABLE "employee_employee" ( "id" serial NOT NULL PRIMARY KEY, "person_id" integer NOT NULL, "address_id" integer NOT NULL ) ; which is probably closer to what you're expecting. -- Regards, Ian Clelland <clell...@gm

Re: Nested admin command problem

2011-04-07 Thread Ian Clelland
lf, *args, **options): self.host = options.pop('host') # 'host' isn't in options anymore # do some more stuff call_command('test', *args, **options) -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups

Re: Using ifnotequal with a list object not working

2011-04-07 Thread Ian Clelland
fnotequal thetypes.0 "Nothing dude" %} ... {% endifnotequal %} should work. -- Regards, Ian Clelland <clell...@gmail.com> -- 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: Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

2011-03-27 Thread Ian Clelland
tion_rules call to either: "student_portal\.fields\.ProtectedFileField" -- removing the "^" so that it can match anywhere within the string, or "^classcomm\.student_portal\.fields\.ProtectedFileField" -- preserving the "^", but adding the "classcomm.&quo

Re: Repetition in urls.py

2011-03-24 Thread Ian Clelland
e_by': > 10} Can you not set your info_dict just like that, and then rewrite it like this: YearArchiveView.as_view(**info_dict),name='blog_archive_year'), url(r'(?P\d{4})/(?P[a-z]{3})/$', -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subs

Re: How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-14 Thread Ian Clelland
our own template tag (it's really simple, you can use the CSRF-token code in django/template/defaulttags.py as a starting point) which would render whatever markup you need. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Group

Re: How to check if string is in Hebrew

2011-02-28 Thread Ian Clelland
ers in the string, either with if any(map(char_is_hebrew, lang_string)): or if all(map(char_is_hebrew, lang_string)): -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: User Profiles?

2011-02-15 Thread Ian Clelland
erent from saving the profile object. (user.save() just updates a row in the auth_user table, which doesn't affect the accounts_userprofile table at all.) The way I would do it is this: profile = user.get_profile() profile.age = 34 profile.save() Try that, and see if it updates the database. -- Regar

Re: TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-11 Thread Ian Clelland
like this: {% for obj in my_raw_queryset %} {{ obj.visible_choice }} {% endfor %} -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-10 Thread Ian Clelland
ups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: csrf cookie security

2011-02-10 Thread Ian Clelland
) are never sent in the clear, that your session cookie is never sent in the clear, and that essentially your whole site is protected by SSL, such that a request coming in over plain HTTP, even if properly authenticated, is still rejected. Once you have this in place, the secure flag on the CSRF coo

Re: csrf cookie security

2011-02-09 Thread Ian Clelland
er plain HTTP -- but the site is already HTTPS-only, so there shouldn't be any form-handling code listening on that port. Does this threat model correspond to what you're thinking? If so, I don't see away around the CSRF protection (at least, not one that involves the victim's browser) -- Regards,

Re: csrf cookie security

2011-02-09 Thread Ian Clelland
(SSL wouldn't even help; he could construct an https:// link just as easily.) That's not how it's supposed to be set up, though. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: URLField strange error

2011-01-19 Thread Ian Clelland
d through a ModelForm, or are you saving the model manually? Regards, Ian Clelland <clell...@gmail.com> -- 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 un

Re: URLField strange error

2011-01-19 Thread Ian Clelland
ght in the URL Validator. Without some more info, this is all speculation anyway, though. Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: South introspection doesn't get registrered

2011-01-17 Thread Ian Clelland
es anybody know why? Try changing the last line of your introspection rule, from > ["^core/.models/.lib.thumbs.ImageWithThumbsField",]) to something like ["^lib.thumbs.ImageWithThumbsField",]) It looks like South is not recognizing your field type, as it is using a different package name th

Re: Query Set involving Model Method

2011-01-16 Thread Ian Clelland
ubscribed 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http:/

Re: Generate a unique username for django.contrib.auth

2011-01-14 Thread Ian Clelland
aking any 30-character slice from it should get you 120 bits of pure random goodness. -- Regards, Ian Clelland <clell...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: QuerySetManager breakage with r14389

2011-01-12 Thread Ian Clelland
On Wed, Jan 12, 2011 at 6:23 AM, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Thu, Jan 6, 2011 at 5:29 AM, Ian Clelland <clell...@gmail.com> wrote: >> Hi, >> >> I've been using Simon Willison's QuerySetManager[1] pattern for a >> while now, and

Re: Ordering columns in from clause

2011-01-06 Thread Ian Clelland
antage that comes from this kind of query. It is not valid SQL to order by a column that is not in the result set. MySQL allows you to do that, but that is a MySQL-specific feature. PostgreSQL, certainly, does not allow this, and there is no real advantage gained (aside from a slightly smaller response) by e

QuerySetManager breakage with r14389

2011-01-05 Thread Ian Clelland
Hi, I've been using Simon Willison's QuerySetManager[1] pattern for a while now, and since upgrading to Django 1.2.4, it has been breaking when I try to call a method on a RelatedManager constructed from it. There was a change in r14389 (14390 in the 1.2.X branch) which causes this code to break

Re: Reading data from database tied to another Django project?

2009-07-15 Thread Ian Clelland
On Jul 14, 8:23 am, Benjamin Kreeger wrote: > I was using PostgreSQL at first, but then I found information about > reading data across databases only with MySQL, so I'm using MySQL for > the time being. > > Now, I don't have a database set for P1 yet because it's

Re: SelectMultiple with Static Choices in admin Interface

2009-07-13 Thread Ian Clelland
On Jul 13, 10:03 am, itodd wrote: > Greetings, > > I'm trying to use a SelectMultiple with a set of static choices. I'm > experiencing odd behavior when the number of choices exceeds 10. For > example, take the following Model and ModelForm: > > class Project(models.Model):

Re: Nested views and urls patterns declaration order

2009-07-13 Thread Ian Clelland
On Jul 13, 8:48 am, Frédéric Hébert wrote: > When I declare the outter view after the inner in urls.py she's never > been called. It's the inner that's got it. > (She's called when I reverse the order of declaration, eg the outter > first) > >  I've pasted the code at

Re: Reading data from database tied to another Django project?

2009-07-10 Thread Ian Clelland
On Jul 10, 12:37 pm, Ben Kreeger wrote: > How do I go about accessing that data from P2's database? Do I need to > create a model in P1 and bind it to a certain table in P2's database? > If that's the case, how do I specify access credentials for that > database? Is

Combining filters on related models

2009-07-09 Thread Ian Clelland
I'm trying to construct a query which combines two filters on a related model, and I'm having no luck. Hopefully somebody can see what I'm doing wrong, and point me in the right direction. I'd like to be able to specify two exclude criteria on a related model, and have both criteria apply to the

Re: trailing slash added to passed form data

2007-04-13 Thread Ian Clelland
the value and the "/" character. Something like this: would be valid XHTML. If you don't care at all about XML conformance, you could also just get rid of the "/" and have which is valid HTML, but not XHTML. Regards, Ian Clelland <[EMAIL PROTECTED]> --~--~-

  1   2   >