Re: urls.py usage

2011-03-01 Thread Daniel Roseman
On Monday, February 28, 2011 7:29:17 PM UTC, Vladimir wrote: > > I only followed manuals! Please, Mr. Daniel, give me more details! Well I don't know which manuals you followed. The online documentation (http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-objects) states this

Re: urls.py usage

2011-02-28 Thread Daniel Roseman
On Monday, February 28, 2011 4:26:57 PM UTC, Vladimir wrote: > > > > That you have duplicate registration of one model in your admin.py > > somewhere (I believe, I may be wrong). > There is no admin.py file in this project. > Well, why not? That is the cause of your problem. Putting admin

Re: Comparing two annotations

2011-02-23 Thread Daniel Roseman
On Wednesday, February 23, 2011 7:28:06 PM UTC+1, Patrick wrote: > > Hi, > > i am trying to compare two count-annotations with a simple "greater- > than" filter like this: >

Re: Problem in returning the value.

2011-02-23 Thread Daniel Roseman
On Wednesday, February 23, 2011 9:10:14 AM UTC+1, cuteangel wrote: > > this is the class from models.py- > class NatPar(models.Model): > @staticmethod > def handle_review(self): > > > > and calling function is like this- > > response=NatPar.handle_review > > return

Re: Unexpected result from making single object query

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 9:35:18 PM UTC, mm wrote: > > the next field in the Entry table contain the name of the next entry > the prev field in the Entry table contain the name of the previous > entry. > > current_entry = Entry.objects.get(id=10) > > next_entry =

Re: How to format django template code nicely with notepad++?

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 8:31:43 PM UTC, mongoose wrote: > > want to get vim working with omnicomplete then perhaps i'll get into > it more. > > I've added this to my vimrc file > > filetype plugin on > set ofu=syntaxcomplete#Complete > > when i try > :python print 'hello' > i get this

Re: Satchmo Error - Invalid block tag: 'thumbnail', expected 'else' or 'endif'

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 6:22:16 PM UTC, Bobby Roberts wrote: > > Hi group. I've posted this in the satchmo group but am posting here > as well in hopes of getting some help. > > This error is caused by this code: > > {% if product.main_image %} > > {%

Re: Unexpected result from making single object query

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 8:30:27 PM UTC, mm wrote: > > I am not sure what I am doing wrong but there is my code: > > current_entry = Entry.objects.get(id=10) > > next_entry = Entry.objects.get(current_entry.next) > prev_entry = Entry.objects.get(current_entry.prev) > > where

Re: Convert a list to queryset and override the one in modelAdmin

2011-02-21 Thread Daniel Roseman
On Monday, February 21, 2011 5:47:42 PM UTC, Vinicius Massuchetto wrote: > > Hi. > > I know that's not exactly the proper way of building a queryset, but I > managed to build a list of objects of a model across operations and > annotations, and I want to show that an admin change list. > > I'm

Re: Not able to use ModelForm

2011-02-20 Thread Daniel Roseman
On Sunday, February 20, 2011 12:05:12 PM UTC, The_Legend wrote: > > Oh sorry, i thought i wrote, but i guess it didnt convey the message. > > have written a registration form. so it takes data from this form then > first creates a user then i have a model called people in my app > called

Re: Not able to use ModelForm

2011-02-20 Thread Daniel Roseman
On Sunday, February 20, 2011 11:26:18 AM UTC, The_Legend wrote: > > i am not able to use model forms to input data for models in database. > > I'd get some treatment for that, if I were you. Seriously, what problem are you having? Are we supposed to guess? -- DR. -- You received this message

Re: Problem in new Django Project- cannot import tables.

2011-02-19 Thread Daniel Roseman
On Saturday, February 19, 2011 10:52:50 AM UTC, Rohini Dhavale wrote: > > As per the tutorials I am trying to create my own project. Followed > every step up to creating database; syncdb. But in interactive shell > when trying out ' from student_cce.models import abhivyakti ' command > where

Re: Django administration - Allow full HTML for a TextField form

2011-02-19 Thread Daniel Roseman
On Saturday, February 19, 2011 3:04:27 PM UTC, NewNumOrder wrote: > > I've tried enabling 'allow_tags' for a TextField, but the admin tools > still encode the text when inserting or updating rows. > > Is the following code correct? > some_field = models.TextField() > some_field.allow_tags =

Re: Admin - click through to parent / child

2011-02-18 Thread Daniel Roseman
On Friday, February 18, 2011 5:02:43 PM UTC, Alec wrote: > > Thanks for the ideas, but those projects are more for arbitrary > relationships. I'm thinking about just extending the basic > functionality of the admin site like in this image: > > http://i53.tinypic.com/16h10m0.png > If you

Re: Messages framework is not showing messages in my templates

2011-02-18 Thread Daniel Roseman
On Friday, February 18, 2011 10:56:54 AM UTC, Gabriel Prat wrote: > > Hi all, I'm trying to use messages framework, I've checked that > middleware, context processor and app is well configured (I'm running > django development version which a standard manage.py startproject > includes all

Re: how to get attribute of intermediary model?

2011-02-17 Thread Daniel Roseman
On Thursday, February 17, 2011 10:06:40 PM UTC, Margie Roginski wrote: > > Thanks for your reply, Daniel. I didn't give my example specifically > enough. In my particular case I actually have a handle to the Person > and actually don't need all the join dates for all the people in that >

Re: Importing modules in code

2011-02-17 Thread Daniel Roseman
On Thursday, February 17, 2011 6:37:56 AM UTC, lawgon wrote: > > On Wed, 2011-02-16 at 02:12 -0800, Daniel Roseman wrote: > > Your question betrays a misconception that I often see. Django - at > > least > > when served other than via CGI - does not reload everythi

Re: Importing modules in code

2011-02-16 Thread Daniel Roseman
On Wednesday, February 16, 2011 8:38:40 AM UTC, galago wrote: > > Is it a good idea to import modules in the middle of the code, and not on > the beginning? > I want to make a hash generation. It's few lines - it's used once in all > application. Should I import hashlib just on the beginning of

Re: chrome extension

2011-02-16 Thread Daniel Roseman
On Wednesday, February 16, 2011 5:34:42 AM UTC, Tony wrote: > > Should I assume that this was a silly question? > > No, just that no-one who knows the answer has been around since you posted it. I've never written a Chrome extension but I suspect they have no network access and can only store

Re: how to get attribute of intermediary model?

2011-02-16 Thread Daniel Roseman
On Wednesday, February 16, 2011 12:36:49 AM UTC, Margie Roginski wrote: > > Say I am using an intermediary model like that in the doc: > > class Person(models.Model): > name = models.CharField(max_length=128) > > class Group(models.Model): > name = models.CharField(max_length=128) >

Re: Accessing the HttpRequest object from a model

2011-02-15 Thread Daniel Roseman
On Tuesday, February 15, 2011 8:05:31 PM UTC, jonas wrote: > > Thanks for your reply. But I found out about save_model(). > From there I have access to the HttpRequest object that contains my > contrib.auth.models.User model. > > But that seemed to be half the story. > > class

Re: AW: AW: Form to add data

2011-02-15 Thread Daniel Roseman
On Monday, February 14, 2011 1:59:08 PM UTC, Szabo, Patrick (LNG-VIE) wrote: > > > Now i did exclude certain fields in my form because i have to set them > automaticaly. > Eg. I have a field that's called Mitarbeiter. I want to set the field to > the current user id so i've tried this: > >

Re: Form to add data

2011-02-14 Thread Daniel Roseman
On Monday, February 14, 2011 12:42:48 PM UTC, Szabo, Patrick (LNG-VIE) wrote: > > Hi, > > How do i add a form to a template/view that let’s me add a Databaseentry. > > I also want to list all the entries from a certain table in on the same > site. > > Now I’m reading the documentaion and it

Re: Django ORM queryset problem

2011-02-13 Thread Daniel Roseman
On Sunday, February 13, 2011 12:48:25 PM UTC, ezorro wrote: > > Hi django users! > > I have two simple models: Person and Address. > > class Person(models.Model): > first_name = models.CharField(max_length=64, blank=True, default='') > last_name = models.CharField(max_length=64, blank=True,

Re: csrf cookie security

2011-02-10 Thread Daniel Roseman
On Thursday, February 10, 2011 4:48:05 PM UTC, Brian Craft wrote: > > I'll have to look at this in more detail, but two notes, off-the-top. > > First, port 80 is kept open because the browser will try port 80 if > the user types in the url without the protocol. On port 80 all we do > is issue a

Re: now template tag and predefined format DATE_FORMAT problem

2011-02-10 Thread Daniel Roseman
On Thursday, February 10, 2011 4:04:14 PM UTC, creecode wrote: > > On Feb 9, 9:17 am, Daniel Roseman <dan...@roseman.org.uk> wrote: > > It would be worth raising a ticket for this. > > Done! < http://code.djangoproject.com/ticket/15267 >. > > Toodle-l

Re: filesizeformat in a view

2011-02-10 Thread Daniel Roseman
On Thursday, February 10, 2011 3:46:01 PM UTC, refreegrata wrote: > > Hello list, I have a question. I want to assign the size of a file to > a var in the view, but the value must to be formated in a human- > readable file size. This is for a PDF report. In a template I can be > used the filter

Re: AW: Current user

2011-02-10 Thread Daniel Roseman
On Thursday, February 10, 2011 2:27:15 PM UTC, Szabo, Patrick (LNG-VIE) wrote: > > I imorted from django.contrib.auth.models import User but when i do > > Mitarbeiter = request.user.id > > It tells me that NameError: name 'request' is not defined > > What am i doing wrong ?! > The first thing

Re: models.CharField.null=True ignored

2011-02-10 Thread Daniel Roseman
On Thursday, February 10, 2011 10:19:49 AM UTC, Roman Klesel wrote: > > Hello community, > > I'm using a django version 1.3 beta 1 SVN-15481 and a mysql 5 backend > > I have the following field definition in my model: > > class Jtem(models.Model): > name=models.CharField(blank=True, null=True,

Re: Best forum/group for Django Help

2011-02-10 Thread Daniel Roseman
On Wednesday, February 9, 2011 9:06:54 PM UTC, SimpleDimple wrote: > > Guys, Need to know which is the best forum/group for Django help ? I > thought this is the one but I don't see much activity here despite of > the fact that there are 19000+ members...where do you go for > discussing your

Re: Django new install system path

2011-02-09 Thread Daniel Roseman
On Wednesday, February 9, 2011 8:04:43 PM UTC, Tomasz Łopusiewicz wrote: > > Hello i have installed mod_python and django in my home/mysite but > when i run localhost/mysite i give back this: > > Don't try and run before you can walk. You're completely new to Django, so there's no point in

Re: now template tag and predefined format DATE_FORMAT problem

2011-02-09 Thread Daniel Roseman
On Wednesday, February 9, 2011 3:31:53 PM UTC, creecode wrote: > > Hello all, > > I'm trying to use the now template tag < > http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#now > > with the predefined format DATE_FORMAT and the now tag seems to be > processing the predefined

Re: Looking for IDE + FTP

2011-02-08 Thread Daniel Roseman
On Tuesday, February 8, 2011 8:30:54 PM UTC, Karen McNeil wrote: > > I have three Django sites that I've been working on recently and I've > been doing most of the development work in Dreamweaver. I don't use > any of the wysiwyg features (or, pretty much, any of the Dreamweaver > program

Re: where is a mistake in radio buttons

2011-02-08 Thread Daniel Roseman
On Tuesday, February 8, 2011 7:18:59 PM UTC, gintare wrote: > > > *.html > > > {% csrf_token %} > > > starts value="rstartsLkIn" > ends TD> > contains value="rcontainsLkIn" checked > equal value="requalLkIn" > > > # >

Re: Getting value from session in ModelForm

2011-02-08 Thread Daniel Roseman
On Monday, February 7, 2011 8:27:55 PM UTC, SimpleDimple wrote: > > I am new to Django and building a school system but am an experienced > developer otherwise having firm grip over rails, .net, php & java. > > I have the following class where on teacher add/edit form, I am trying > to filter

Re: Submitting Django forms with AJAX

2011-02-04 Thread Daniel Roseman
On Friday, February 4, 2011 1:41:36 AM UTC, mf wrote: > > I want to have a little feedback form in one of my views but I can't > get it to work. I put a pdb.set_trace() to debug the views but when I > click submit the view reloads and never gets into the if > request.method == 'POST' and...

Re: No POST response when using checkbox form

2011-02-04 Thread Daniel Roseman
On Friday, February 4, 2011 9:24:48 AM UTC, Daniel Roseman wrote: > > On Friday, February 4, 2011 12:35:20 AM UTC, Ethan Yandow wrote: >> >> Hey there, I am trying to delete Events as chosen by a by a user using >> check boxes to check of which events they want to be de

Re: No POST response when using checkbox form

2011-02-04 Thread Daniel Roseman
On Friday, February 4, 2011 12:35:20 AM UTC, Ethan Yandow wrote: > > Hey there, I am trying to delete Events as chosen by a by a user using > check boxes to check of which events they want to be deleted. But for > some reason whenever I call request.POST.get('event_list') Nothing is > received

Re: Error: cannot import name SpooledTemporaryFile

2011-02-03 Thread Daniel Roseman
On Thursday, February 3, 2011 6:55:56 PM UTC, b...@live.se wrote: > > Hi all , I install dionaea on my Debian 5.0 (VM) > when i run carniwwwhore : > > debian:/opt/carniwwwhore# python manage.py runserver > Error: cannot import name SpooledTemporaryFile > > debian:/opt/carniwwwhore# python

Re: Modifying form values before redirect

2011-02-03 Thread Daniel Roseman
On Thursday, February 3, 2011 2:09:56 AM UTC, Osiaq wrote: > > Hi all! > I'm receiving the form from index.html and redirecting to order.html > I would like to change "customer" value before redirection. > When I try to modify it, Im getting "object does not support item > assignment" > How

Re: Using custom / Extending default Request Object

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 8:38:58 PM UTC, Tereska wrote: > > My RequestObject must contain information about user device (mobile, > tablets etc) with device capatibilites (resolution, video codecs > etc) . > It's a data collection not simple string. Then I want use it in views > and

Re: Using custom / Extending default Request Object

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 8:12:30 PM UTC, Tereska wrote: > > I have to extend HttpRequest class and be able to use it in views > (request argument in each view must be instance of MyHttpRequest > class) > > How to do that? (without extending BaseHandler) > > Why do you need to do this?

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: > > Hi! > I have a plugin style app that adds "support" for PHP (inserting two > admin inlines) into VirtualHostAdmin class, I use this code for the > job: > > admin.site.unregister(VirtualHost) > ix =

Re: method being called twice?

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 2:27:16 PM UTC, Burhan wrote: > > Hello, I have a strange problem which I am unable to figure out. > > I have a method that is POSTed some information from a third-party > payment gateway. The request is sent to payment-result.jsp? > PaymentID=342 (where 342 is

Re: Django model object allocation performance

2011-02-02 Thread Daniel Roseman
On Tuesday, February 1, 2011 11:52:49 PM UTC, oyiptong wrote: > > Hello, > > I have been seeing a big performance degradation with my application > in production. > The traffic is roughly 2.5K pageviews per day. I can expect each page > to load 100 model objects in memory. > > Some might

Re: blank ModelMultipleChoiceField, sort a ManyToManyField that is allowed to be blank

2011-02-01 Thread Daniel Roseman
On Tuesday, February 1, 2011 9:45:04 AM UTC, Santiago Caracol wrote: > > Hi, > > why can't a ModelMultipleChoiceField not have the property > "blank=True"? > > I need the ModelMultipleChoiceField to sort the values of a > models.ManyToManyField in a form class. Sorting works as expected, but

Re: ImportError importing forms.py into models.py

2011-02-01 Thread Daniel Roseman
On Monday, January 31, 2011 11:34:48 PM UTC, Jeffrey Stiles wrote: > > I would really like to make a form instance a model attribute so that > i have access to the form from the template through an object that I > have handy. > > When I try to import import any form into models.py, I get an >

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Daniel Roseman
On Monday, January 31, 2011 3:06:29 PM UTC, Ivan Uemlianin wrote: > > Dear Tom > > Thanks for your comment. > > My use case is a "presence"-type system. When a user logs out their > status change is sent out to all other logged-in users (using comet). > If they just close the browser this

Re: django and mysql connection problem

2011-01-31 Thread Daniel Roseman
On Monday, January 31, 2011 2:45:55 PM UTC, cuteangel wrote: > > > its my first project with django..i already tried the connection with > sqlite.but now m using django's connection with mysql n m getting > following error... > > D:\project\wogma>manage.py syncdb > Traceback (most recent call

Re: Dynamic ModelForm fields

2011-01-30 Thread Daniel Roseman
On Sunday, January 30, 2011 6:01:00 PM UTC, a.esmail wrote: > > Hello, > I tried my best with no luck. > Here are the relevant code snippets: > > > > # > Item form: > class ItemForm(forms.ModelForm): > def __init__(self, fields_list,

Re: simplest for example, Error object has no attribute 'cleaned_data'

2011-01-30 Thread Daniel Roseman
On Sunday, January 30, 2011 8:02:08 AM UTC, gintare wrote: > Is it possible by making small change to resolve the error below: > (I did not yet finished reading all manual, maybe the error disappears > if i make custom code for every line in the model, but my model has > over 30 fields thus i

Re: Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Daniel Roseman
On Saturday, January 29, 2011 12:28:49 PM UTC, Victor Hooi wrote: > > Hi, > > I'm trying to use list_display in the django-admin, and I can't seem to > find a way to get list_display to follow FK links. > > My models.py: > > class Site(models.Model): > name = models.CharField(max_length=50,

Re: Custom ModelAdmin form for distinct logged users

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 12:22:04 AM UTC, Mario8k wrote: > > Hello, > > How can I customize a form by the user who is logged in? > For example, if the user is_superuser(), i need to display the > standard admin form, but if the user is another one, show only some > fields and not all model

Re: request.POST parsing without form

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 7:05:21 PM UTC, taso wrote: > > Hi, > > I am using django strictly as a backend for data processing. As such I > am not using any forms or templates, just database tables as models. > The page is js driven and POSTing data is causing me some issues. > > A user

Re: weird behavior in select_related

2011-01-28 Thread Daniel Roseman
On Saturday, January 22, 2011 1:38:22 PM UTC, maraujop wrote: > > Hi everyone, > > I have been working on reducing DB queries in my project with great > results. But I have realized that select_related in one of my models doesn't > preload all the ForeignKeys and OneToOneFields, it preloads 3

Re: Adding an App to the Admin

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 3:09:34 AM UTC, kb1pkl wrote: > > I'm following the tutorial at [1]. I'm trying to add the app to the > admin site. I've run manage.py syncdb, and I've restarted the dev > server. Any hints? The appropriate files that I was instructed to modify > can be seen at [2].

Re: abstract base class and overwriting save()

2011-01-28 Thread Daniel Roseman
On Friday, January 28, 2011 9:21:48 AM UTC, Jaroslav Dobrek wrote: > > Hi, > > if I have got several models that have identical code, except for > their save method, how can I use an abstract base class for them? Will > I have to overwrite save() for each model? Or is there a generic way > to

Re: account errors when create superuser on cygwin

2011-01-27 Thread Daniel Roseman
On Thursday, January 27, 2011 6:42:29 PM UTC, maki maki wrote: > > hi, > > I execute the command: python manage.py createsuperuser -- > username=jack --email=ja...@f.com > > and an error occurred: > > Traceback (most recent call last): > File "manage.py", line 11, in > > File

Re: File Uploads Form Field "title" Questions

2011-01-27 Thread Daniel Roseman
On Thursday, January 27, 2011 3:53:57 PM UTC, hank23 wrote: > > I'm trying to code and implement a file upload screen. I've looked at > the documentation at: > > http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/ > > and the document shows a simple upload form called UploadFileForm

Re: Django: Object Oriented or Relational Database?

2011-01-26 Thread Daniel Roseman
On Wednesday, January 26, 2011 11:41:10 AM UTC, aid wrote: > > > Hi, > > I'm creating a DB using Django for managing our companies data - customers, > services, orders, billing etc. I'm using the Django admin interface to > manage the data. > > I seem to be consistently at odds with myself and

Re: what am I doing wrong?

2011-01-25 Thread Daniel Roseman
On Tuesday, January 25, 2011 5:41:35 PM UTC, MikeKJ wrote: > > > class CertForm(forms.Form): > agree = forms.BooleanField(required=True, label="I confirm the above > and > agree.") > cert = forms.BooleanField(required=False, label="I require a > certificate") > > class

Re: Getting hold of an instance of a model from inside RelatedManager

2011-01-25 Thread Daniel Roseman
On Tuesday, January 25, 2011 3:34:03 PM UTC, kmpm wrote: > > I have some issues with getting hold of the instance of a Model to which a > RelatedManager got contributed to. > Is that at all possible and if so, how? > > From *my_method* below I can get hold of the model *RelatedStuff* by >

Re: [OT]Code Review As a Service

2011-01-25 Thread Daniel Roseman
On Tuesday, January 25, 2011 9:42:59 AM UTC, Venkatraman.S. wrote: > > Hi, > > I was wondering whether there any freelancers/companies who offer > code-review as a service. > IMHO, a code review helps in almost all occasions, but the faced paced life > seems to have > put this in the back

Re: hidden widget in form still appears.

2011-01-24 Thread Daniel Roseman
On Monday, January 24, 2011 5:06:53 PM UTC, shofty wrote: > > I realise i might be touching on something old here since i think i've > found a bug submission on it, but that only talks about in the > admin... > > > so this is my declaration of a form field... > > fields = { 'xxx_venue' : >

Re: In Apache Configuration, What Replaces mod_python

2011-01-24 Thread Daniel Roseman
On Monday, January 24, 2011 3:10:17 PM UTC, octopusgrabbus wrote: > > I'm trying to reconfigure to mod_wsgi and am wisely starting with a > workstation. > > What changes in this line which is in full context below: > PythonHandler django.core.handlers.modpython > > modpython changes, but to

Re: Adding to admin logic

2011-01-24 Thread Daniel Roseman
On Sunday, January 23, 2011 7:45:04 PM UTC, Tom Wieland wrote: > > Hello, > > I am trying to get the company that I work at to use Django and Python > for future webdevelopment (whereas now that is done with PHP). We have > lots of different customers with lots of different website needs so > the

Re: Adding a new collapsed form in Flatpages

2011-01-22 Thread Daniel Roseman
On Saturday, January 22, 2011 6:57:46 PM UTC, TheRedRabbit wrote: > > Im getting this error when I run syncdb: > > Error: One or more models did not validate: > flatpages.flatpage: Accessor for m2m field 'sites' clashes with > related m2m field 'Site.flatpage_set'. Add a related_name argument

Re: ModelForm changing default field for ForeingKey

2011-01-22 Thread Daniel Roseman
On Friday, January 21, 2011 11:58:36 PM UTC, jonas wrote: > > Hello, > > I'm creating a subset of a ModelForm. > > class FavArtistForm(ModelForm): > class Meta: > model = FavArtist > fields = ('artist',) > widgets = { > 'artist': CharField(), > }

Re: how create an action in admin for single object?

2011-01-21 Thread Daniel Roseman
On Friday, January 21, 2011 1:03:12 PM UTC, Ivo Brodien wrote: > > How can I create an action for an object in the change list? > > At the moment, I created an admin action with an intermediate page and I am > only selecting on object, but that is not nice and too complicated for the > workflow.

Re: Server side Python API with PHP

2011-01-21 Thread Daniel Roseman
On Friday, January 21, 2011 11:51:04 AM UTC, SleepyCal wrote: > > Yeah, but this is for server side only, so the internal webapps can talk to > each other. > > I guess the main question is, would a message queuing systems (such as > rabbitmq) combined with AMQP be more appropriate for these

Re: templates - pulling child templates

2011-01-21 Thread Daniel Roseman
On Friday, January 21, 2011 12:08:57 PM UTC, km wrote: > > Hi all, > > I am trying to display a parent django template (base.html) with a view > function called "base" like this: > > def base(request): >return render_to_response('base.html') > > The base.html gets displayed in the

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Daniel Roseman
On Wednesday, January 19, 2011 11:07:04 PM UTC, scabbage wrote: > > How do I add CSRF token to curl then? > > What if I wanna expose my views as web services without providing a > UI, how do I make sure clients (e.g. Ajax, actionscript, etc) can use > it without this CSRF issue? > > > Thanks.

Re: following ManyToManyField related objects

2011-01-17 Thread Daniel Roseman
On Monday, January 17, 2011 3:33:36 PM UTC, ranadave wrote: > > Hi, > > Thanks for the reply. I am using an old version of Django so maybe they > got rid of it. > > What I have found out is that the object is found if I explicitly define a > through table. > > ie: > > zzz =

Re: override save()

2011-01-17 Thread Daniel Roseman
On Monday, January 17, 2011 2:24:39 PM UTC, Santiago Caracol wrote: > > Hello, > > I have got a model called ContentClassifier which uses regular > expressions to classify the content of messages. It has a method > compile() that compiles an instance's regular expressions into > self.posrx.

Re: compiled methods

2011-01-16 Thread Daniel Roseman
On Sunday, January 16, 2011 9:24:49 AM UTC, Santiago Caracol wrote: > > Hello, > > is there such a thing as "compiled methods" in Django i.e. methods > whose return value is calculated only once and then stored? Or is > there a canonical Djangoish way to implement this? > > An example: > >

Re: Django Screen Errors

2011-01-14 Thread Daniel Roseman
On Thursday, January 13, 2011 7:30:56 PM UTC, hank23 wrote: > > I have a screen which displays just fine the first time in, however > when I knowingly submit the page without entering data in all of the > fields to cause an error the page loses some of the data and controls. > I'm sure my

Re: Problem with getting Sqlite running

2011-01-13 Thread Daniel Roseman
On Thursday, January 13, 2011 4:30:44 PM UTC, Chen Xu wrote: > > Hi: Django users: > This is my first time to install Django on my unix system, and trying to > get my Sqlite running. > After I downloaded pysqlite-2.6.0, and run this command: > > python setup.py build_static install > > It gives

Re: Inlining a reverse foreign key relationship in django admin

2011-01-12 Thread Daniel Roseman
On Thursday, January 13, 2011 12:51:35 AM UTC, Viktor Kojouharov wrote: > > Hi, > > Consider the following models: > > class Foo(models.Model): >name = models.CharField(max_length=100) > > class Bar(models.Model): >name = models.CharField(max_length=100) >city = models.ForeignKey(Foo)

Re: Help with a somewhat complex reverse ForeignKey lookup.

2011-01-12 Thread Daniel Roseman
On Wednesday, January 12, 2011 2:04:28 PM UTC, Peter wrote: > > If I have a couple of models like these (just an example) > > class Parent(models.Model): > name = models.CharField(max_length=100) > > class Gender(models.Model): > name = models.CharField(max_length=100) > > class

Re: Help with Imagefile

2011-01-12 Thread Daniel Roseman
On Wednesday, January 12, 2011 6:11:27 AM UTC, nlub...@gmail.com wrote: > > hello, i have a very simple question. its about imagefiles > > my model > class Usuario(models.Model): > ImagenEmpresa = models.ImageField(upload_to = 'perfil/', > null=True) > > my template >

Re: Admin ignores null=True in ForeignKey

2011-01-10 Thread Daniel Roseman
On Monday, January 10, 2011 8:22:01 PM UTC, David Walker wrote: > > If I create a ForeignKey relationship between two Models with null=True, > the Admin seems to still insist on there being a foreign object to link to. > > For example, I created a very simple ForeignKey relationship from Things

Re: Screen/Form/View Problem?

2011-01-10 Thread Daniel Roseman
On Monday, January 10, 2011 2:56:42 PM UTC, hank23 wrote: > > This is my first attempt at trying to code a form and use it in a > view, so I've probably got something wrong. At this point I just > wanted to produce the screen with all of the fields displayed on it, > just to see if I have

Re: Model Manager filtering on Boolean causing IntegrityError

2011-01-09 Thread Daniel Roseman
On Sunday, January 9, 2011 6:40:17 PM UTC, Shantp wrote: > > I am using a Manager on a model based on a Boolean field to filter the > objects displayed on the site while showing all objects in the admin > unfiltered. The idea is that user's are submitting Locations but I do > not want them to

Re: Generalizing functions in views.py?

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 5:19:10 PM UTC, Joe0418 wrote: > > > Greetings! > > I've been spending the past few weeks learning django and love it! I'm > running into a snag though... > > I'm using just one template for all my toying right now, and it has a few > sections in it that looks something

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 4:05:27 PM UTC, hank23 wrote: > > Another question about forms. So the form name or names that I pass in > the dictionary to the response can also be named anything and aren't > required to be of a specific form name format right? > Yes, that's correct. There's no

Re: How do I Bind a Form choice Field?

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 4:47:43 PM UTC, ShawnMilo wrote: > > On 01/07/2011 11:33 AM, hank23 wrote: > > I want to code a form which will have a choice field which I want to > > have rendered as a dropdown box in my html file. How do I code the > > choices parameter in the form definition to bind

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 3:38:10 PM UTC, hank23 wrote: > > So then when using a form do I code it something like this then: > > > return render_to_response('contact.html', { > 'form': form, > my_data_dictionary, > context_instance=RequestContext(request)) > > }) > > > I ask

Re: render_to_response format using forms

2011-01-07 Thread Daniel Roseman
On Friday, January 7, 2011 3:15:33 PM UTC, hank23 wrote: > > In the topics forms documentation there's an example of using a form > in a view which shows a return statement using a render_to_respone > shortcut like this: > > return render_to_response('contact.html', { > 'form': form, >

Re: clever 404 pages

2011-01-06 Thread Daniel Roseman
On Thursday, January 6, 2011 11:45:20 AM UTC, shofty wrote: > > has anyone ever written or read an article on creation of clever 404 > pages in django sites? > > i'd like to know if its possible to capture the url requested and > maybe push back a quick search on the terms in the url, rather

Re: Having a tough time getting started with Django

2011-01-05 Thread Daniel Roseman
On Wednesday, January 5, 2011 4:00:02 PM UTC, Cowdawg wrote: > > OK: Trying to get a handle on getting started with Django and like I > always do when learning a new environment I've dived in head first. > > Here is an error message I'm getting. > > pe...@slcjwebapp0:~/agilitystewards$ python

Re: Japanese Text Sort Order

2011-01-05 Thread Daniel Roseman
On Wednesday, January 5, 2011 8:31:02 AM UTC, James Hancock wrote: > > I have a site I am working on where the main language is Japanese. > When I tried to order the fields in my form on > http://goeigo.org/loc/tokyo/nakano/ by their Japanese name, it doesn't put > them in the right order. It

Re: Using A Form

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 8:55:50 PM UTC, hank23 wrote: > > I'm in the process of coding a new screen which I want to use a form > on. I'm also currently coding the new form to go with it. The screen > will have a dropdown box, a conditional textbox, and a submit button, > as well as some

Re: Custom queryset on a ModelForm field

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 7:42:16 PM UTC, mrmclovin wrote: > > Hi, > > I have a 'project' model > > class Project(models.Model): > title = models.CharField(max_length=100) > links = models.ManyToManyField('Link', related_name='link') > > and a 'link' model > > class Link(models.Model): >

Re: form handling in views.py

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 6:31:30 PM UTC, gintare wrote: > > Maybe smbd could give advice how data submitted from custom.html to > views.py are handled further? > > > custom.html with method search1 ## > > > {% if Lp %} > {% for item in Lp %} > > > > >

Re: ImportError cannot import name DetailView

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 3:07:58 PM UTC, Anthony Pearce wrote: > > While completing "Writing your first Django app, part 4", I ran into > an error. I have almost completed the online tutorial, but using the > code verbatum, I get this error. I even went as far as to cut and > paste the code,

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-03 Thread Daniel Roseman
On Tuesday, January 4, 2011 3:54:25 AM UTC, Chris Seberino wrote: > > How configure Django to handle /books URL and yet allow access to PDFs > and images in subdirs of /books? > > Specifically, I want /books to be a dynamic page with lots of links to > PDFs and images of book covers contained

Re: Some problem with modelform save

2011-01-03 Thread Daniel Roseman
On Monday, January 3, 2011 9:25:00 PM UTC, robos85 wrote: > > I use modelform. All works fine. Validation is ok and I want to save my > form. Before saving I need to populate user_id into my modelform so i make > something like this: > if form.is_valid(): > > obj = form.save(commit=False) > >

Re: Unable to import middleware class 'facebook.djangofb.FacebookMiddleware' with uncaught exception

2011-01-03 Thread Daniel Roseman
On Sunday, January 2, 2011 11:23:30 PM UTC, PJ wrote: > > Disclaimer: I'm new to Django and system administration, though a C++ > developer. > > following the tutorial on: > http://uswaretech.com/blog/2009/02/how-to-build-a-facebook-app-in-django/ > I get everything set up. In my settings.py,

Customize the admin look and feel

2011-01-02 Thread Daniel Roseman
The directions seem quite clear. What have you set TEMPLATE_DIRS to in settings.py? It goes in there. -- DR -- 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...@googlegroups.com. To unsubscribe

Re: Efficient Grouping of Database Query

2010-12-28 Thread Daniel Roseman
On Monday, December 27, 2010 7:33:42 PM UTC, greg wrote: > > Hi, I'm trying to render a page with a table of records. > > Each entry in the table is a 'Lift' which I need grouped by > weight_class and then only the top result for each lift shown. > > So far example if I have something like this

<    3   4   5   6   7   8   9   10   11   12   >