Re: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 'myuser' model.

2015-10-14 Thread 술욱
2015-10-14 15:21 GMT-03:00 syl pingus : > Hello Norberto, > > In your first example, I think the name of your apps in the apps.py config > file conflicts with the core Django auth module and it could explains the > second exception you get. Yes. I know, that's why I added

Problem to upload image

2015-10-14 Thread Rosangela Oliveira
Hi,I need some help I have a problem when I try to upload the image in a django project, it's open the windows to upload the image twice. in HTML I did: http://shackmanlab.org/wp-content/uploads/2013/07/person-placeholder.jpg; width='125px' height='125px' style="float:left;

RE: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 'myuser' model.

2015-10-14 Thread syl pingus
Hello Norberto, In your first example, I think the name of your apps in the apps.py config file conflicts with the core Django auth module and it could explains the second exception you get. When you use a custom model in Django, the "migrate" command always create additional table for group

Re: django.contrib.auth 1.8 failed if user.pk not int

2015-10-14 Thread Petr Bondarenko
Yes. CharField(primary_key=True) When referring to RemoteApiUser._mata.pk returned this field. вторник, 13 октября 2015 г., 6:47:50 UTC+5 пользователь Tim Graham написал: > > In the traceback it appears that to_python() is being called for > AutoField, not CharField. Are you sure the custom user

Django Models Joining and Normalising

2015-10-14 Thread Yunti
I'm still relatively new to Django and now working on a project that has much more complex models than I've used before. The question is about when is it best to separate out large models into separate models (and the impact caused by joining the smaller models together and also keeping data

Re: Cron Job

2015-10-14 Thread 'Chris Norman' via Django users
Hi, Thanks for the advice. I actually found that just after writing my post. Now the cron job works perfectly. Thanks, On 10/14/2015 3:26 PM, Vijay Khemlani wrote: The easiest way would be using a custom management command

Re: Django 1.8: subclass AbstractUser, App 'auth' doesn't have a 'myuser' model.

2015-10-14 Thread 술욱
Hello Tim, yes, I need to use the custom user model. The app is now in production (Django 1.6.11). If I use settings.AUTH_USER_MODEL = 'auth.MyUser', I get the error described in my previous emails. If I change to settings.AUTH_USER_MODEL = 'myauth.MyUser', I get the following tables created:

Re: Cron Job

2015-10-14 Thread Vijay Khemlani
The easiest way would be using a custom management command https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/ On Wed, Oct 14, 2015 at 10:53 AM, 'Chris Norman' via Django users < django-users@googlegroups.com> wrote: > Hi again, > I would like to set up a cron job to email

Cron Job

2015-10-14 Thread 'Chris Norman' via Django users
Hi again, I would like to set up a cron job to email the day's journeys to a pre-defined set of email addresses, using the model I described in the previous example. I have it so I can type: python manage.py shell import journey_sender This does everything. Thing is, I would like to use

The sitemap framework documentation

2015-10-14 Thread Emre Düzer
Hi, There is an error while declaring code in the sitemap framework documentation. Incorrect statement: from django.contrib.sitemaps.view*s* import sitemap url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap') Correct statement: from

Filtering records based on date months

2015-10-14 Thread 'Chris Norman' via Django users
Hi all, I have written a Journey model, which has an out and a back field, both of which are datetime fields. What I want to do is something like: from datetime import datetime now = datetime.now() for journey in Journey.objects.filter(out__month = now.month, out__day = now.day): print

Re: Reverse access model through a “double” ForeignKey

2015-10-14 Thread Gergely Polonkai
Hello, I just solved it, and went with a @property. On Build I have: @property def values(self): return Value.objects.filter(grouping__build=self) and on the Value I have: @property def build(self): return self.grouping.build This way I stay backwards compatible and didn’t even have

Re: Logout implementation Django

2015-10-14 Thread palansh agarwal
Thank you. The problem with the cache thing. Now resolved. *Palansh Agarwal | +919461787317 * *Co-Founder*, Team Lead IDC, *GoMobileFirst, USA* *Systems/Software Dev Intern*, Instaroid , *Bangkok, Thailand* Pre Final Year, B.Tech The LNM Institute of

Re: Reverse access model through a “double” ForeignKey

2015-10-14 Thread Carsten Fuchs
Am 14.10.2015 um 11:11 schrieb Gergely Polonkai: This setup, though, doesn’t feel right, as it contains redundancy. Is there a way to access the list of Values directly from Build without having this redundancy? Well, you can filter your Value queryset by Build, see

Re: Reverse access model through a “double” ForeignKey

2015-10-14 Thread Vijay Khemlani
Value.objects.filter(grouping__build=your_build) I guess You can add it as a method to the Build class On Wed, Oct 14, 2015 at 6:11 AM, Gergely Polonkai wrote: > Hello, > > I have three models: > > • Build > • BuildGrouping, with a ForeignKey “build” pointing to Build > •

Re: If appears doesn't work in template, why?

2015-10-14 Thread Carsten Fuchs
Am 14.10.2015 um 13:36 schrieb Fellipe Henrique: But, always enter in "else"... even the record was saved with "A"... I tried with 'A' and "A", same "problem"... Any ideas, what's going on? Have you cross-checked? I.e., what is the output of {{ status }} ? Best regards, Carsten -- You

Re: Logout implementation Django

2015-10-14 Thread Andreas Kuhne
Hi, You should be able to access the website without logging in? Or do you mean that the user has access to protected pages? If you have added the login_required decorator ( https://docs.djangoproject.com/en/1.8/topics/auth/default/#the-login-required-decorator) on your view functions that

Re: Upgrade path for Django 1.4.9 to Django 1.6.0

2015-10-14 Thread Uwe Schuerkamp
Hi Mark, I recently had the same issue, I went from 1.3.x to 1.4.21 and then to 1.8.5 via 1.7.x without any major issues. Granted my application isn't too complex and doesn't use too many of Django's internal bells and whistles, but the major obstacles for me were adding some new entries to

Creating the testing db fails (django 1.8.5)

2015-10-14 Thread Uwe Schuerkamp
Hi folks, this is my first posting in this group, so I'm sorry in advance if I'm breaking any rules or missing some vital information. My setup: Ubuntu Server 14.04.x Python 2.7.6 Django 1.8.4 (updated to 1.8.5 recently) installed via "pip" MariaDB 5.5.44 I'm trying to set up a test

Solr query through Scorched/Sunburnt

2015-10-14 Thread Pippo Pluto
I have a weird problem. I'm querying a Solr 5.3 instance with Django through Scorched. It all works great as far as I don't ask an exact-match query. In other words, q=something something else returns exactly the same result as: q="something something else" The culprit, as far as I can

If appears doesn't work in template, why?

2015-10-14 Thread Fellipe Henrique
Hello, I have one model, with a Char(1) Field... in my template I use these code: But, always enter in "else"... even the record was saved with "A"... I tried with 'A' and "A", same "problem"... Any ideas, what's going on? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail:

Alphabetical list with links

2015-10-14 Thread Pippo Pluto
I have a list of people (something like, in my model: surname = models.CharField(max_length=255) firstname = models.CharField(max_length=255) I'd like to output a table for each starting letter of a surname. So, for example (in the template): {% for author in content %} {% if

Reverse access model through a “double” ForeignKey

2015-10-14 Thread Gergely Polonkai
Hello, I have three models: • Build • BuildGrouping, with a ForeignKey “build” pointing to Build • Value, with a ForeignKey “grouping” that points to BuildGrouping Right now, I also have Value.build, which is a ForeignKey to Build, so I can access the list of Values directly from a Build. This

Logout implementation Django

2015-10-14 Thread palansh agarwal
Hi, I am trying to implement logout for users in my app. My problem is : When a user logs out and clicks back button in browser he is able to access the website again without logging in. My current code for logout function is--> def logout_user(request): > del request.session['userid'] >

Re: inlineformset_factory with multiple foreignKeys

2015-10-14 Thread jupiter
No longer need it, please ignore it. On Wed, Oct 14, 2015 at 9:35 AM, jupiter wrote: > Hi, > > How can the inlineformset_factory be used for multiple following > foreignKeys at following an example? > > class Recipe(models.Model): > pub_date =