Re: Custom validation for models in admin

2007-10-04 Thread jr
The following did it for me: from django import newforms as forms class yourForm(forms.BaseForm): ... def clean(self): "do your custom validation here" return self.cleaned_data does it for me. Clean is called automatically e.g. by ...is_valid(). hope it helps. jr

Re: How to make Django Project Mobile Compatible

2019-05-11 Thread Luqman Jr
Between Angular and React which one is the best to be used with Django? On 11 May 2019, 10:38 +0300, Balaji Shetty , wrote: > Hi  Nick Sarbicki > > Thank You very much for your reply. > May I know which framework is to be learned for necessary implementation?. > It should be easy to earn with help

Re: Tutorial Part 1

2020-05-08 Thread Luqman Jr
Hello Did you create urls.py under polls app? You should have urls.py under polls app which will list all urls fall under this app. Then share with us polls/urls.py and polls/views.py so that we can help more on this. On 9 May 2020, 03:11 +0300, Randy Zeitvogel , wrote: > I just started working w

Re: FormWizard: Setting up a ChoiceField.choices based on previous forms,

2008-12-31 Thread David Durham, Jr.
On Tue, Dec 30, 2008 at 3:16 PM, Ariel Mauricio Nunez Gomez wrote: > Hello list, > Today I started using FormWizard and could not find a clean way to populate > a choices field based on previously submitted forms, I ended up overriding > the render method like this(The only changed line is the on

Re: Nesting inlines with django-admin

2008-09-11 Thread David Durham, Jr.
> I'm having the same need for nested inlines. Bump. I'm probably going to take the plunge and try to implement this if no one has beaten me to it. -Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

date time input in a modelform

2008-09-16 Thread David Durham, Jr.
Hi all, I'm working through a simple wizard using the formtools wizard stuff. My issue is that my forms don't display with niceties such as date time popup and foreign key 'add' options. Is there something extra that has to be done for these features? Just as a simple test, I reduced things to

Re: date time input in a modelform

2008-09-17 Thread David Durham, Jr.
On Tue, Sep 16, 2008 at 3:13 PM, David Durham, Jr. <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm working through a simple wizard using the formtools wizard stuff. > My issue is that my forms don't display with niceties such as date > time popup and foreign key &#x

Re: Reusable views from a template - How?

2008-09-17 Thread David Durham, Jr.
On Wed, Sep 17, 2008 at 1:35 PM, WillF <[EMAIL PROTECTED]> wrote: > I have written a login view as I have followed the tutorial but how do I > reuse this view in multiple pages of the site? > > Is there a way to render this particular view as part of a template, so I > could have the login form (o

Re: Reusable views from a template - How?

2008-09-17 Thread David Durham, Jr.
>> Have you read up on template inheritance? >> http://docs.djangoproject.com/en/dev/topics/templates/#id1 > > I've read that part, I can see how that would work if I statically define > the form. But right now I have > a view defined that pushes out the LoginForm to my template. So say I have > a

ModelForm initial= vs. instance=

2008-09-19 Thread David Durham, Jr.
I'm writing a little wizard application to walk a user through creating a bunch of Model objects. I stumbled across something kind of interesting; if I create a ModelForm like so: SomeModelForm(initial={...}) All of the fields I have are prepopulated, except the ForeignKey ones. I don't hav

Re: Template Inheritance Question

2008-09-19 Thread David Durham, Jr.
On Fri, Sep 19, 2008 at 4:07 PM, djandrow <[EMAIL PROTECTED]> wrote: > > I have a template, text that extend a template base. > > In my text template I have; > > {% extends 'base.html' %} > > {% block content %} > > SOME CODE > > {% endblock content %} I'm not a django expert, but I think that yo

Re: ModelForm initial= vs. instance=

2008-09-20 Thread David Durham, Jr.
> No, there's quite a difference. "Initial" is used to set the initial > values and is quite appropriate when a *new* model instance is going to > be created. The "instance" is used when you want the ModelForm to be > used to update an existing instance of a model. > Since Django does not > curren

Re: ModelForm initial= vs. instance=

2008-09-20 Thread David Durham, Jr.
> Basically, I store the cleaned_data in the session for POSTs and use > the cleaned_data in order to initialize a ModelForm for display after > GETs. Eventually, I have to save some things. When that happens, I > again get the data from a session: > >for i in range(len(self.get_form_li

Re: How to simulate recursive inlines in admin?

2008-09-22 Thread David Durham, Jr.
On Mon, Sep 22, 2008 at 4:05 PM, Petar Marić <[EMAIL PROTECTED]> wrote: > I'm using the admin app for creating Questionnaires and I'd like to let users > edit questions and answers in the same form. AFAIK recursive inlines aren't > supported in Django (a hard problem by itself) so the only other wa

Re: How to simulate recursive inlines in admin?

2008-09-22 Thread David Durham, Jr.
2008/9/22 Steve Holden <[EMAIL PROTECTED]>: > This all seems rather ambitious for the admin. Isn't it supposed to be a > simple application, and aren't those kind of functions supposed to be > implemented by other views? There's no point trying to make the admin > all things to all people - that w

Re: Two Django visions running at once.

2008-09-23 Thread David Durham, Jr.
On Wed, Sep 17, 2008 at 3:21 PM, KillaBee <[EMAIL PROTECTED]> wrote: > > Is it possible to have two versions of django running at the same time > on an Ubuntu server(9.0 and 1.0)? > It is taking to long to recode, and until I do I wanted It up and > running with the old version. > I got the tar.gz

Re: amd64 vs x86 hosting

2008-09-24 Thread David Durham, Jr.
On Wed, Sep 24, 2008 at 6:14 AM, mcosta <[EMAIL PROTECTED]> wrote: > One question: ¿amd64 or x86? we've got some bechmark claiming superior > performance for amd64, both with python and mysql, but then we can not > tune with psyco. We've taken a look at pyrex but we do not know even > if we are sh

Re: amd64 vs x86 hosting

2008-09-24 Thread David Durham, Jr.
On Wed, Sep 24, 2008 at 11:07 AM, David Durham, Jr. <[EMAIL PROTECTED]> wrote: > On Wed, Sep 24, 2008 at 6:14 AM, mcosta <[EMAIL PROTECTED]> wrote: >> One question: ¿amd64 or x86? we've got some bechmark claiming superior >> performance for amd64, both with pytho

Re: Multiple instances using mod_python

2008-09-24 Thread David Durham, Jr.
> I see on this thread > > from last year that there is suspicion that Apache can at times misdirect > mod_python requests to the wrong mod_python instance. You could try mod_wsgi. -Dave

Re: amd64 vs x86 hosting

2008-09-25 Thread David Durham, Jr.
>> I think the primary difference is the amount of RAM that is supported >> and whether or not you have compatible software. With that said, all >> modern processors are x64 so you probably want to default with an x64 >> OS unless you need x86 for software compatibility reasons. > > That's not wh

Re: Form controls for choosing from long lists

2008-09-26 Thread David Durham, Jr.
On Fri, Sep 26, 2008 at 12:12 PM, Donn <[EMAIL PROTECTED]> wrote: > > Hi, > I thought I'd ask before rolling my own (at tedious pace) widget/whatever: > > If you have a foreign key field to a table of thousands of, say, author names, > the drop-down control becomes a real problem: > 1. It's not pa

Re: displaying list from dictionnary -django 1.0

2008-10-03 Thread David Durham, Jr.
On Fri, Oct 3, 2008 at 12:13 PM, tsmets <[EMAIL PROTECTED]> wrote: > I have an application that records the status of an applications. > Basically something like : > _ started-request > _ started > _ stop-requested > _ stopped > + some technical informations (version, host, URL, ...) > > I tho

djangosnippets.org list navigation

2008-10-08 Thread David Durham, Jr.
The list navigation on djangosnippets is not so good. Take this page for instance: http://www.djangosnippets.org/users/ I happened to stumble across the following jquery plugin which might be a quick fix for some of the issues (though searching should be added to): http://www.ihwy.com/labs

Re: using request.POST as keyword args

2008-10-09 Thread David Durham, Jr.
> I do not understand why you want to do this. Why not just pass request.POST > without the **, and declare your function to take a single argument which > you expect to be a dictionary-like object (as request.POST, a QueryDict, > is)?. That is: > > result = ab.perform(request.POST) > where: > d

Re: django-jython-postgres driver

2008-10-13 Thread David Durham, Jr.
On 10/13/08, dusans <[EMAIL PROTECTED]> wrote: > I have writen a Test.java with: > Class.forName("org.postgresql.Driver"); > > It works, so that means it should work. > > But jython tells me: DatabaseError: driver [org.postgresql.Driver] not > found > > What am i doing wrong > I have been r

Re: How to avoid out of sync sequence for primary key using Postgresql?

2008-10-16 Thread David Durham, Jr.
On Thu, Oct 16, 2008 at 2:38 PM, cfobel <[EMAIL PROTECTED]> wrote: > I recently encountered a situation where the sequence for the primary > key of one of my models became out of sync, which caused the following > error when trying to save a new model instance: > > IntegrityError ... 'duplicate k

Re: widget=forms.HiddenInput doesn't work

2009-04-01 Thread Michael Rose Jr.
On Apr 1, 6:53 pm, Brian Neal wrote: > On Apr 1, 8:16 pm, rizzoo wrote: > > > How do I make a field hidden when using ModelForm?  I tried > > HiddenInput but it appears to be ignored. > > > code:http://dpaste.com/22290/ > > Line 9 > > > Here's what View Source shows for that line in the browners

Re: widget=forms.HiddenInput doesn't work

2009-04-01 Thread Michael Rose Jr.
On Apr 1, 8:40 pm, Brian Neal wrote: > On Apr 1, 10:19 pm, "Michael Rose Jr." > wrote: > > > > > Brian. Thanks for responding. I mean to post "name". I've been > > experimenting with other field types, which why I accidentally pasted >

Re: widget=forms.HiddenInput doesn't work

2009-04-02 Thread Michael Rose Jr.
This was fixed by upgrading to the latest version in SVN. Thanks for your help B On Apr 1, 8:57 pm, "Michael Rose Jr." wrote: > On Apr 1, 8:40 pm, Brian Neal wrote: > > > > > On Apr 1, 10:19 pm, "Michael Rose Jr." > > wrote: > > > > B

Re: how do you build an html website in python?

2010-04-17 Thread Steven Elliott Jr
Python won't build a site for you by itself. Do you already know python, HTML, JavaScript, relational databases and the like? All of these things are still important. Python is only one piece of the overall puzzle. -Steven Elliott Jr On Apr 17, 2010, at 9:13 AM, "ge...@aquaria

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-17 Thread Steven Elliott Jr
etter developer even if you only work professionally with one stack, learning and playing with other things will open up your mind. For me yes I love python and django but I also play with erlang, lua, haskell, xyz framework... you name it. It's good for yer noggin. -Steven Elliott Jr

Re: how do you build an html website in python?

2010-04-17 Thread Steven Elliott Jr
@codecub If you are interested in just building an HTML website why not just write it in HTML? Why do you think you need to use Python? What are the requirements of the website? Do you need a database and middleware? If so I would recommend following the django tutorial first: http://docs.djangop

Re: LIMITATIONS of django

2010-09-04 Thread Steven Elliott Jr
This is not really an appropriate question. Django, like many frameworks is a collection of libraries written in some language. Django happens to be written in Python; as such, your proficiency with Python will have an effect on what you can and can't do with Django. Django provides a lot of use

Re: Pylons vs. Django

2010-09-05 Thread Steven Elliott Jr
You can use sqlalchemy with django too Sent from my iPad On Sep 5, 2010, at 2:37 PM, Juan Hernandez wrote: > Well, just by using SQLAlchemy makes this framework worth a try > > On 9/5/10, Feross wrote: >> Hey everyone, >> >> I'm a new Python user and I'm looking for a web development framewo

Re: Recommend a book

2010-09-23 Thread Steven Elliott Jr
I have found beginning django e-commere as practical django projects to be great. Both from apress. I prefer to use books that go through building real world solutions. The definitive guide to django is a must read though. On Sep 23, 2010, at 9:57 PM, Tim Johnson wrote: > FYI: I'm an experien

Re: Django on Apache

2010-09-25 Thread Steven Elliott Jr
MAMP can be a bit of a pain I think sometimes to modify, though I haven't used it much in the past few years. You can use the Mac's built-in apache server though with mod_python. Check out http://www.google.com/search?q=mod_python+mac+os+x&ie=UTF-8&oe=UTF-8&hl=en&client=safari Sent from my iPho

Re: Django IDE

2010-02-15 Thread Steven Elliott Jr
TextMate! On Feb 15, 2010, at 5:45 AM, Anton Bessonov wrote: > http://www.vim.org/ > > dj_vishal schrieb: >> Hello >> >> Hi to all am new to the Django Framework.am learning django >> Which IDE is suitable for Django ..plz help me in right way >> >> Thanks in Advance >> vishal >> 20

Re: Passenger 57 - a Django query problem

2010-02-20 Thread Steven Elliott Jr
I've always found both the Django and Python communities to be among the friendliest and most helpful. Please be kind to one another and respectful of everyones comments. We are here to support one another in our efforts to better our django skills and to better the community and project as

Django in the enterprise?

2010-02-24 Thread Steven Elliott Jr
Dear friends, I apologize for writing this type of question to the community but I would appreciate any information you could pass on considering the breadth of knowledge within this group. I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has ex

Re: Django in the enterprise?

2010-02-24 Thread Steven Elliott Jr
@Shawn Sorry if I was not clear with my question. It seems like a lot of sites that I have seen on djangosites are news sites, or content-driven sites like blogs, personal web pages, social networking-type sites like fluther.com, etc. I was just curious if anyone has every sat down and wrote a

Re: Django in the enterprise?

2010-02-24 Thread Steven Elliott Jr
Thank you to all for your comments. It has been most helpful. On Feb 24, 2010, at 11:05 AM, Andy McKay wrote: > > On 2010-02-24, at 6:40 AM, Steven Elliott Jr wrote: >> Right now we have Java and ASP.NET doing most of the work for us but the >> systems are old and need updati

Re: Django in the enterprise?

2010-02-24 Thread Steven Elliott Jr
@Philip Thanks for information -- very good advice. I appreciate all the input from everyone else as well. I intend to start using Django for almost everything going forward. Thanks, Steve On Feb 24, 2010, at 2:06 PM, Phlip wrote: > Steven Elliott Jr wrote: > >> Right now we h

Re: Django in the enterprise?

2010-02-24 Thread Steven Elliott Jr
y, thanks for the insight; I appreciate it. Steve On Feb 24, 2010, at 2:31 PM, Eric Chamberlain wrote: > > On Feb 24, 2010, at 6:23 AM, Steven Elliott Jr wrote: > >> Dear friends, >> I apologize for writing this type of question to the community but I would >> apprecia

Re: Admin issues

2010-04-09 Thread Steven Elliott Jr
In your urls. py make sure you have: from django.contrib import admin admin.autodiscover() and that you've uncommented the (r'^admin/', include(admin.site.urls)), in the tuple: urlpatterns = patterns. On Apr 9, 2010, at 8:44 AM, Sheena wrote: > Hey hey. I'm a little new to Django so I've bee

Re: Admin issues

2010-04-09 Thread Steven Elliott Jr
, include(admin.site.urls)), # ... ) Hope this helps! but you will still need to make sure that you have On Apr 9, 2010, at 9:13 AM, Steven Elliott Jr wrote: > In your urls. py make sure you have: > > from django.contrib import admin > admin.autodiscover() > >

Re: Admin issues

2010-04-09 Thread Steven Elliott Jr
Uncomment: #'django.contrib.sessions', make sure to import admin from django.contrib and turn admin.autodiscover() and yes, error messages would be helpful... if any. On Apr 9, 2010, at 10:32 AM, Stuart wrote: > What you have looks about right. What result are you getting? An error > message?

Re: Setting up Django on snow leopard

2010-04-09 Thread Steven Elliott Jr
Are you running the install as superuser? I am running leopard too and ran into the same problem but once you run it as: sudo python setup.py install it should work.. Also, dumb question but do you have mysql installed? Its also a good idea to put this: # mysql path PATH=${PATH}:/usr/local/mys

Re: Setting up Django on snow leopard

2010-04-09 Thread Steven Elliott Jr
Its also a good idea to install the Developer Tools ... You should check which version of Python you are using too. I think be default OS X uses 2.6.1 This is what I get when I type "python" into the terminal: Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) On Apr 9, 2010, at 11:38 AM, Lee Hi

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-09 Thread Steven Elliott Jr
I think it largely boils down (as many have said) to a python vs ruby debate. I personally hate Ruby... I think its perl with a nice syntax, its very obtuse and just downright hard to maintain as projects get bigger (IMHO, others I;m sure disagree). As far was what is better about Django for me

Re: Admin issues

2010-04-09 Thread Steven Elliott Jr
Have you looked at your db? are the tables there that you wrote in your models. Did you run python manage.py syncdb and did you see verification that your tables were created? If you want to see that the sql is being created run python manage.py sqlall app_name to make sure its generating the

Re: MySQLdb setup on snow leopard help

2010-04-12 Thread Steven Elliott Jr
Did you run the install as sudo? -Steven Elliott Jr On Apr 12, 2010, at 3:09 AM, Bdidi wrote: I reinstalled XCode to include 10.4 support and tried again, and MySQLdb is now installed, but now I get this: File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ site-pac

Re: OS X Server upgrade (10.6.3) can't load psycopg2 from apache2/modpython

2010-04-14 Thread Steven Elliott Jr
Hey John, I am running Mac OS X Server(s) as well but have not yet updated to 10.6.3 - I am going to do this now and see if it breaks anything. My apps are all running using the preinstalled version so I'm curious to see if anything breaks. Just curious -- my python version is 2.6.1 and I neve

Re: OS X Server upgrade (10.6.3) can't load psycopg2 from apache2/modpython

2010-04-14 Thread Steven Elliott Jr
Righty. Glad you got it sorted. Cheers mate -Steven Elliott Jr On Apr 14, 2010, at 5:39 PM, John Abraham wrote: It's definitely a system path / python path problem. I did the brute force method of linking psycopg to the django project directories, twice, just to be sure: cd /We

Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.
Hi Djangees, I'm trying to use Genshi templating system with Django but I'm stuck with unicode. I have a db in MySQL 5.0.38 (MySQLdb 1.2.2), the db has encoding utf8_unicode_ci, the table I'm reading data from has the same encoding and even the appropriate fields are in utf8_unicode_ci. The adm

Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.
Hi Djangees, I'm trying to use Genshi templating system with Django 0.96 but I'm stuck with unicode. I have a db in MySQL 5.0.38 (MySQLdb 1.2.2), the db has encoding utf8_unicode_ci, the table I'm reading data from has the same encoding and even the appropriate fields are in utf8_unicode_ci. Th

Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.
On Jul 9, 11:14 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 7/9/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote: > > > > ... > > Django dies with: > > Dies with... what? Sorry, accidentally pressed Enter ;-) --~--~-~--~---

Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.
On Jul 9, 11:25 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 7/9/07, Daniel Kvasnicka jr. ... > > > stream = loader.load('index.xml').generate( > > types = > > AdSpaceTyp

Re: Trying to pass data from MySQL to Genshi: how to get the data in Unicode?

2007-07-09 Thread Daniel Kvasnicka jr.
On Jul 9, 11:25 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 7/9/07, Daniel Kvasnicka jr. ... > > > stream = loader.load('index.xml').generate( > > types = > > AdSpaceTyp

prepare() on oldforms.CheckboxSelectMultipleField not working properly?

2007-07-22 Thread Daniel Kvasnicka jr.
Hi people, I've built a user registration form based on the example from Django Book (http://www.djangobook.com/en/beta/chapter12/ -- Handling Registration). I extended the form with several additional fields, two of them being CheckboxSelectMultipleFields. The problem is that after calling: err

Re: prepare() on oldforms.CheckboxSelectMultipleField not working properly?

2007-07-23 Thread Daniel Kvasnicka jr.
getlist() saved my day, thanks much :) Cheers, Dan On Jul 23, 6:57 pm, rskm1 <[EMAIL PROTECTED]> wrote: > On Jul 22, 10:16 am, "Daniel Kvasnicka jr." > > <[EMAIL PROTECTED]> wrote: > > errors = form.get_validation_errors(data) > > > which in effec

What should I do to make admin display more fields in User model?

2007-07-27 Thread Daniel Kvasnicka jr.
Hi django fellows, I scubclassed django's User model to create my own more complicated model, I set it as my AUTH_PROFILE_MODULE in settings and I also wrote my own backend to authenticate against this new class. So far no problems. However, I also overrode User's Admin class and changed the 'fie

Re: What should I do to make admin display more fields in User model?

2007-07-30 Thread Daniel Kvasnicka jr.
Hey, nobody has ever needed this? Any thoughts? Dan On Jul 27, 1:18 pm, "Daniel Kvasnicka jr." <[EMAIL PROTECTED]> wrote: > Hi django fellows, > > I scubclassed django's User model to create my own more complicated > model, I set it as my AUTH_PROFILE_MODULE

Re: What should I do to make admin display more fields in User model?

2007-07-30 Thread Daniel Kvasnicka jr.
On Jul 30, 11:56 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote: > > > Hey, nobody has ever needed this? Any thoughts? > > You might want to search the archives of this list, or go to Google >

Adding ForeignKey on self to User with add_to_class causes endless loop in the server

2007-07-30 Thread Daniel Kvasnicka jr.
Hi, in my models.py I'm tring to add some fields to User with add_to_class (so I can access them in admin). Everything works fine, only when I try to add a ForeignKey on User itself, Django dev server gets in a loop and has to be killed or it consumes every byte of memory and all processor time.

Re: Adding ForeignKey on self to User with add_to_class causes endless loop in the server

2007-07-31 Thread Daniel Kvasnicka jr.
On Jul 31, 9:30 am, "Ben Ford" <[EMAIL PROTECTED]> wrote: > I'm not sure about the mechanics of add_to_class, but usually a self > referential ForeignKey should look like: > models.ForeignKey('self', ..) > Have you tried it like this? Yes I have, and unfortunately it does the same. Cheer

Re: What should I do to make admin display more fields in User model?

2007-07-31 Thread Daniel Kvasnicka jr.
trong points. Dan On Jul 30, 6:42 pm, "Daniel Kvasnicka jr." <[EMAIL PROTECTED]> wrote: > On Jul 30, 11:56 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote: > > > > Hey, nobody

Re: XML output

2007-08-13 Thread Daniel Kvasnicka jr.
On Aug 12, 7:18 am, Alex Nikolaenkov <[EMAIL PROTECTED]> wrote: > You wrote 12 ??? 2007 ?., 1:41:39: > > > Alex Nikolaenkov <[EMAIL PROTECTED]> writes: > >> Hello guys, > >> I like just about everything in django, but at this point of me reading > >> django > >> book I can't imagine the way o

Re: XML output

2007-08-13 Thread Daniel Kvasnicka jr.
On Aug 11, 11:41 am, Alex Nikolaenkov <[EMAIL PROTECTED]> wrote: > Hello guys, > I like just about everything in django, but at this point of me reading django > book I can't imagine the way of xmlizing django. > > Is there a way to use XSLT templates instead of standard django template > languag

using re.sub with unicode string in response middleware

2008-01-06 Thread Gary Wilson Jr.
It appears that at this point, response.content is a utf8-encoded bytestring. I'm playing with a response middleware doing something like: MY_RE.sub(u'%s' % text, response.content) which raises a UnicodeDecodeError if response.content contains non-ascii. I understand that the strings need to be

Re: using re.sub with unicode string in response middleware

2008-01-07 Thread Gary Wilson Jr.
Malcolm Tredinnick wrote: > On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote: >> It appears that at this point, response.content is a utf8-encoded bytestring. >> I'm playing with a response middleware doing something like: >> >> MY_RE.sub(u'%s' %

Re: using re.sub with unicode string in response middleware

2008-01-07 Thread Gary Wilson Jr.
Malcolm Tredinnick wrote: > On Mon, 2008-01-07 at 18:28 -0600, Gary Wilson Jr. wrote: >> Malcolm Tredinnick wrote: >>> On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote: >>>> It appears that at this point, response.content is a utf8-encoded >>&g

Re: using re.sub with unicode string in response middleware

2008-01-08 Thread Gary Wilson Jr.
Malcolm Tredinnick wrote: > Hey Gary, > > On Tue, 2008-01-08 at 00:35 -0600, Gary Wilson Jr. wrote: > [...] >> So, looking at a couple places in Django trunk where response.content is >> used, >> these look like bugs: >> >> >> django.contrib

filters should throw exceptions

2008-04-21 Thread David Durham, Jr.
Hi all, I'm new to working with Django so forgive my newness. I'm reading through chapter 10 of the free online django book, and I've come across the statement that filter should silently ignore errors. I disagree with this. I think they ought to raise exceptions, and the site should be config

Re: filters should throw exceptions

2008-04-21 Thread David Durham, Jr.
On Mon, Apr 21, 2008 at 1:06 PM, Peter Rowell <[EMAIL PROTECTED]> wrote: > From http://www.djangoproject.com/documentation/templates/#variables > > If you use a variable that doesn't exist, the template system will > insert the value of the TEMPLATE_STRING_IF_INVALID setting, which is > set to

How to hack admin interface?...and should I?

2006-12-14 Thread Daniel Kvasnicka jr.
Hi djangees, I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as well and tried the tutorials. What I like about Django is (obviously) the auto-generated admin interface. However, what I need to know is how easy/difficult/deprecated/encouraged is to hack the auto-generated admin

Re: How to hack admin interface?...and should I?

2006-12-18 Thread Daniel Kvasnicka jr.
on be taken as a regular "edit" permission level? So, provided this all, is it more productive to hack that functionality to Django admin or to write a standalone app for this? Thanks, Dan On Dec 14, 5:55 pm, "va:patrick.kranzlmueller" <[EMAIL PROTECTED]> wrote: > Am 14.12.2

Re: How to hack admin interface?...and should I?

2006-12-18 Thread Daniel Kvasnicka jr.
> with the last couple of sites we did, we spent more time an "hacking" > the admin-interface than doing the actual site. > Well, that's why I'll probably stick with TurboGears for that project (I already have the admin interface almost implemented). I'll try Django with another app. Thanks for r

Re: Missing manage.py

2012-04-16 Thread Buddy Lindsey, Jr.
If you are using Django 1.4 check in the application folder of your project below your project folder. It should be in there. Faeez Abd Rahman wrote: Hi, I have a problem whenever I create a new project using the start project command, no manage.py file is created. I'm using Mac OS X. Thank

Re: Adding context data to a TemplateView?

2012-04-22 Thread Buddy Lindsey, Jr.
This should help you out with adding extra context to TemplateView http://godjango.com/15-class-based-views-part-1-templateview-and-redirectview/ Roy Smith wrote: I'm using a generic TemplateView (django-1.4), but I want to be able to add something to the context. Is that possible? The docs a

Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
I'd like to pass form data from one view to another. Here's my attempt: *#Models.py*from django import forms class Textizer(forms.Form): to_textize = forms.CharField(max_length=100) def __unicode__(self): return self.to_textize *#views.py*from textize.models import Textize

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
Okay. What? Can you explain any of the key points I was trying to understand? I don't know what I'm doing. On Thursday, August 2, 2012 9:22:40 AM UTC-4, larry@gmail.com wrote: > > On Thu, Aug 2, 2012 at 7:06 AM, Gregory Thompson Jr. > wrote: > > I'd l

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
C, and random code snippets online -- and occasionally, some outdated books. If you don't want to explain or aren't going to ask me progressive questions with regards to my confusion, please just skip over my plight. Thank you all. On Thursday, August 2, 2012 9:54:21 AM UTC-4, Da

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
27;s confusing about this? You don't explicitly create sessions, and > they last as long as they are configured to last, which by default is until > the session cookie is cleared. > > On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. < > spockthompso...@gmail.c

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
> > On Thu, Aug 2, 2012 at 9:06 AM, Gregory Thompson Jr. < > spockthompso...@gmail.com> wrote: > >> I'd like to pass form data from one view to another. >> >> Here's my attempt: >> >> *#Models.py* >> from django import forms >&g

Re: Django Development environment

2011-08-25 Thread Steven Elliott Jr
> Am 23.08.2011 00:07, schrieb Stephen Jackson: >> I am new to the world of Django. I would like to hear from other django >> developers describe their dev environment (tools, os, editors, etc.). Mac OS X Lion PyCharm and TextMate with Python competion and Django bundles Mysql & MongoDB South Pyg

Re: Django Development environment

2011-08-27 Thread Steven Elliott Jr
> On Fri, 2011-08-26 at 15:07 +0100, Simon Connah wrote: >> Mercurial or Git (depends on whether the project is open source or not) Kenneth, I think he means whether or not the repository will be public or private. Github (git) does not offer private repos unless you pay whereas bitbucket (merc

Re: Django Development environment

2011-08-27 Thread Steven Elliott Jr
On Aug 27, 2011, at 11:17 AM, Simon Connah wrote: > > On 27 Aug 2011, at 04:44, Steven Elliott Jr wrote: > >>> On Fri, 2011-08-26 at 15:07 +0100, Simon Connah wrote: >>>> Mercurial or Git (depends on whether the project is open source or not) >> >> K

Re: installing django

2011-09-13 Thread Steven Elliott Jr
What exactly is the problem? Can you provide more detail? Platform, error messages, python version? What have you tried already? On Sep 13, 2011, at 1:21 PM, re64 wrote: > I am having trouble installing django. I cant seem to do it any > suggestions > > -- > You received this message becaus

Re: Django for a large social networking or photo sharing site?

2011-11-22 Thread Steven Elliott Jr
Yes > Hello, > > [This is the first time I am using Google Groups and/or mailing lists, > so please bear with me if I do something wrong initially.] > > Is Django web framework apt for a large social networking or photo > sharing site? (Think one that has to easily and seamlessly scale to > the

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-27 Thread Steven Elliott Jr
On Jan 25, 2012, at 9:14 PM, JJ Zolper wrote: > > The keywords were 'in production'. The development server (i.e. python > > manage.py runserver) works fine under Windows. But when you want to > > make the website accessible to your audience (the internet, company > > etc.), you should host that

Re: [pinax-users] Learning Django+Pinax - Recommend books and/or tutorials?

2012-01-27 Thread Steven Elliott Jr
> > What would you recommend? > To get started with Python: http://pragprog.com/book/gwpy/practical-programming http://www.amazon.com/gp/product/1590599829/ref=pd_lpo_k2_dp_sr_3/182-5610174-4840816?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=lpo-top-stripe-1&pf_rd_r=1YTG71HMBVWK64HZ2TP2&pf_rd_t=201&pf_rd_p=486

Re: Question about Displaying a Table

2011-06-27 Thread Steven Elliott Jr
Django has about the best documentation out there foe getting started. Walk through the tutorial and see how it goes. Sent from my iPhone On Jun 27, 2011, at 2:25 PM, "Cal Leeming [Simplicity Media Ltd]" wrote: > Forgive me but, the tone of this email sounds like you are asking us to do > th

Re: how can i define a decimal_separator and a thousand_separator

2010-12-29 Thread Sergio Berlotto Jr
Use the DECIMAL_SEPARATOR, THOUSAND_SEPARATOR and NUMBER_GROUPING settings. See: http://docs.djangoproject.com/en/1.2/ref/settings/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Django's documention is horrible

2011-01-10 Thread Steven Elliott Jr
Ummm... I think thats the first time I've ever heard anyone say that django's documentation sucks. Sent from my iPhone On Jan 10, 2011, at 4:25 PM, Simon W wrote: > Hey, > For such a good web framework it's a shame that the documention is not > structured well .. at all. It consists of massi

Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Steven Elliott Jr
> Ubuntu IS Debian for all intents and purposes. Why does your boss insist that > you use a particular distro? It shouldn't really matter what your development > OS is (at least with *nix systems). Is there an existing Django application > that needs to be supported or is this a new project? >

Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Steven Elliott Jr
Why don't you try partitioning your hard drive instead and doing a dual boot installation? Also, it's Debian not Derbian. -Steve On Jan 20, 2011, at 4:59 PM, Kimberly wrote: > This is now a LINUX-Derbian problem I am experiencing. I open the > virtualbox and clicked on the Linux-Windows th

Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Steven Elliott Jr
> he is not doing dual boot - he is running linux under windows! Right, which I think is horrible and usually very slow as well; it might be better to install the Linux OS on a separate partition on the computer. I personally hate running anything in a virtual machine. I'd rather t

Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Steven Elliott Jr
> > > While I am sure we can all sympathize with confronting a technical problem > that we don't understand, this OP has the flavor of trolling perhaps. At any > rate this is the wrong list for these pleadings. I don't even see a question You're so right; I don't know why I am wasting my ti

Re: Django Improper Configuration

2011-01-23 Thread Steven Elliott Jr
I remember that the one time I tried sqlite it complained until I put a .db suffix on the name of my database. If you do not specify the full path and just specify a name, then it will just create the database file in your project's root directory. So, under name just put: 'NAME' : 'database.

Re: Django Improper Configuration

2011-01-23 Thread Steven Elliott Jr
2:35:06 PM UTC+11, Kimberly wrote: > it says that the _file_ is not defined. > > On Sun, Jan 23, 2011 at 9:28 PM, Graham Dumpleton > wrote: > > > On Monday, January 24, 2011 2:19:09 PM UTC+11, Steven Elliott Jr wrote: > Copy and Paste the following to replace yo

  1   2   >