m2m relation just working in one direction

2013-02-24 Thread Roberto López López
Hi, I have a problem involving a relation between two entities, Person and Group. from django.contrib.auth.models import User from django.db import models class Group(models.Model): employees = models.ManyToManyField('staff.Person', related_name='groups') leader = mod

Re: m2m relation just working in one direction

2013-02-24 Thread Roberto López López
gt; mixed up with the contrib.auth group. I would try changing the name of > my group temporarily to something else just to eliminate that. > > Mike > > On 25/02/2013 8:58am, Roberto López López wrote: >> Hi, >> >> I have a problem involving a relation between

Re: Begginer

2013-02-27 Thread Roberto López López
Try https://docs.djangoproject.com/en/1.5/intro/ On 02/27/2013 09:29 AM, Akshay Ramesh wrote: > Hi I am new to Djnago and would like to have some help from you. Where > should I start from ? > -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Redirect and execute after 2 seconds?

2013-02-27 Thread Roberto López López
gt; For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind regards, Roberto López López System Developer Parallab, Uni Computing Høyteknologisenteret, Thormøhlensgate 55 N-5008 Bergen, Norway Tel:(+47) 555 84091 -- You received this message because you are

Re: Redirect and execute after 2 seconds?

2013-02-27 Thread Roberto López López
opt_out>. >> >> > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegrou

Re: problem in displaying data on html

2013-02-28 Thread Roberto López López
-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind regards, Roberto López López System Developer Parallab, Uni Computing Høyteknologisenteret, Thormøhl

Re: Use variable in my template?

2013-02-28 Thread Roberto López López
cr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind regards, Roberto López López Syste

Re: Use variable in my template?

2013-02-28 Thread Roberto López López
; > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, s

models i18n

2013-03-05 Thread Roberto López López
Hi guys, I am developing a django application and between my requirements there is being able to set the model fields into different languages. For example: class Employee(models.Model): position = models.CharField() # etc. The employee position won't be the same in English and Spanish.

Re: reverse foreign key relationship usage

2013-03-06 Thread Roberto López López
; an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind

i18n

2013-03-06 Thread Roberto López López
Hi, I am setting up i18n in my django app. I have added the following to my settings.py: PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) LOCALE_PATHS = ( os.path.join(PROJECT_PATH, 'locale'), ) LANGUAGES = [ ('en', _('English'))

Re: models i18n

2013-03-06 Thread Roberto López López
at 10:31 PM, Roberto López López <mailto:roberto.lo...@uni.no>> wrote: > >> Hi guys, >> >> I am developing a django application and between my requirements there >> is being able to set the model fields into different languages. >> >> For

Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López
ved this message because you are subscribed to the Google > Groups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googleg

Re: models i18n

2013-03-07 Thread Roberto López López
Yes, I meant that. It works great, and fits perfectly my needs. I give it an AAA+ Thanks again. On 03/07/2013 02:58 PM, Johan ter Beest wrote: > > On Mar 6, 2013, at 4:20 PM, Roberto López López wrote: > >> >> Thanks for your suggestion Johan. >> >> Just

Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López
not understand what the error indentation means. > I am new to django, coming from PHP. > I was using touch, because unlike PHP, I wanted changes to show without > kicking users off. > now I am afraid to use touch. > > > On Thursday, March 7, 2013 8:54:15 AM UTC-5, R

Re: I screwed up my django site using touch

2013-03-07 Thread Roberto López López
If you are using pycharm, you just need to use the local history to check which indents you have changed. (right click over the file you want to check - local history - show history - ...) On 03/07/2013 03:58 PM, frocco wrote: > The problem with the stack trace, is that I could not tell what vi

django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Hi, How can I iterate over several list objects available in my template? I'd like to avoid having to concatenate them in the view and pass that as another parameter. I mean something like this: {% for x in list1, list2, list3... listN %} {% if not forloop.first %}, {% endif %}write som

Re: django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Thank you very much! On 03/08/2013 03:12 PM, Javier Guerra Giraldez wrote: > On Fri, Mar 8, 2013 at 5:07 AM, Roberto López López > wrote: >> I'd like to avoid having to concatenate them in the view and pass that >> as another parameter. > > > two ideas come

field lookups problem

2013-03-22 Thread Roberto López López
Hi, I have a problem with my data model while doing field lookups. This is my models.py: from django.db import models, IntegrityError # Create your models here. class Model1(models.Model): title = models.CharField(max_length=15) models2 = models.ManyToManyField('Model2', through='Thro

Re: field lookups problem

2013-03-22 Thread Roberto López López
/2013 05:02 PM, akaariai wrote: > On 22 maalis, 15:44, Roberto López López wrote: >> Hi, >> >> I have a problem with my data model while doing field lookups. This is >> my models.py: >> >> from django.db import models, IntegrityError >> >> # Creat

WSGIPythonPath and

2013-04-11 Thread Roberto López López
Hi everyone, We are trying to deploy a django application on our apache server (mod_wsgi) following https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/ We have different virtualhosts defined as well in httpd.conf. We are now stuck, apache is throwing the following error: WS

Re: WSGIPythonPath and

2013-04-11 Thread Roberto López López
pinosa" <mailto:jlouis.espin...@gmail.com>> wrote: > > Do all your sites share the same Python, or are they in different > virtualenvs? > > -- > Joey "JoeLinux" Espinosa > Python Developer > http://about.me/joelinux > &

Re: WSGIPythonPath and

2013-04-12 Thread Roberto López López
7;ve implemented this solution myself. >> >> -- >> Joey Espinosa >> Python Developer >> http://about.me/joelinux >> >> On Apr 11, 2013 5:20 PM, "Roberto López López" > <mailto:roberto.lo...@uni.no>> wrote: >> >> >> Hi J

django-guardian VS django admin

2013-04-28 Thread Roberto López López
Hi, I have problems setting up django-guardian to work properly in my web application. Object permissions seem to be correct after testing with the django shell, but somehow admin doesn't seem to react to the permission system. I have a Department model: class Department(models.Model):

form validation

2013-05-11 Thread Roberto López López
Hi everyone, I need to do some validation in my model. So far, I have been able to validate normal forms, but I want to validate forms with an inline, to ensure that at least one of those inlines match the requirement. My code: class PDMAdminForm(ModelForm): class Meta:

Re: form validation

2013-05-11 Thread Roberto López López
Problem solved with BaseInlineFormSet.clean() :-) On 05/11/2013 06:56 PM, Roberto López López wrote: > > Hi everyone, > > I need to do some validation in my model. So far, I have been able to > validate normal forms, but I want to validate forms with an inline, to > ensure

Re: Pls help me

2013-05-15 Thread Roberto López López
http://groups.google.com/group/django-users?hl=en > <http://groups.google.com/group/django-users?hl=en>. > For more options, visit > https://groups.google.com/groups/opt_out > <https://groups.google.com/groups/opt_out>. > >

m2m_changed signal registration

2013-06-18 Thread Roberto López López
Hi, I am having trouble registering a function to the m2m_changed signal. My code is as follows: 1. from django.db.models.signals import m2m_changed 2. from django.db import models 3. from django.dispatch.dispatcher import receiver 4. 5. class Project(models.Model): 6. employees = models.M

Re: m2m_changed signal registration

2013-06-18 Thread Roberto López López
Btw I have opened a stackoverflow thread: http://stackoverflow.com/questions/17149305/post-save-signal-and-relations At the beginning I was thinking of using a post_save signal, but an user there suggested me to better use the m2m_changed. On 06/18/2013 04:12 PM, Roberto López López wrote

countries phone prefixes

2013-06-20 Thread Roberto López López
Hi, I need a sort of prepopulated foreign key with countries and their phone prefixes, to add to my models. Does anyone know any 3rd party package or service providing this? Thanks. Cheers, Roberto -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: countries phone prefixes

2013-06-20 Thread Roberto López López
Ok, answering my own question: django-country-dialcode On 06/20/2013 11:35 AM, Roberto López López wrote: > Hi, > > I need a sort of prepopulated foreign key with countries and their phone > prefixes, to add to my models. Does anyone know any 3rd party package or > service

redirection problem

2013-06-26 Thread Roberto López López
Hi, After creating an object from the admin interface I'm redirected to a "localized" version of the url. For example, if the original url is http://127.0.0.1:8000/admin/project/project/2/ , I'm redirected to http://127.0.0.1:8000/en/admin/project/project/2/ . I suppose this has to do with the m

Re: redirection problem

2013-06-26 Thread Roberto López López
Update: if I disable 'django.middleware.locale.LocaleMiddleware', it's not redirecting anymore. But I need to have i18n support in my website! Any idea? On 06/26/2013 05:09 PM, Roberto López López wrote: > Hi, > > After creating an object from the admin inter

how to properly use the m2m_changed signal?

2013-06-28 Thread Roberto López López
Hi, I am trying to listen to the m2m_changed signal on my models, but I can't make it work. Even the execution flow does not reach the linked method! class Project(models.Model): departments = models.ManyToManyField('department.Department', related_name='projects',

Re: how to properly use the m2m_changed signal?

2013-06-28 Thread Roberto López López
I have tried as well using the post_save signal and overriding the save() method. But in none of those cases Project.departments is populated yet when reaching my code :-/ On 06/28/2013 11:50 AM, Roberto López López wrote: > > Hi, > > I am trying to listen to the m2m_changed

Re: Django-admin-tools unicode problem

2013-06-28 Thread Roberto López López
.com/groups/opt_out. > > > > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.co

Re: Help in finding how to learn Django

2013-06-28 Thread Roberto López López
..@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind regards, Roberto López López System Developer Paral

Re: how to properly use the m2m_changed signal?

2013-06-28 Thread Roberto López López
I am doing tests and the m2m_changed signal seems to work perfectly as long as I have not defined a "through" model. Is there any trick here? Thanks! On 06/28/2013 12:14 PM, Roberto López López wrote: > > I have tried as well using the post_save signal and overriding the >

Re: how to properly use the m2m_changed signal?

2013-06-28 Thread Roberto López López
Changing the m2m_changed signal on Project.departments.through to post_save on ProjectDepartmentMembership did the trick. m2m_changed signal seems to work as long as you don't explicitly define the "through" model. On 06/28/2013 02:06 PM, Roberto López López wrote: > >

Re: What is the best practice to learn Django 1.5?

2013-06-28 Thread Roberto López López
-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Kind regards, Roberto López López System Developer Parallab, Uni Computing Høyteknologisenteret, Thormøhlensgat

Re: Error.

2013-07-27 Thread Roberto López López
ails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. >

Re: Error.

2013-07-27 Thread Roberto López López
Well, I suppose you are running that locally or have access to the server. So show the logs. On 07/27/2013 01:40 PM, Nigel Legg wrote: > > I have provided all the information I have. That's all there is on the > screen in the browser. There is no trace. > > On 27 Jul 2013 1

Re: flatpages-tinymce

2013-07-28 Thread Roberto López López
On 07/28/2013 08:35 AM, Karl Arunachal wrote: > || -- Roberto López López System Developer Parallab, Uni Computing +47 55584091 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rec

Re: flatpages-tinymce

2013-07-28 Thread Roberto López López
e from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.go

Re: working with images in django

2013-07-28 Thread Roberto López López
egroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Roberto López López System Developer Parallab, Uni Computing +47 5

Re:

2013-08-21 Thread Roberto López López
his group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.co

Re: New field in django

2013-09-08 Thread Roberto López López
You have to fake the migration. On 09/08/2013 09:12 PM, Harjot Mann wrote: > I am trying to add a new field to model class in django using south > but when I am running ./manage.py migrate app, I am getting this error > http://202.164.53.122/~harjotmann/southerror > -- Roberto

m2m_changed signal not caught

2013-09-17 Thread Roberto López López
Hi, I need to use the m2m_changed signal to assign permissions over an object. But somehow, I cannot make it work. To summarise, my models.py is as follows: from cmsplugin_news.models import News from django.contrib.auth.models import Group from django.db import models from guar

Re: m2m_changed signal not caught

2013-09-17 Thread Roberto López López
ou edit the relationship > from a *News* model form, you need to hook it up > ("sender=News.department.through"). > > On Sep 17, 2013, at 3:59 AM, Roberto López López <mailto:roberto.lo...@uni.no>> wrote: > >> >> Hi, >> >> I need to use the m2m_c

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-25 Thread Roberto López López
roups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/d

django admin: integrate django-modeltranslation + django-ckeditor into 3rd party module

2013-09-26 Thread Roberto López López
Hi, I want to integrate django-modeltranslation into the cmsplugin_news package. I mean, register some fields in the News class to have a translation in the DB for each of the settings.LANGUAGES defined. class NewNewsForm(forms.ModelForm): class Meta: model = News

KeyError: Key 'slug' not found in Form

2013-09-28 Thread Roberto López López
Hi, I am trying to translate my model using django-modeltranslation and the SlugField is giving me a lot of trouble. I have successfully registered the fields for translation, as you can see in the db table description: | Table "public.news_news" Column

model inheritance

2013-10-02 Thread Roberto López López
Hi, I am extending a 3rd party model in my application, using multi-table inheritance. I can create an instance and modify it, but when I try to list the created objects at http://localhost:8000/en/admin/news/news/ , I am getting a nice exception: Traceback: File "/home/roberto/.virt

Re: model inheritance

2013-10-02 Thread Roberto López López
ani > Author of The Digital Cat <http://lgiordani.github.com> > My profile on About.me <http://about.me/leonardo.giordani> - My GitHub > page <https://github.com/lgiordani> - My Coderwall profile > <https://coderwall.com/lgiordani> > > > 2013/10/2 Robe

Re: model inheritance

2013-10-02 Thread Roberto López López
y GitHub > page <https://github.com/lgiordani> - My Coderwall profile > <https://coderwall.com/lgiordani> > > > 2013/10/2 Roberto López López <mailto:roberto.lo...@uni.no>> > > Hi, > > I am extending a 3rd party model in my application, using &

Re: Django Pagination

2013-10-03 Thread Roberto López López
legroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/e7e37ad2-281c-41f4-a0b9-b333294fe1b8%40googlegroups.com. > For more options, visit https://groups.google.com/group

Re: Django Pagination

2013-10-03 Thread Roberto López López
ps.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/e7e37ad2-281c-41f4-a0b9-b333294fe1b8%40googlegroups

Re: Django Pagination

2013-10-03 Thread Roberto López López
On 10/03/2013 04:13 PM, Roberto López López wrote: > *return HttpResponse(json.dumps([players]) , > content_type='application/json')* better without the square brackets *return HttpResponse(json.dumps(players) , content_type='application/json')* -- Roberto Ló

proper way to override text plugin widget

2013-10-07 Thread Roberto López López
Hi, The users of my project prefer ckeditor, so I am wondering how to use it for cms.plugins.text . I am already making use of django-ckeditor in other parts of the application. Can anyone enlighten me please? Thanks, Roberto -- You received this message because you are subscribed to the Goo

Re: proper way to override text plugin widget

2013-10-07 Thread Roberto López López
wrong list, sorry :-( On 10/07/2013 11:23 AM, Roberto López López wrote: > Hi, > > The users of my project prefer ckeditor, so I am wondering how to use it > for cms.plugins.text . I am already making use of django-ckeditor in > other parts of the application. Can anyone enli

readonly_fields depending on request

2013-10-10 Thread Roberto López López
Hi, In my project I make use of django-admin. I need to have different readonly_fields depending on the user is connected, thus administrators will be able to modify all fields, and other users less fields. Which method do I have to override? I have already tried ModelAdmin.get_readonly_fields() a

Re: readonly_fields depending on request

2013-10-10 Thread Roberto López López
_superuser: return readonly else: import itertools return itertools.chain(readonly, ('is_featured',)) On 10/10/2013 02:45 PM, Roberto López López wrote: > Hi, > > In my project I make use of django-admin. I need to have different > reado

Re: readonly_fields depending on request

2013-10-10 Thread Roberto López López
rm()? It should be the > solution. > > > > On Thu, Oct 10, 2013 at 9:45 AM, Roberto López López > mailto:roberto.lo...@uni.no>> wrote: > > Hi, > > In my project I make use of django-admin. I need to have different > readonly_fields depending on the user

Re: readonly_fields depending on request

2013-10-15 Thread Roberto López López
_featured', )/, the user can check/uncheck the box in the admin interface. Do you see any flaw here? Thanks again! Roberto On 10/10/2013 04:52 PM, Timothy W. Cook wrote: > On Thu, Oct 10, 2013 at 10:04 AM, Roberto López López > mailto:roberto.lo...@uni.no>> wrote: &

Re: New to Django

2013-10-15 Thread Roberto López López
oyd Dube > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-users+unsubscr...@googlegroups.com. > To post to this group

Re: Defining new project as a service at nignx

2013-10-15 Thread Roberto López López
s+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/ef9db670-7a3a-4b84-

Re: Django storage engine

2013-11-07 Thread Roberto López López
Which is the question? On 07. nov. 2013 09:15, Harjot Mann wrote: Is using the InnoDb storage engine as default as per my knowledge in MySql MyISAM is the default storage engine. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Django Admin Page not working

2014-02-12 Thread Roberto López López
ango-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/860138ae-d915-493d-9643-2148842eb724%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -