Re: Password Reset Problem

2011-06-13 Thread Daniel Roseman
On Monday, June 13, 2011 4:18:38 PM UTC+1, Jeremiah Malina wrote: > > Hello, > > I'm a bit new to django but I thought I had a grasp on things until I > encountered this bug: > > Template error: > In template /Users/jmalina/Sites/mysite/templates/account/ >

Re: ImportError at /admin/

2011-06-13 Thread Daniel Roseman
On Monday, June 13, 2011 1:25:40 PM UTC+1, Gagan (GPS) wrote: > > This is the urls.py with the admin bits uncommented from the default > urls.py file. > No it isn't. Somehow you have copied the skeleton urls.py from django/conf/project_template/. You should use django-admin.py startproject to

Re: ImportError at /admin/

2011-06-13 Thread Daniel Roseman
On Monday, June 13, 2011 11:56:18 AM UTC+1, Gagan (GPS) wrote: > > I am having some difficulty accessing the admin of a project I am > trying to create. > > My urls.py is the default with admin enabled: > > from django.conf.urls.defaults import patterns, include, url > > from django.contrib

Re: manage.py runserver giving error!!

2011-06-13 Thread Daniel Roseman
On Monday, June 13, 2011 10:15:49 AM UTC+1, Gagan (GPS) wrote: > > I am using sqlite3. > > The database settings are as follows: > > DATABASES = { > 'default': { > 'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'mysql', > 'sqlite3' or 'oracle'. > 'NAME': 'database.db',

Re: manage.py runserver giving error!!

2011-06-13 Thread Daniel Roseman
On Monday, 13 June 2011 09:42:45 UTC+1, Gagan (GPS) wrote: > > I am using Ubuntu 11.04 and I had recently installed Django by using > svn and creating a hard link of the Django folder to the appropriate > python folder. When I tried to create a new project, It created the > project easily but

Re: ImageField issue

2011-06-08 Thread Daniel Roseman
On Wednesday, 8 June 2011 20:40:35 UTC+1, Greg Donald wrote: > > I have a model EventType that has an ImageField named image. > > When I post my image upload form I can upload an image with no problems. > > > But when I try to save() an image from the file system I get the error: > > 'str' object

Re: Need some help with MySQL and on OSX

2011-06-06 Thread Daniel Roseman
On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: > > Anyone have any good documentation on getting django with MySQL on OSX > out there? > > Cheers! > Kolbe Just use Homebrew[1]. There's no reason to do it any other way. [1]: https://github.com/mxcl/homebrew -- DR. -- You

Cleaned Data Different Access?

2011-06-02 Thread Daniel Roseman
What makes you think that? .get() is a dictionary method. It's just useful when you're not sure the specific key exists, which is the case in the general clean() method. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this

Re: Contact us form

2011-06-01 Thread Daniel Roseman
On Wednesday, 1 June 2011 08:01:33 UTC+1, Pulkit Mehrotra wrote: > > I am trying to make a contact us form which will send a mail to me using > the smtp server .It will load the thank you page after form submission > .Everything is working something ,the thank you page is loading and i am not >

Re: getting 'NoneType' object is unsubscriptable errors

2011-06-01 Thread Daniel Roseman
On Wednesday, 1 June 2011 08:48:13 UTC+1, saureen adani wrote: > > > Hi, > > I am getting the following errors on some of the web pages > > --- > > 'NoneType' object is unsubscriptable > > Request Method: GET > Request URL: >

Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread Daniel Roseman
On Tuesday, 31 May 2011 15:20:11 UTC+1, snfctech wrote: > > Thanks, Jayapal. > > I was hoping there was a little less java/ more django way to do this > by utilizing a Django ModelForm or InlindeFormSet and rendering > partial views. > > So am I missing the point of InlineFormSets? Can these

Re: How to get user object from RequestContext?

2011-05-30 Thread Daniel Roseman
On Monday, 30 May 2011 18:07:16 UTC+1, MrMuffin wrote: > > How do I get the user related to the current request in templatetag? > Using RequestContext? > > @register.tag(name='sometag') > def sometag(parser, token): > try: > tagname, model_inst = token.split_contents() > except

Re: Django Admin static base.css ignored

2011-05-27 Thread Daniel Roseman
On Friday, 27 May 2011 20:04:03 UTC+1, Lee wrote: > > I've customized myproject/static_files/admin/css/base.css but my > customizations are ignored. If I make changes to /usr/lib/python2.4/ > site-packages/django/contrib/admin/media/css/base.css it works fine. > I've double-checked the STATIC

Re: Not sending session cookies until login.

2011-05-26 Thread Daniel Roseman
On Thursday, May 26, 2011 4:47:10 PM UTC+1, Eric Hutchinson wrote: > > I'm sure by now everyone's seem the total freak out over the uk cookie > law. (http://blog.silktide.com/2011/05/cookie-law-makes-most-uk- >

Re: Form validation

2011-05-26 Thread Daniel Roseman
On Thursday, May 26, 2011 4:50:17 PM UTC+1, Nikhil Somaru wrote: > > Apologies for the font. > > Would you guys mind elaborating how I would re-display the form, with the > validation errors? I am trying to follow the print version of the > Djangobook, and it's been brilliant up to this point.

Re: Trouble with "event_set" syntax

2011-05-26 Thread Daniel Roseman
Almost - the `get_latest_by` attribute goes in the inner Meta class. class Event(models.Model): ... class Meta: get_latest_by = 'date' Also note you have to quote the name of the field. -- DR. On 25 May 2011 16:41, Gchorn wrote: >

Re: where is 'request' as in from x import y

2011-05-26 Thread Daniel Roseman
On Thursday, May 26, 2011 12:52:28 PM UTC+1, MikeKJ wrote: > > > Is this really only available to a view? All I want is to know is the auth > user id currently logged in so I can save it into another model, has to be > in the model so it is part of the admin save method You can't access

Re: Form validation

2011-05-26 Thread Daniel Roseman
On Thursday, May 26, 2011 11:18:39 AM UTC+1, Nikhil Somaru wrote: > > Hi all, > > I am testing the form validation. When I try and submit an empty form, I > get: > > ValueError at /contact/ > > The view djangobook.contact.views.contact didn't return an HttpResponse > object. > > > #

Re: How do you organize your deployment enviroment

2011-05-25 Thread Daniel Roseman
On Wednesday, May 25, 2011 1:22:40 PM UTC+1, jonas wrote: > > I'm just wondering how you could handle database changes. > > Let's say you have a existing working project and the client asks for some > changes. > > These changes force you to create an extra table and modify some tables >

Re: Synchronize method or model field access

2011-05-25 Thread Daniel Roseman
On Tuesday, May 24, 2011 9:52:58 PM UTC+1, Etam wrote: > > Hi, > > how do you synchronize a method (or model field access) in Django? > > It doesn't work: > > from multiprocessing import Lock > change_status_lock = Lock() > def change_status(self, status): > self.change_status_lock.acquire() >

Re: Trouble with "event_set" syntax

2011-05-24 Thread Daniel Roseman
On Tuesday, May 24, 2011 1:51:30 PM UTC+1, Gchorn wrote: > > Hi All, > > I'm trying to create a website that aggregates information about the > various products made by different companies. To that end, I have > models (classes) for companies, products, and events. Since each > company has

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Daniel Roseman
On Tuesday, May 24, 2011 11:13:31 AM UTC+1, Lloyd Dube wrote: > > Hi Everyone, > > I am trying to parse an XML feed and display the text of each child node > without any success. My code in the python shell is as follows: > > >>>import urllib > >>>from xml.etree import ElementTree as ET > >

Re: urlpatterns

2011-05-21 Thread Daniel Roseman
Op zaterdag 21 mei 2011 03:50:40 UTC+1 schreef Dagon het volgende: > > I am a newbie to both Python and Django. > Why does urlpatterns = patterns('', (r'^People/$', > 'iFriends.People.views.index') get me the following error message: > > Using the URLconf defined in iFriends.urls, Django tried

Re: modelformset_factory instance not saving

2011-05-19 Thread Daniel Roseman
On Wednesday, May 18, 2011 11:46:14 PM UTC+1, piker wrote: > > I have a modelformset_factory instance displaying beautifully, but not > saving to the database. > If anyone can spot any mistake i've made in the code it would be much > appreciated.(i'm using Django 1.3 by the way). > > def

Re: Database error: column table.column_id does not exist

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 6:46:49 PM UTC+1, wilbur wrote: > > Hello, > > I continue to get errors when I try to view my model tables in Django > admin (1.3.0). The errors invariably refer to the name of a foreign > key defined in my models, with the '_id' appended to the name of the > field.

Re: retrieving current user in view

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 2:16:00 PM UTC+1, Michel30 wrote: > > Hey all, > > I have a Django 1.3 app that retrieves user credentials from LDAP. > Most views require the user to be authenticated so I use the > @login_required decorator. > > Now, in a form a user can upload a document using a

Re: Error when try to do ManyToMany relation with User class...

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 2:26:21 AM UTC+1, Chris Seberino wrote: > > I have 3 classes that have a ManyToMany relation with the User class. > > When I try to do syncdb I get this error > > Error: One or more models did not validate: > mvc.course: 'users' has an m2m relation with model

Re: form new versus edit

2011-05-14 Thread Daniel Roseman
On Saturday, 14 May 2011 22:14:38 UTC+1, Greg Donald wrote: > > On Sat, May 14, 2011 at 4:08 PM, Shawn Milochik > wrote: > > The problem is that you're doing this at all. You should instead be using > {{ > > form.name }} to put the field in the form. > > > Well that works

Re: Overriding templates for the inclusion_tag

2011-05-13 Thread Daniel Roseman
On Friday, May 13, 2011 1:01:26 AM UTC+1, Stodge wrote: > > Is there any interest in changing the inclusion template functionality > to let the function return the template name in the dictionary to the > inclusion_tag decorator? This would let the developer override the > template filename:

Re: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Daniel Roseman
On Friday, May 13, 2011 4:15:59 AM UTC+1, robinne wrote: > > How can I render dynamic content in a base template if I only call a > view on my child template? > > What I am trying to do is setup a base template that will include > "Profile" information for the user who is logged in, for

Re: form that displays an elements list with checkboxes

2011-05-11 Thread Daniel Roseman
On Wednesday, May 11, 2011 2:17:07 PM UTC+1, Marc Aymerich wrote: > > Hi, > I want to do a form that displays a list of elements that can be selected > with a checkbox and then submit the selected elements, but I haven't found > any code sample for this. I'll apreciate if someone can give me a

Re: performance of model instgance save()

2011-05-11 Thread Daniel Roseman
On Wednesday, May 11, 2011 7:50:16 AM UTC+1, Brian wrote: > > Sure - it's just that bit more convenient and readable to use the ORM > approach. If I get the chance, I must try substituting direct calls to > psycopg and see if that makes it significantly faster again. I'd guess > there's maybe

Re: Question about ModelAdmin.formfield_for_foreignkey

2011-05-05 Thread Daniel Roseman
On Thursday, May 5, 2011 10:32:47 PM UTC+1, juanpa wrote: > > Hello, > > Is it possible to obtain a reference to the modified object > in ModelAdmin.formfield_for_foreignkey? > > Thanks! > >Juan Pablo > What do you mean, modified? formfield_for_foreignkey is used for defining the form, long

Re: not able to use editable=True or false in forms.CharField()

2011-05-05 Thread Daniel Roseman
On Thursday, May 5, 2011 10:17:38 PM UTC+1, GKR wrote: > > not able to use editable=True or false in forms.CharField() > > getting error as > > TypeError at /items_entry/ > > __init__() got an unexpected keyword argument 'editable' > > Request Method: GET Request URL:

Re: How to get view

2011-05-04 Thread Daniel Roseman
On Wednesday, May 4, 2011 9:34:08 AM UTC+1, doniyor wrote: > > Hi there, > my problem is simple, i cannot redirect /wiwi/ to /s/?o=key=./ > because the second request does not have a view, but i set its view in > this way: > > View, args, kwargs = resolve(“/s/?o=key“) >

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Daniel Roseman
On Tuesday, May 3, 2011 6:38:40 PM UTC+1, Jeff Blaine wrote: > > I've read the following and am still stuck and wondering what piece of this > puzzle > I am missing. If anyone has any ideas, please do comment! > > http://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/ > >

Re: Form with manytomany field

2011-05-03 Thread Daniel Roseman
On Tuesday, 3 May 2011 02:37:56 UTC+1, daniel.franca wrote: > > anyone? > Maybe what I need is something like OneToMany relationship, i guess, but > there's no such thing in django > > Er, what? What about ForeignKey? Anyway, what you need is inline model formsets:

Re: Custom template tag -- Not registered?

2011-04-29 Thread Daniel Roseman
On Friday, 29 April 2011 21:24:44 UTC+1, Kenny Meyer wrote: > > Hello, > > I have the following inclusion tag in templatetags/show_submissions.py : > > ## BOF > > register = template.Library() > > @register.inclusion_tag('competition/templatetags/show_submissions.html') > def

Re: How to display the data on the page from the database

2011-04-27 Thread Daniel Roseman
On Wednesday, April 27, 2011 7:38:32 AM UTC+1, GKR wrote: > > How to display the data on the page from the database in tabular format > like msflexgrid with update facility. > > > Please help > First, you write some back-end code. Then, you write some front-end code. Hope that helps. -- DR.

Re: Unexpected error

2011-04-26 Thread Daniel Roseman
On Tuesday, April 26, 2011 2:32:35 PM UTC+1, Czare1 wrote: > > Once for a while I get very strange error. It's listed below. I > > Traceback (most recent call last): > > File "/usr/local/lib/python2.7/site-packages/django/core/handlers/ > base.py", line 111, in get_response > response =

Re: Form redisplay in the case of form errors?

2011-04-26 Thread Daniel Roseman
On Tuesday, April 26, 2011 10:37:50 AM UTC+1, Derek wrote: > > I have a form that I am expecting will redisplay with errors; it does not > do so. Instead, the "print form.errors" statement is reached which does, in > fact, show that there are errors. For example: > > cellphoneThis field is >

Re: class-based generic views and forms

2011-04-25 Thread Daniel Roseman
On Monday, April 25, 2011 9:16:18 PM UTC+1, lingrlongr wrote: > > I have a view that subclasses uses django.views.generic UpdateView. > In my template, I'm trying to access a form field's required > property. For example: > > {% for field in form %} >{{ field.required }} > {% endfor %}

Re: Connecting to a database

2011-04-24 Thread Daniel Roseman
On Sunday, April 24, 2011 7:46:43 AM UTC+1, Hurin wrote: > > Hi, > > I have a python script where I have to fill the following info to > connect to my DB: > > DATABASES = { > 'default': { > 'ENGINE': 'sqlite3','mysql', # Add 'postgresql_psycopg2', > 'postgresql', 'mysql',

Re: Why Django Model Filter Returns Model Object Instance Instead of QuerySet?

2011-04-21 Thread Daniel Roseman
On Thursday, April 21, 2011 9:17:54 PM UTC+1, octopusgrabbus wrote: > > I posted in the original problem. > cs_hold_rec_list = CsInvHold.objects.filter(inventory_ok=0) > How is that a problem? What's wrong with it? > Right now, I can get what I need by doing this: > > qs =

Re: Why Django Model Filter Returns Model Object Instance Instead of QuerySet?

2011-04-21 Thread Daniel Roseman
On Thursday, April 21, 2011 7:52:02 PM UTC+1, octopusgrabbus wrote: > > I have been able to narrow my question down. I can pull individual > columns from the returned model object reference. How can I get all > those columns in a list. Wrapping in a list() function returns an > error object is

Re: ModelForm unbound

2011-04-21 Thread Daniel Roseman
On Thursday, April 21, 2011 8:16:36 AM UTC+1, Constantine wrote: > > Hi > > i've used some logic in clean_field methods, but when i've migrated to > ModelForm, was very surprised that clean methods does not invoked > after some investigation i realized that model instane does not makes >

Re: Custom form field

2011-04-20 Thread Daniel Roseman
On Wednesday, April 20, 2011 4:20:04 PM UTC+1, Dan wrote: > > I'm trying to create a Form Field, not a Model Field. > > The doc about creating a custom one is a tiny paragraph at the end of this > page: http://docs.djangoproject.com/en/1.3/ref/forms/fields/ > > I read the source code of django

Re: extend an existing model (not the user profile)

2011-04-20 Thread Daniel Roseman
On Wednesday, April 20, 2011 12:22:15 PM UTC+1, Simone Orsi wrote: > > Hi, > > first of all I'm sorry if this argument has been discussed somewhere but > I cannot find any real example except the one for the user profile. > > I'm trying to extend an existing model adding some fields. > > It seems

Re: Query model with multiple selfs

2011-04-18 Thread Daniel Roseman
On Monday, April 18, 2011 11:57:37 AM UTC+1, Daniel Roseman wrote: > > On Monday, April 18, 2011 9:10:30 AM UTC+1, o_r wrote: >> >> Hello. >> >> I have this model: >> >> class MyModel(models.Model): >> string = models.CharField(max_len

Re: Query model with multiple selfs

2011-04-18 Thread Daniel Roseman
On Monday, April 18, 2011 9:10:30 AM UTC+1, o_r wrote: > > Hello. > > I have this model: > > class MyModel(models.Model): > string = models.CharField(max_length=96,unique=True,db_index=True) > mother=models.ForeignKey('self',null=True,blank=True) > >

Re: problems with errors in templates

2011-04-17 Thread Daniel Roseman
On Sunday, 17 April 2011 21:41:15 UTC+1, Antonio Sánchez wrote: > > hi, im working with a modelform, and overrided clen methos for making > some custom checks, raising a forms.ValidationError when i need, im > sure this error is raised, but i dont know why in the template errors > are not

Re: Need straightforward way to pre-process form data

2011-04-14 Thread Daniel Roseman
On Thursday, April 14, 2011 7:09:57 PM UTC+1, ricksteu wrote: > > Shawn - The validation appears to actually takes place *before* the > __init__ is called (during instantiation, not during initialization.) > If you look at BaseForm, scroll past the __init__() method, and you'll > see: > >

Re: Stackoverflow kind of Answer/commenting app in Django

2011-04-14 Thread Daniel Roseman
On Thursday, April 14, 2011 8:45:33 PM UTC+1, Mike Ramirez wrote: > > Wait aren't we programmers or not? This should be something you can do in a > > couple days... > > Mike > You should read Stackoverflow creator Jeff Atwood's post on exactly that:

Re: Utf-8 encoding errors with unicode in urlpatterns - Django 1.3

2011-04-14 Thread Daniel Roseman
On Wednesday, April 13, 2011 9:31:27 PM UTC+1, Leszek Piątek wrote: > > Hi! > > I've recently came across problem in django. According to > documentation I should be able to use unicode inside urlpatterns - but > something is wrong I guess. > > When URL exists I got error displayed on dev

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 11:17:15 AM UTC+1, Lloyd Dube wrote: > > Hi Daniel, > > Thanks. I would think that plugging about in the default django > installation would not be good practice - can that file simply reside in the > project directory and the name > in settings.py MIDDLEWARE_CLASSES

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 10:44:27 AM UTC+1, Lloyd Dube wrote: > > Hi all, > > I found a code snippet to fix a dumplicvated first page of paginated > results and was wondering if anybody knows where in the code it should be > implemented? > > It looks like something that should be in views.py

Re: problems with redirect function

2011-04-11 Thread Daniel Roseman
On Monday, April 11, 2011 3:42:26 PM UTC+1, Antonio Sánchez wrote: > > http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect > > "You can use the redirect() function in a number of ways. > 2. By passing the name of a view and optionally some positional or > keyword arguments; the

Re: NameError at / global name 'volatility' is not defined

2011-04-11 Thread Daniel Roseman
On Monday, April 11, 2011 2:36:21 PM UTC+1, Tongas wrote: > > Hi! > views.py > context_processors.py > from django.db.models import Avg > from orama_financial.models import TargetFund > > def fund_context(request): > avg_all = TargetFund.objects.all().aggregate(Avg('volatility')) >

Re: problems with redirect function

2011-04-11 Thread Daniel Roseman
On Monday, April 11, 2011 12:00:37 AM UTC+1, Antonio Sánchez wrote: > > hi, im trying to use redirect shortcut, but im having problems passing > arguments to the view i want to reverse. > > view definition is this: > > def profile(request, activation_key=None, new=None): > if new is None: >

Re: {% extends "view/base.html" %}

2011-04-08 Thread Daniel Roseman
On Friday, April 8, 2011 4:39:30 PM UTC+1, Harry wrote: > > {% extends "base.html" %} works fine, but I want to point to a > static_dir. > > Here is app.yaml: > - url: /view > static_dir: static/view > > Here is main.py: > template_values = { > 'url': url, >

Re: Notify user at admin interface if custom save fails

2011-04-08 Thread Daniel Roseman
On Friday, April 8, 2011 9:26:05 AM UTC+1, shadyabhi wrote: > > I have a class in models.py like: > > class UserProfile(models.Model): > user = models.ForeignKey(User) > is_counter = models.BooleanField() > is_student = models.BooleanField() > > def

Re: form.errors is not a dictionary?

2011-04-05 Thread Daniel Roseman
On Tuesday, April 5, 2011 9:43:48 PM UTC+1, Roy Smith wrote: > > I'm using django-1.3 . I have a view with the following code: > > def item_create(request): > if request.method == 'POST': > form = ItemForm(request.POST) > if form.is_valid(): > url =

Re: Static/media url in template

2011-04-05 Thread Daniel Roseman
On Tuesday, April 5, 2011 3:39:17 PM UTC+1, JohnnyWalker wrote: > > It doesn't appear that simple. When I try to insert {{MEDIA_URL}} into > my template, I get no output whatsoever. I haven't been able to find > anything on this. You don't seem to be looking very hard.

Re: new text area in django admin page

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 3:35:15 PM UTC+1, jay K. wrote: > > hello > > how can i add a new text field in the django admin area > > i want to create a new subpage > > thanks > > > Before asking a question, have a think about what you actually want to ask. Then think about whether you're

Re: Newbie question - modelform / dropdown list

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 12:43:32 PM UTC+1, rune wrote: > > Hi all, > > I just started with Django, done the tutorial, now I'd like to create > a page were users can put > requests in a queue. Lets say the fields to display are user, date, > filepath, date to load. > I can create this with

Re: Please tell how to implement a new project?

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 11:20:31 AM UTC+1, GOUTAM KUMAR RANA wrote: > > Please tell how to implement a new project? > > I m new to Django projects . if possible give me a graphical idea of > using Django from the base to the output. > > My target is to make an inventory for a particular

Re: Trouble raising forms.ValidationError in save() override in admin.py

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 11:09:17 AM UTC+1, Lloyd Dube wrote: > > Hi Shawn, > > Thanks for the feedback. I read the docs and defined a clean_audio_file > method in my ModelAdmin class. That's not what the docs say. They say you should create it on the Form. And where did you get the idea

Re: How to disable default authentication/messaging system?

2011-03-31 Thread Daniel Roseman
On Thursday, March 31, 2011 10:10:27 AM UTC+1, sanderkrause wrote: > > Because I'm using my own authentication and authorization system, I > would like to completely disable these standard apps from Django. > > I've tried removing the relevant lines from MIDDLEWARE_CLASSES and > INSTALLED_APPS,

Re: form has not attribute cleaned_data

2011-03-28 Thread Daniel Roseman
On Monday, March 28, 2011 2:04:53 PM UTC+1, luca72 wrote: > > hello i have a form like this: > class Form_news(forms.Form): > messgg = forms.CharField(label = 'Messaggio',max_length=1, > widget=forms.Textarea) > > and in the views i do as follow: > if request.user.is_superuser: >

Re: Integrity Error on chained FKs

2011-03-27 Thread Daniel Roseman
On Sunday, March 27, 2011 9:41:53 AM UTC+1, shofty wrote: > > this is the view code... > > u = get_object_or_404(UserProfile, user=request.user) > if request.method == "POST": > # submitted the add venue form > venue_form = VenueForm(request.POST) >

Re: ManyToMany Intermediate Table on a Separate Database?

2011-03-26 Thread Daniel Roseman
On Saturday, March 26, 2011 7:33:23 PM UTC, Mazery Smith wrote: > > Hey, > I tried setting up an intermediate manytomany table relationship where > my intermediate table > is in one database, my user table (target table) is in a registration > database and my data table (source table) is in

Re: unique_for_date not working?

2011-03-25 Thread Daniel Roseman
On Friday, March 25, 2011 3:01:47 PM UTC, Ryan Osborn wrote: > > Thanks for your reply Jacob. The only problem with the method you > suggested is that the field now shows up in the admin form which > allows people to edit it. I would rather that this didn't happen. Is > there any way around

Re: RelatedManager - obj.x_set.add(y) doesn't work for me ?

2011-03-25 Thread Daniel Roseman
On Friday, March 25, 2011 10:34:25 AM UTC, southof40 wrote: > > I've got the models shown at the bottom of this email. I'm having > trouble adding a foreign key reference to a 'BookMark' object I've > created. > > I can do this ... > > >>> from bookmarks.models import BookMark, User, Tag,

Re: Logging visitors/requests and showing it all in a nice report?

2011-03-21 Thread Daniel Roseman
On Monday, March 21, 2011 1:41:40 PM UTC, MrMuffin wrote: > > Ok, but I want the report in django admin, nicely formatted, with > shiny icons, charts and pies ;-) > > I was wondering if I should make a simple middleware to handle > request-logging and add a few views to summarize things like os, >

Re: How can I run my django project with django-social-auth?

2011-03-21 Thread Daniel Roseman
On Monday, March 21, 2011 7:09:58 AM UTC, Su Yi Kyaing wrote: > > Dear All! > > I want to create Django login form via facebook. So I am using with > django-social-auth. > Can every one guide me in detail how should I do continuously after > clone django-social-auth to my project? > > Regards

Re: Pagination of Search Results - URL issue

2011-03-21 Thread Daniel Roseman
On Monday, March 21, 2011 4:49:34 AM UTC, Andrew Godfrey wrote: > > Hi, > > I am paginating the output of a query. Everything works fine and the > first page of results is displayed. The problem is that the url to > access pages 2 (http://127.0.0.1:8000/search/?page=2) and following > fall

Re: Parse template variables in custom tag

2011-03-20 Thread Daniel Roseman
On Sunday, March 20, 2011 9:57:04 PM UTC, Turner wrote: > > I'm working on a custom tag to which I would like to be able to pass > template variables and filters. I found > Variable(value).resolve(context) in the Django source. I > have a couple of questions: > > You don't need to look at the

Re: Auto import files into database

2011-03-20 Thread Daniel Roseman
On Sunday, March 20, 2011 1:04:46 AM UTC, Corey Farwell wrote: > > So would it look something along these lines: > > from app.models import NewModel > # parse csv data here > meow = NewModel(whatever = parsedData) > meow.save() > > Where should this script live? Is there a general place

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 12:54:22 PM UTC, Vladimir wrote: > > Daniel, I understand that's a wrong idea to mix files of different > nature in one directory. I only showed that one and the same simple > (?) configuration: index.html plus image file does works when I call > index.html directly

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 9:44:41 AM UTC, Vladimir wrote: > > It does not work. If I call index.html which contains > #title h1{ background-image: url(galion.gif); background-position: > left top; background-repeat: no-repeat; } > directly in web browser then image is displayed. > If I

Re: Reg : Python Devveloper

2011-03-18 Thread Daniel Roseman
Reg: Python developer? Surely that's a low-budget sitcom? Or, perhaps, a skit from (Monty) Python - Michael Palin as the hapless developer Reg, who has to deal with the increasingly strange development requests from his boss (John Cleese) while trying to ignore the random dancing being

Re: Template Tags and TemplateSyntaxError: - expected 'endblock' or 'endblock content'

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 4:35:12 PM UTC, Mazery Smith wrote: > > Thanks for the response DR. > > Isn't the "template tag library" already loaded in my example with > this line: > > {% load page_tags %} > > My pagination_links tag is in the page_tags.py file. So that should > work. Unless you

Re: Template Tags and TemplateSyntaxError: - expected 'endblock' or 'endblock content'

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 2:48:31 PM UTC, Mazery Smith wrote: > > newbie here, > I'm running into a template syntax error where (as far as I can tell) > there shouldn't be one (yes, I've loaded my tags file before I tried > invoking my tag). I'm looking for help on how to debug it. I'm running

Re: Pretty URLs: fundamental flaw?

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 10:34:03 AM UTC, Christophe wrote: > > Hi All, > > I did not find anything about that topic so I am probably missing one > big thing here. I would be really glad to have your opinion so first > let me start by quoting the Djangobook: > > """ > A Word About Pretty

Re: How do I use widgets on Templates and (not on Forms)?

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 7:29:09 AM UTC, django beginner wrote: > > Hi all, > > How do I use widgets on the field of a template(not forms)? Let's say > I have a field called Member, and this field should be in select form > that has choices from members table (field: member_name)? > > tried

Re: Add, Edit and Delete link using Forms (not templates) per row without using built django-admin functionality

2011-03-18 Thread Daniel Roseman
On Friday, March 18, 2011 2:08:02 AM UTC, django beginner wrote: > > Hi Django users, > > I am having some dilemma over converting simple admin page *Template*(without > having to use the built in django-admin functionality) by using > forms, and not templates, I have the following sample

Re: About using Django Auth with my app, Auto saving the User

2011-03-17 Thread Daniel Roseman
On Thursday, March 17, 2011 2:33:50 PM UTC, AJ wrote: > > No one? > > On Mar 16, 10:05 pm, AJ wrote: > > I have a model like this: > > > > class Post (models.Model): > > name = models.CharField(max_length=1000, help_text="required, name > > of the post") > >

Re: How to work with views like classes

2011-03-17 Thread Daniel Roseman
On Thursday, March 17, 2011 11:35:55 AM UTC, chubz wrote: > > What I've found as a solution, though I don't know how much it is > recommended as a programming practice is to have your variable defined in a > "custom" request context and then use that request context instead of the > default

Re: getting u'string' at the beginning of each item in a list

2011-03-17 Thread Daniel Roseman
On Thursday, March 17, 2011 9:55:49 AM UTC, cuteangel wrote: > > def search_mov(movie_name): > try: > from django.db import connection, transaction > cursor = connection.cursor() > cursor.execute("select query from Winteract_Wogmainteract > where

Re: my assertRases test does not call the clean() method

2011-03-17 Thread Daniel Roseman
On Thursday, March 17, 2011 9:47:50 AM UTC, lawgon wrote: > > hi, > > I have a test like this: > > > self.assertRaises(ValidationError,Costtocompany.objects.create,profile=self.profile1, > company_laptop = True, > ctc_pa=1, >

Re: Format DateTimeField of a model

2011-03-16 Thread Daniel Roseman
On Wednesday, March 16, 2011 5:37:23 PM UTC, Vinicius Massuchetto wrote: > > I want to customize the DateTimeField returned in an admin list > column. I know there's the DATETIME_FORMAT setting, but I only want to > change in one model. I'lm also using L10N, and couldn't figure out if > there's a

Re: permissions don't get added

2011-03-16 Thread Daniel Roseman
On Wednesday, March 16, 2011 2:50:05 PM UTC, Tom Evans wrote: > > On Wed, Mar 16, 2011 at 1:28 PM, tom wrote: > > Hello, > > > > I have a model, which was already created within the DB, and I added > > following permissions: > >class META: > > ^^ Django looks for an inner

Re: Determining Django model instance types after a query on a base class

2011-03-15 Thread Daniel Roseman
On Tuesday, March 15, 2011 2:58:55 PM UTC, Lior Sion wrote: > > I'm having the same issue described in some places around the web and > also here: > > > http://stackoverflow.com/questions/5225556/determining-django-model-instance-types-after-a-query-on-a-base-class > > > In essence, I have

Re: Model.clean() ValidationError

2011-03-15 Thread Daniel Roseman
On Tuesday, March 15, 2011 2:36:45 PM UTC, Ben Dembroski wrote: > > > Hi Tom, > > Thanks for your reply. (You're right, my example was lousy). > > I did in fact try what you suggested earlier on, and got the the > following error: > > AttributeError at /people/add/ > > 'ValidationError'

Re: Difference between RequestContext and Context?

2011-03-15 Thread Daniel Roseman
On Monday, March 14, 2011 3:09:39 PM UTC, gamingdroid wrote: > > I see, so I completely misunderstood RequestContext. > > There is only two differences, RequestContext takes a HttpRequest > object as it's first argument and automatically includes > TEMPLATE_CONTEXT_PROCESSOR dictionaries into

Re: TemplateDoesNotExist

2011-03-13 Thread Daniel Roseman
On Sunday, March 13, 2011 8:40:06 AM UTC-4, Vijay wrote: > > Hi Gladys, > Thanks for quick reply. > Following content is there at TEMPLATE_DIRS.what i should change at > this.Please suggest me. > > > TEMPLATE_DIRS = ( > # Put strings here, like "/home/html/django_templates" or >

Re: request.user.save() doesnt work

2011-03-11 Thread Daniel Roseman
On Thursday, March 10, 2011 11:59:15 PM UTC-8, Ndungi Kyalo wrote: > > Hi guys. Am using django non-rel on appengine. I am using django's > auth backend for my authentication, since I did not want to have to > force my users to use gmail logins, and appengine models > {google.appengine.ext.db}

Re: Problem using django and ajax-jQuery

2011-03-07 Thread Daniel Roseman
On Monday, March 7, 2011 3:32:51 PM UTC-8, Rami wrote: > > Thanks Andy! > > 1- you were correct about the form submitting the get method. > > 2- As you mentioned, the when I change the if statement to > "request.GET.has_key('ajax')", it gets executed. the "?ajax" apparently > causes the

Re: Where does admin.py go?

2011-03-04 Thread Daniel Roseman
On Friday, March 4, 2011 10:34:27 AM UTC, ALJ wrote: > > Where does "admin.py" actually go? Do you need one for each of your > applications or just one in the root of the project. Or does it go in > an "admin" directory in your project? > > (Sorry, for the stupid question. I'm returning to an

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

2011-03-02 Thread Daniel Roseman
On Thursday, March 3, 2011 6:48:21 AM UTC, Vladimir wrote: > > Good morning! > In me first exercise project with Django I met an error message: > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position > 0: ordinal not in range(128). Admin pages are built without css. > Then I

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