Re: User Profiles?

2011-02-15 Thread Ian Clelland
user object is different 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 update

Re: How to check if string is in Hebrew

2011-02-28 Thread Ian Clelland
nd then test all of the characters 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 -- You received this message because you are subscribed to the Google Groups "Django users" group. To

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

2011-03-14 Thread Ian Clelland
d, but more reusable way to do it would be to write your 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 -- You received this message because you

Re: Repetition in urls.py

2011-03-24 Thread Ian Clelland
ate_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 -- You received this message because you are s

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
ither: "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." that South sees

Re: Using ifnotequal with a list object not working

2011-04-07 Thread Ian Clelland
ude" %} ... {% endifnotequal %} should work. -- Regards, 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 ema

Re: Nested admin command problem

2011-04-07 Thread Ian Clelland
#x27; out of the options dictionary? def handle(self, *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 -- You received this message

Trying to use django-locking (I know it's old)

2014-11-20 Thread ian . k
lf._wrapped, name) AttributeError: 'Settings' object has no attribute 'ADMIN_URL' Please help if you can. Thanks! - Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Trying to use django-locking (I know it's old)

2014-11-20 Thread ian . k
ation item in my project. Do you know what could be causing this? The other parts of the added code seem to be located just fine. Thanks! Ian On Thursday, November 20, 2014 11:02:29 AM UTC-7, ia...@me.com wrote: > > Hi there, > > I'd like to try and add django-locking ( > ht

django-locking

2014-11-21 Thread ian . k
Hi everyone, I'm posting new message because I have a different question. Has anyone had any luck using django-locking (https://github.com/RobCombs/django-locking) with a modern version of Django's admin interface? I've got it mostly working with my project. Basically Django is set up to add

Has anyone successfully used django-concurrency?

2014-11-21 Thread ian . k
dname return obj._concurrencymeta._field.attname AttributeError: 'Configuration' object has no attribute '_concurrencymeta' [21/Nov/2014 20:29:51] "GET /test/common/configuration/ HTTP/1.1" 500 368613 I also changed {{ obj.pk }} to {{ obj|identity }} in delete_se

Stopping request when exception occurs (admin interface)

2014-11-26 Thread ian . k
Hi there, Hopefully an easy question. I've overridden save_model() in my admin page, and I'm wrapping my obj.save() call in a try/catch so that I can catch a RecordModifiedError. def save_model(self, request, obj, form, change): from concurrency.exceptions import Reco

Subscribe / unsubscribe to data streams over websocket channel

2016-09-30 Thread Ian Danforth
m consumer, but any examples / insights into this pattern would be greatly appreciated. Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to d

Running django on demand via my PyQt4 Standalone app

2016-10-24 Thread Dam ian
Hi, I work on some Smart Home UI / Controlling system using PyQt4, now I'm in the point where i need a Web Server to share a "Admin Page" to let the user change some Smart Home settings (via web page of course :p ). I searched the internet for a answer / idea and I think that the django server

Re: Running django on demand via my PyQt4 Standalone app

2016-10-25 Thread Dam ian
Hi again, and thanks for the answer and Tips @Mario R. Osorio >I cannot understand is why would you need django for admin, but use some other standalone (desktop?) application for everything else. You should try and stay either on the django or on the standalone application. i think i must

Re: Running django on demand via my PyQt4 Standalone app

2016-10-26 Thread Dam ian
yeah you are right with the WoW effect :) and i know this framework but its to complex for me :P i prefere to use PyQt4, for example you have something like QT Designer where you can graphically deploy and customize the whole UI and then convert to pure python, what make me my work easier. If ki

AttributeError: 'Settings' object has no attribute 'SATIC_ROOT'

2017-09-21 Thread Ian Likono
Iam following up a tuitorial on Django https://www.youtube.com/watch?v=9Wbfk16jEOk&t=192s. I have followed everything up as he has instructed but after running server i get the error: (tryTen) root@likono:~/Desktop/tryTen/tryten# python manage.py runserver Performing system checks... Unhandled

Deleting a record exactly once

2019-08-01 Thread Ian Hoffman
ty. Wondering if anyone has suggestions around how to handle race conditions like this one. This can't be an uncommon problem, can it? Any feedback is very much appreciated! Thanks, Ian -- You received this message because you are subscribed to the Google Groups "Django users"

Re: manage.py can't run any commands

2019-12-18 Thread Ian Githungo
have you checked the virtual environment which you have installed the version of Django you are currently using? On Tue, Dec 17, 2019 at 2:36 PM Phil Yang wrote: > Hi, > The manage.py script for all my projects has suddenly stopped working. It > can't run any commands, such as runserver or star

Re: manage.py not able to run any commands

2019-12-18 Thread Ian Githungo
First you have to check if you have activated your Visual environment which you have installed Django On Tue, Dec 17, 2019, 2:36 PM Phil Yang wrote: > Hi, > All of a sudden, when I tried to run manage.py runserver, it didn't > produce any output, and it didn't do anything. In fact, the manage.py

Simplest unit testing of models fail ...

2008-10-18 Thread Ian J Cottee
block What it actually means is, you stuck 16 chars where only 15 chars were allowed. Is this testable? Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Model validation basics

2008-01-12 Thread Ian J Cottee
;, line 18, in execute return self.cursor.execute(sql, params) ProgrammingError: value too long for type character varying(15) BANG! I'd be expecting for Django to tell me before postgres does, that the field does not validate. Am I misunderstanding something? Ian --~--~-~--~---

Restriction of Model Inheritance - mixing multi table and abstract

2008-07-01 Thread Ian J Cottee
happen. Is there some rule I'm breaking here? Cheers Ian --- Code follows --- from django.db import models import datetime # Create your models here. class BaseModel(models.Model): """Abstract class used for some common fields""" created_at = mode

Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
django.db.models.Model and consequently create the necessary tables for MyBaseModel. Or have I just misunderstood why it was necessary for me to include "base" in order to get the tables created properly by "manage.py syncdb"? TIA, Ian Stokes-Rees -- You received this mess

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
d reason why it can't be 1. Thanks, Ian -- 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...@googl

read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
fields displayed just as table entries or textareas which can't be edited. In other words, no or tags. TIA. Ian Stokes-Rees -- 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: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
o I don't see why it can't also be smart enough to then figure out that "BaseModel" needs to be included for ORM automatically. Ian -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

Re: read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
e }} etc. works just fine. I don't understand why object.as_table wouldn't work. Below are some code fragments. Cheers, Ian urls.py: (r'task/(?P\d+)/?$' , DetailView.as_view(model=WSMRTask)), to templates/wsmr/wsmrtask_detail.html:

Re: read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
On 2/7/11 5:29 PM, Ian Stokes-Rees wrote: > This sounds good. Form Preview could be useful, but right now I just > want to be able to use Generic Views (DetailView.as_view()) to render > the default context object using "as_table()", but I'm failing to do that. > >

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-08 Thread Ian Stokes-Rees
Otherwise, its a series of $MAGIC working out what apps/DB tables are > required, and $MAGIC is never good - might as well be using rails. feels fairly arbitrary -- the whole point of a web framework like Django is that "magic happens", and stuff "just works". Ian -- Yo

FormPreview and ModelForms

2011-02-10 Thread Ian Stokes-Rees
if request.FILES.has_key('mtz_fp'): WSMRTaskForm(request.POST, request.FILES).save() return HttpResponseRedirect(reverse('success')) else: return HttpResponseRedirect(reverse('missing_files')) TIA, Ian -- You received this messa

upload_to chicken and egg problem

2011-02-10 Thread Ian Stokes-Rees
ss def). Any good suggestions about how I can do this *other* than the obvious option of creating a separate module of functions that support the specific class? That is *so* not OO, but I'll do it if it is the only option. Ian -- You received this message because you are subscribed to t

FormPreview with file upload problems

2011-02-10 Thread Ian Stokes-Rees
g the uploaded form, with the "preview" step returning an error stating: - This field is required. Even when the file has been supplied. Can someone advise how I can modify/manage FormPreview to handle uploaded files? Thanks, Ian -- You received this message because you are su

Re: FormPreview with file upload problems

2011-02-10 Thread Ian Stokes-Rees
to the form object before saving it. If there are other alternatives, I'd love to know what they are. 1. and 3. seem like the best plans. I feel like I should move forward with 1. Comments welcome. Ian -- You received this message because you are subscribed to the Google Groups "Dj

Configuring common site URL paths for use in templates

2011-03-23 Thread Ian Stokes-Rees
e couldn't find that page. Maybe it has moved -- why not look in the Site Directory? If it seems like an error, please contact us. {% endblock %} Can anyone suggest a good way of doing this? TIA, Ian -- You received this message because you are subscribed to the Google Groups "Django

decorators and generic views

2011-03-24 Thread Ian Stokes-Rees
s_view(...) but not having any luck. Advice on how properly map from urls.py to a function in the wrapped view would be appreciated. My current best attempt is below Cheers, Ian urls.py BEFORE: from gridportal.wsmr.models import WSMRTask from gridportal.wsmr.views

Tutorial missing import: Http404

2015-04-10 Thread John Matthew Ian Davis
obviously one needs to change: from django.http import HttpResponse, to from django.http import HttpResponse, Http404 but that's a speed-bump that should not be in the tutorial. NameError at /polls/34/ global name 'Http404' is not defined Request Method: GET Request URL: http://localhost

Re: Tutorial missing import: Http404

2015-04-10 Thread John Matthew Ian Davis
On Friday, April 10, 2015 at 3:33:36 PM UTC-7, Ramiro Morales wrote: > > On Fri, Apr 10, 2015 at 6:31 PM, John Matthew Ian Davis < > johnmatth...@gmail.com > wrote: > >> obviously one needs to change: >> >> from django.http import HttpResponse, >> >&g

<    2   3   4   5   6   7