Re: Design decision

2009-10-26 Thread Léon Dignòn
*bump* On 23 Okt., 11:03, Léon Dignòn <leon.dig...@gmail.com> wrote: > callerlist will MAYBE use a database of another program (not django), > or it uses a database of another django application. This is optional > and I want callerlist to work with or without. For that i deci

Re: Model design

2009-10-23 Thread Léon Dignòn
The second sounds more logically. On 23 Okt., 15:41, chefsmart wrote: > I would go with your second solution. > > On Oct 23, 5:17 pm, Caisys wrote: > > > > > Hi, > > I have classes for Event, Place and Subplace. Some of the Places are > > divided

Re: Design decision

2009-10-23 Thread Léon Dignòn
base engine (I doubt you > need to be a "power user") And then brush up on the > manage.py database subcommands (dumpdata, inspectdb, > and various sql*) and that will help clarify a solution path. > > -Chip > On Oct 16, 10:10 am, Léon Dignòn <leon.dig...@gmail.com

Design decision

2009-10-16 Thread Léon Dignòn
I have a project. Within that project I have the app callerlist. Callerlist is a list of either inbound or outbound phone calls. To each phone call the following information should be written down: own name, name of the caller, subject, message and time. This app has to be coherent. Now, for

Re: app model

2009-10-16 Thread Léon Dignòn
User signals: models.py -- def do_something(sender, instance=None, **kwargs): """Does something instance is the user instance. """ if instance is not None: # Do Something post_save.connect(do_something, sender=User) # User is the user model. On 14

Re: windows localhost send email

2009-10-16 Thread Léon Dignòn
Download and run "Free SMTP Server": http://www.softstack.com/freesmtp.html No need to configure anything. Your sent e-mails will probably moved in your spam folder. -ld On 16 Okt., 09:47, Angel Cruz wrote: > In your settings.py, make sure you set EMAIL_HOST correctly.

Archiving Model Instances?

2009-10-16 Thread Léon Dignòn
Hello, I am programming an application where a model instance could be archived if necessary. For example: in gmail I can archive e-mails and they move in the archived folder. The question is: is it only a boolean class-attribute called archived? Or is there more technical know how behind it?

Re: rendering a table

2009-09-27 Thread Léon Dignòn
Could you post your list and your output please? On Sep 27, 2:04 am, jhugo wrote: > Hi, > > I want to render a table using a list of list. What I do is create a > list for the rows and append another list for the columns. I use two > fors in my template to render the table

Re: Field.blank alternative

2009-09-21 Thread Léon Dignòn
You do this in the validation: http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other -leond On Sep 21, 11:34 pm, lance wrote: > Newbie question... > > In defining my model, I have two CharFields of a given class.

Re: Design question: User vs. UserProfile

2009-09-18 Thread Léon Dignòn
The user model, because the model defined by AUTH_PROFILE_MODULE is intended to be an extension to the actual user model. Namely the profile. Why would you bind something to a user's profile, instead of the user itsself? If you want to "allow records of people without Users", then use blank=True

Passing object through POSTs.

2009-09-17 Thread Léon Dignòn
Hello, I have a Model called 'Skin' with the attributes (1n-relationships) game and car. Game and car stand in a m2m-relationship to each other. Each skin can be either a skin of Game1 or Game2. Each car (car model) can be playable in Game1 and Game2, or only in one of these. I want to create

Re: Select models based on m2m relationship.

2009-09-16 Thread Léon Dignòn
bump On 15 Sep., 19:36, Léon Dignòn <leon.dig...@gmail.com> wrote: > Hello, > > I have a m2m relationship like this: > > class Actor(models.Model): >     name = models.CharField(unique=True) > class Movie(models.Model): >     name = models.CharF

Re: How to organize django projects on a productive server?

2009-09-15 Thread Léon Dignòn
individually at in the virtual host config: / var/www/site1,site2,…. So /var/www/django is save! On Sep 15, 9:49 pm, orschiro <orsch...@googlemail.com> wrote: > Hello Léon Dignòn, > > you told that your projects lie beneath /var/www.. > > So the reason for that is that you might

Re: How to organize django projects on a productive server?

2009-09-15 Thread Léon Dignòn
On Sep 15, 9:28 pm, orschiro wrote: > Hello guys, > > first, I know it is not that important how to do this but as I'm > pretty knew and callow I'd like to know how some experienced users do > that. > > At the moment I have just a normal user account besides my root

makemessages error/problem on Vista

2009-09-15 Thread Léon Dignòn
C:\Users\Leon\Documents\Django\myproject>manage.py makemessages Error: This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the conf/ locale (in the django tree) or

Select models based on m2m relationship.

2009-09-15 Thread Léon Dignòn
Hello, I have a m2m relationship like this: class Actor(models.Model): name = models.CharField(unique=True) class Movie(models.Model): name = models.CharField(unique=True) actors = models.ManyToManyField(Actor) class Comment(models.Model): actor = models.ForeignKey(Actor)

Re: How to generate po files ?

2009-09-09 Thread Léon Dignòn
I am glad you ask this. I was running in that problem too. I use Windows Vista and I've run 'django-admin.py makemessages' inside the folder I also run 'django-admin.py startproject bestsiteever'. Same error. -leond On Sep 9, 7:28 pm, Mirat Can Bayrak wrote: > Hi, i

Re: Choices of foreign keys?

2009-09-09 Thread Léon Dignòn
mn: > >     categories = models.ManyToManyField(Category, blank=True) > > -Peter > > On Sep 9, 11:54 am, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > > > Hello, > > > let's assume we have a model for photos with the fields id, user, > > pho

Choices of foreign keys?

2009-09-09 Thread Léon Dignòn
Hello, let's assume we have a model for photos with the fields id, user, photo. Any user should be able to categorize his foto with a given number of categories, e.g. person, car, building. In future it's possible that I add more categories. My question is whether the new category field should

Re: apache2+mod_wsgi: 403 Forbidden

2009-09-09 Thread Léon Dignòn
eny from all > > > > > > > > >        Order Allow,Deny > > >        Allow from all > > > > > > > like in the example :) > > > > Regards, > > > Matias. > > > > On Mon, Sep 7, 2009 at 5:56 PM, Léon Di

Re: django unicode user name

2009-09-08 Thread Léon Dignòn
It's easier than that, since the username field is a CharField! Add these lines to your admin.py: -- from django.contrib.auth.forms import UserCreationForm, UserChangeForm # Overrides django.contrib.auth.forms.UserCreationForm and changes # username to accept a wider range of

Re: django unicode user name

2009-09-08 Thread Léon Dignòn
It's easier than that, since the username field is a CharField! Add these lines to your admin.py: -- from django.contrib.auth.forms import UserCreationForm, UserChangeForm # Overrides django.contrib.auth.forms.UserCreationForm and changes # username to accept a wider range of

Re: apache2+mod_wsgi: 403 Forbidden

2009-09-07 Thread Léon Dignòn
iki/IntegrationWithDjango > > HTH, > Matias. > > > > > > On Mon, Sep 7, 2009 at 2:55 PM, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > I get a 403 forbidden. > > > I serve Django with apache2+mod_wsgi. I disabled some plugins I think &g

apache2+mod_wsgi: 403 Forbidden

2009-09-07 Thread Léon Dignòn
I get a 403 forbidden. I serve Django with apache2+mod_wsgi. I disabled some plugins I think I don't need. Set the listen port to 8000 on localhost only. Later I will serve django through reverse proxy on cherokee webserver. But for now, localhost:8000 is returning a 403 forbidden error. Any

Re: PostgreSQL or MySQL, What are the +'s and -'s?

2009-09-04 Thread Léon Dignòn
One of many: PostgreSQL supports naive foreign referential-integrity constraints. MySQL (default: myISAM) does it only with InnoDB which leads to other Problems: http://dev.mysql.com/doc/refman/5.0/en/innodb-configuration.html On Sep 4, 10:29 pm, Joshua Russo wrote: > I

Re: How do you configure django+http+ftp?

2009-08-30 Thread Léon Dignòn
And causes new ones. My apache runs other also websites. On Aug 30, 9:12 pm, Mike Ramirez <gufym...@gmail.com> wrote: > On Sunday 30 August 2009 12:04:36 pm Léon Dignòn wrote: > > > > > > > Hello folks, > > > I read through the documentation and got my pro

How do you configure django+http+ftp?

2009-08-30 Thread Léon Dignòn
Hello folks, I read through the documentation and got my project up and running. But when I try to upload something, I receive the error messages 'permission denied'. I could sloppy fix that problem with chmod, but that is not want I want to do. Since then I am thinking about a good folder

Re: ImageField width_wield

2009-08-29 Thread Léon Dignòn
No, everything is fine. Once you uploaded a file, you can call image.width and image.height (where image is an instance of Image). If you are using ModelForms, you can set editable=False as a parameter for width and height. image = models.ImageField(upload_to='images',

Re: Loose username policy

2009-08-29 Thread Léon Dignòn
dd_form = UserCreationForm admin.site.unregister(User) admin.site.register(User, UserProfileAdmin) -------- On Aug 29, 11:52 am, Léon Dignòn <leon.dig...@gmail.com> wrote: > Hello, > > I don't find a way to allow additional char

Loose username policy

2009-08-29 Thread Léon Dignòn
Hello, I don't find a way to allow additional characters in the username: -'[] {}[]… Sure, I could override the user model, but then my 3rd-party- application won't work anymore. (django-profiles/registration). Any ideas? --~--~-~--~~~---~--~~ You received this

Help with admin inlines

2009-08-28 Thread Léon Dignòn
Hi, I tried to stack two models in the admin interface. Any ideas why I get this error? issubclass() arg 1 must be a class File "C:\Django\myproject\myapp\admin.py" in 22. admin.site.register(Manufacturer, ManufacturerAdmin) admin.py class

ugettext() and ugettext_lazy() - error and difference

2009-08-28 Thread Léon Dignòn
Hi, I don't exactly understand the difference between ugettext() and ugettext_lazy(). I read the documentation and I've read that ugettext_lazy translates a string on access. Sounds more efficient. But why do I get this error on that code? from django.db import models from

Re: get an object's model name

2009-08-27 Thread Léon Dignòn
Hello, simply use type() >>> from django.contrib.auth.models import User >>> u = User.objects.get(id=1) >>> u >>> print u leon >>> type(u) -ld On Aug 27, 11:59 am, MIL wrote: > Hello :o) > > I would like to know how to get the model name of an object. > > sort of like

Fastest http+sql server combination

2009-08-24 Thread Léon Dignòn
Hello, there are plenty of possible combinations out there. The suggested one is apache and mod_wsgi, but in the docs is also mentioned, that fastcgi could be faster if configured properly. Unfortunately it's not mentioned, what properly means. For a site with few users who upload images up to

Re: ModelForm and ForeignKeys

2009-08-24 Thread Léon Dignòn
CharacterHome(models.Model): >      character = models.IntegerField(primary_key=True) >      ... >      ... > > Even though django accurately assesses the datatypes of these tables, > I want to be able to set CharacterHome.character as a ForeignKey > (Character) and have Character r

Re: ModelForm and ForeignKeys

2009-08-24 Thread Léon Dignòn
goobee, I am not sure, if I understand you. You have a person with a name, let's say "Max Mustermann". You want to show the ModelForm participant for this particular person? Is this correct? On Aug 24, 9:14 am, goobee wrote: > thanks Léon > > but I need name and firstname

Re: ImageField woes

2009-08-22 Thread Léon Dignòn
If you need it only for one particular form, you can also override clean_(): --- import Image # PIL class UserProfileForm(ModelForm): class Meta: model = UserProfile # Model UserProfile has an ImageField named avatar. def clean_avatar(self):

Re: ModelForm and ForeignKeys

2009-08-22 Thread Léon Dignòn
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form Good luck! -ld On Aug 21, 3:49 pm, goobee wrote: > hi there > > I'm in dire need of a good idea. django drives me crazy with its > foreignkey-resolver. > > class

Re: How to validate image dimensions?

2009-08-22 Thread Léon Dignòn
Thank you! I will youse TiNo's solutions. The resize feature is huge! On Aug 21, 6:10 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Fri, Aug 21, 2009 at 3:50 AM, TiNo<tin...@gmail.com> wrote: > > On Fri, Aug 21, 2009 at 10:40, Léon Dignòn <leon.dig...@gmail.

How to validate image dimensions?

2009-08-21 Thread Léon Dignòn
Hello, in my ModelForm I try to allow only images (for avatar) smaller than 64*64 pixels. I've done this by overriding clean_avatar(). But how can I check the dimensions? The instance is an InMemoryUploadedFile which has no width or height. Any help regarding this? class

Why using ForeignKey and not OneToOne to extend the user profile?

2009-08-18 Thread Léon Dignòn
Hello, in the authentication documentation is written that the user profile should be extended with a foreign key. - http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users "If you'd like to store additional information related to your users, Django

Re: How to extend Auth/User in admin view?

2009-08-18 Thread Léon Dignòn
' is not a callable or an attribute of 'UserProfileAdmin' or found in the model 'User'. Please help :o) -LD On Aug 18, 11:16 am, Léon Dignòn <leon.dig...@gmail.com> wrote: > Hi Daniel, > > I have trouble doing this: > > 1. admin.site.unregister(User) does not remove User from

Re: How to extend Auth/User in admin view?

2009-08-18 Thread Léon Dignòn
) except admin.sites.NotRegistered: pass admin.site.register(User, MyUserAdmin) -LD On Aug 17, 10:04 am, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Aug 17, 8:06 am, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > Hello, > > > I use an extendedUserModel

How to extend Auth/User in admin view?

2009-08-17 Thread Léon Dignòn
Hello, I use an extended User Model and like to display these fields in the admin view at Auth/User. Can anybody show me how this works? Thanks -LD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Question about URLs

2009-08-15 Thread Léon Dignòn
At this point I always love to refer to http://rubular.com, which is a very good regular expression editor and tester. leon On Aug 11, 1:42 am, Tim Chase wrote: > > If i have a URL such as: > > >  (r'^(?P\w+)/blog/', include('foo.urls.blog')), > > > what are the

Re: optional username registration

2009-08-15 Thread Léon Dignòn
Sorry, I assumed you used django-registration. But the idea is the same until you did not set up an own user model. :) On Aug 15, 3:11 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > django-registration uses the django.contrib.auth module which includes > the models.User model. i

Re: optional username registration

2009-08-15 Thread Léon Dignòn
django-registration uses the django.contrib.auth module which includes the models.User model. in this model it is necessary to supply a username, but not an e-mail address. I assume you want to authenticate users via the e-mail address, then you'd simply copy the e-mail address into the username

Re: ManyToMany Model.py and the shell..

2009-08-15 Thread Léon Dignòn
Hello rh0dium, Client.objects.filter() returns you a QuerySet instance which you have to iterate to get all objects. Thus the commented line will generate an error, I think so. Instead you should use Client.objects.get() to get the model instance. A QuerySet is a list of model instances. > Can

Re: user profiles and the admin

2009-08-15 Thread Léon Dignòn
Hey Chris, have you found a solution? On Jul 29, 2:43 pm, Chris Curvey wrote: > Drat.  That's not it.  I'll keep trying. > > On Jul 28, 5:01 pm, Asinox wrote: > > > > > im new , but i think that u need this part: > > > class UserProfileAdmin(UserAdmin):

Re: Override __init__()

2009-08-15 Thread Léon Dignòn
, 6:44 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > Yeah! this is working very well! > > > Now my last question. How can I change the initial-value of first_name > > and last_name I defined in my class (look at first post)? I have  to > > do it in the __in

Re: Override __init__()

2009-08-15 Thread Léon Dignòn
was easy. On Aug 15, 12:58 am, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Aug 14, 6:44 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > Yeah! this is working very well! > > > Now my last question. How can I change the initial-value of first_name > &

Re: Newbie - question - Django Tutorials 2

2009-08-14 Thread Léon Dignòn
As it sais it's an indentation error. Instead you must write: > inlines = [ChoiceInline] > list_display = ('question','pub_date') #line 16 > > admin.site.register(Poll, PollAdmin) On Aug 14, 10:53 pm, koko wrote: > Dear All, > > I just start Django today and

Re: Override __init__()

2009-08-14 Thread Léon Dignòn
dan...@roseman.org.uk> wrote: > On Aug 14, 3:50 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > Hi Emily, > > > thanks so far! > > > unfortunately this line: > > > > instance = getattr(kwargs, 'instance') > > throws this error: > > > Excep

Re: Override __init__()

2009-08-14 Thread Léon Dignòn
Hi Emily, thanks so far! unfortunately this line: > instance = getattr(kwargs, 'instance') throws this error: > Exception Value: 'dict' object has no attribute 'instance' what next? On Aug 14, 1:52 pm, Emily Rodgers <emily.kate.rodg...@googlemail.com> wrote: > On Aug 14, 12:14 

Override __init__()

2009-08-14 Thread Léon Dignòn
Hi, I try override a ModelForms init to claim the variable instance. After that I call super.__init__(). It's almost working, but there is no form shown in the browser. Any ideas what might be wrong? class ProfileForm(ModelForm): first_name = forms.CharField(required=False, max_length=30)

Re: override save()

2009-08-09 Thread Léon Dignòn
??? On Aug 10, 3:23 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Sun, 2009-08-09 at 13:35 -0700, Léon Dignòn wrote: > > Hi, > > > I have a ModelForm of my UserProfile model with two additional fields. > > I need to override save(),

Re: 2 Questions about feeds

2009-08-09 Thread Léon Dignòn
Please try to change the Sitename in the backend at /admin/sites/site/ Per default its example.com On Aug 8, 8:46 pm, When ideas fail wrote: > Hi, i'm developing a feed but i still have a couple of questionss. > > 1. I have this in my models: > > def

override save()

2009-08-09 Thread Léon Dignòn
Hi, I have a ModelForm of my UserProfile model with two additional fields. I need to override save(), to save the additional fields to the django.contrib.auth.model.User model. I tried to do that with a subclass of my UserProfile model class to have the code separated. But I get a NameError:

Re: import problem

2009-08-09 Thread Léon Dignòn
Thank you all! :) On Aug 9, 9:35 pm, "J. Cliff Dyer" <j...@sdf.lonestar.org> wrote: > On Sun, 2009-08-09 at 11:59 -0700, Léon Dignòn wrote: > > In my myproject/urls.py I want to pass the class to a function. > > Because my urls.py is full of imports, I do n

Re: import problem

2009-08-09 Thread Léon Dignòn
, 7:34 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > > > > > > > Hello, > > > some times I'd like not to import a class but just write it down. > > > Instead of > > from myproject.myapp.models import MyModel > > > I'd like to use > >

import problem

2009-08-09 Thread Léon Dignòn
Hello, some times I'd like not to import a class but just write it down. Instead of from myproject.myapp.models import MyModel I'd like to use myproject.myapp.models.MyModel But I get a NameError: name 'myproject' is not defined Also myapp.models.MyModel raises a NameError: name 'myapp' is

Re: django-registration and RegistrationFormUniqueEmail subclass

2009-08-09 Thread Léon Dignòn
Thank you On Jul 22, 7:42 pm, Dan Harris wrote: > The stuff in the brackets are the optional arguments passed to the > "register" view. > > You can read the documentation about the view at: > > http://bitbucket.org/ubernostrum/django-registration/src/b360801eae96... > >

Re: How to change the option text in a form's select-tag?

2009-08-09 Thread Léon Dignòn
I solved it with __unicode__ in the model class. On Aug 7, 1:38 pm, Léon Dignòn <leon.dig...@gmail.com> wrote: > Hello, > > I installed django-profiles and added an extended UserProfile. One > template displays all fields which are necessary to edit a users > profile.

django-profiles: exclude field from edit form

2009-08-08 Thread Léon Dignòn
I wonder why the avatar field is still display in the form after passing another form class. Still the built-in form is used. What's wrong? -- forms.py from django.forms import ModelForm from profiles import utils class _ProfileForm(ModelForm): class Meta: model =

django-profiles/registration and conditional redirect

2009-08-07 Thread Léon Dignòn
Hello, I struggle with the start of a little conditional request. I installed django-profiles and got django-profiles working and I have a small login form based on the django documentation. django-profiles covers the accounts/login url in its urls.py. So I only had to create the

Re: Django documentation site is SLOW

2009-08-07 Thread Léon Dignòn
Without it's better, but still now good enough for three colors and a little bit of text. On Aug 7, 2:09 pm, Mirat Bayrak wrote: > without javascript ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Django documentation site is SLOW

2009-08-07 Thread Léon Dignòn
I have an Intel C2D E2200 with 4 GB RAM. The Django docs are killing my browser, it feels like FireSLUG instead of Firefox 3.5 . Hate it! On Aug 7, 1:46 pm, Jo wrote: > Surely can't only be me that finds the main Django site painfully > slow? There is some javascript

How to change the option text in a form's select-tag?

2009-08-07 Thread Léon Dignòn
Hello, I installed django-profiles and added an extended UserProfile. One template displays all fields which are necessary to edit a users profile. Every user can choose a favorite aeroplane. Every aeroplane is built by one manufacturer. I print the edit form in the template with {{ form }}.

Re: django-registration and RegistrationFormUniqueEmail subclass

2009-07-22 Thread Léon Dignòn
; Before that, you need to import RegistrationFormUniqueEmail > > from registration.forms import RegistrationFormUniqueEmail > > Léon Dignòn ??: > > > > > > > Hey folks, > > > I don't know how to implement the RegistrationFormUniqueEmail > > subclass. > > > I hav

django-registration and RegistrationFormUniqueEmail subclass

2009-07-22 Thread Léon Dignòn
Hey folks, I don't know how to implement the RegistrationFormUniqueEmail subclass. I have a new project and installed django-registration. I got some templates wich work well. Now I want, that E-Mail addresses are unique. For that in the forms-documentation is mentioned, that there is a

Re: How to design a new website? (about apps)

2009-07-21 Thread Léon Dignòn
I found it, it's really really great!! http://www.youtube.com/watch?v=A-S0tqpPga4 On Jul 22, 12:30 am, Javier Guerra <jav...@guerrag.com> wrote: > On Tue, Jul 21, 2009 at 10:19 PM, Léon Dignòn<leon.dig...@gmail.com> wrote: > > These questions I would love to see answer

How to design a new website? (about apps)

2009-07-21 Thread Léon Dignòn
Ok, I have finished the tutorials and learned a lot about Django. I created a polls application and tuned the admin site, etc. Now I want to continue in a bigger application. After some successful coding I ran into a big problem not covered by any piece of documentation out there: 1. Do I need

Re: django profiles :: choices form?

2009-07-21 Thread Léon Dignòn
You might take a look at this: http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields models.py class Foo(models.Model): GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female'), ) gender =

MEDIA_ROOT and file uploads

2009-07-20 Thread Léon Dignòn
Hello everybody, I created an upload form with the help of the docs. http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#topics-http-file-uploads But the handle_uploaded_file() bugs me a little bit. I set MEDIA_ROOT (MR) in the settings.py to an existing directory. I thought that