Re: HttpResponseRedirect vs render_to_response

2014-05-18 Thread Daniel Roseman
On Sunday, 18 May 2014 20:15:26 UTC+1, Colin Ma wrote: > > Hello, I know there are a bunch of threads on this topic (on stacked > overflow at least), but I am having trouble understanding something. > In this post: > > >

Re: Django csv export from two objects

2014-05-16 Thread Daniel Roseman
On Friday, 16 May 2014 12:34:52 UTC+1, hito koto wrote: > > Hi, > > I would like to export the csv file as follows: > > No name > date > time of attendance > time of leavework > 01 > hito > 2014/5/16 10:31:50 20:30 > 01 > hito > 2014/5/16 10:56:23 20:30 01 > hito > 2014/5/16 10:19:59 20:30

Re: Django csv export from two objects

2014-05-16 Thread Daniel Roseman
On Friday, 16 May 2014 10:40:50 UTC+1, hito koto wrote: > > Hello, > > I want to export csv from the two objects > I have the erroe is here: > Exception Type: AttributeError Exception Value: > > 'QuerySet' object has no attribute 'id' > > > > > This is my the views.py : > > def

Re: Django case, when, then on querysets

2014-05-14 Thread Daniel Roseman
On Wednesday, 14 May 2014 01:20:39 UTC+1, Anthony Hawkes wrote: > > Thanks for the answer! Do you think it would be practical to let the orm > generate the base query and then doing a replace on the column name? I was > thinking of this approach as a custom manager method to return a raw result.

Re: Action without URL

2014-05-08 Thread Daniel Roseman
On Thursday, 8 May 2014 12:35:22 UTC+1, Karino Kang wrote: > > Dear all, > > I'm a relatively new user of Django and I'm struggling to do something I'm > not sure is possible with Django. > > I wanted to develop a "like" app which act pretty much like the facebook > "like" except that you can

Re: Django Linking Multiple Mysql tables with unique identifiers

2014-05-07 Thread Daniel Roseman
On Tuesday, 6 May 2014 23:06:16 UTC+1, G Z wrote: > > Easier to be red > > Ok so I have three tables in my database Customer Vms and Vmspecs > > Vms is tied through customer by customer id through database id field and > vmspecs is tied to vms through the id field for Vms. However when I go into

Re: Django

2014-04-23 Thread Daniel Roseman
Why have you posted screenshots of text to a text-based newsgroup? Please copy and paste the relevant text into a message (the Django error page even has a special link to go to a copy and paste view). -- DR. -- You received this message because you are subscribed to the Google Groups

Re: Django i18n questions

2014-04-11 Thread Daniel Roseman
On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote: > > Documentation > says, > > that: > > ...it looks for a django_language key in the current user’s session > > This is the

Re: About Django CentOS Apache

2014-04-09 Thread Daniel Roseman
On Wednesday, 9 April 2014 12:44:29 UTC+1, Choro H wrote: > > i have the following error, why? Please help me > ImportError: Could not import settings 'kanre.settings' (Is it on > sys.path? Is there an import error in the settings file?): No module named > kanre.settings > ImportError: Could

Re: New to Django - How to add inline object to the parent object via shell command or scripts

2014-04-05 Thread Daniel Roseman
On Saturday, 5 April 2014 09:21:38 UTC+1, H. Pham wrote: > > I am trying to learn how to use Django. > Then you should read the tutorial. > I created 2 very simple models: > > models.py > > class Course(models.Model): > name = models.CharField(max_length=100) > instructor =

Re: Use custom HTML to render forms

2014-04-01 Thread Daniel Roseman
On Tuesday, 1 April 2014 00:40:44 UTC+1, Fred DJar wrote: > > HELP PLEASE > No. You don't get to demand that people help you. If someone knows the answer to your question, and they have time to answer - and if they can work out what you're asking, which isn't obvious - they will reply. But if

Re: Get secret key from django settings

2014-03-25 Thread Daniel Roseman
On Tuesday, 25 March 2014 06:36:53 UTC, Errfan Wadia wrote: > > Hi, > > I am using from django.conf import settings > Is there any faster way to get the SECRET_KEY in one of my app from > settings.py ? > What do you mean, faster? In what way is that slow? -- DR. -- You received this message

Re: Django Tutorials: NoReverseMatch at /polls/1/vote/

2014-03-21 Thread Daniel Roseman
On Thursday, 20 March 2014 23:07:47 UTC, wasingej wrote: > > I am trying to create the project described by the Django Tutorials. > However, I have reached a problem that I am stuck on after implementing > the voting forms described in tutorial 4 ( >

Re: Different content type objects in django template

2014-03-06 Thread Daniel Roseman
On Thursday, 6 March 2014 18:33:36 UTC, Robin Lery wrote: > > I am having a hard time to understand ContentType. I am learning from a > tutorial, this is the link . I have synced the database, and its working in > the admin. But when I try to load the ContentType objects in the template, > I

Re: Trouble with Django in production server.

2014-03-04 Thread Daniel Roseman
On Tuesday, 4 March 2014 00:54:48 UTC, Omar Acevedo wrote: > > Also there's a file called .bashrc which activates the virtualenv. > This is the line that does that: > source /home/userName/.env/env/bin/activate > So it runs (the virtualenv) always. > But the web server is not running as you!

Re: [ELI5] how to deploy django

2014-03-04 Thread Daniel Roseman
On Tuesday, 4 March 2014 16:53:32 UTC, Walter Wang wrote: > > Thanks alot for all your answers, I really appreciate it. > > I am using ubuntu 12.04 lts hosted on digitalocean. Apache version is > 2.2.2 and django is 1.6, I created a virtualenv in the home directory, > named myproject, I am using

Re: [ELI5] how to deploy django

2014-03-04 Thread Daniel Roseman
On Tuesday, 4 March 2014 07:28:04 UTC, Sam Lai wrote: > > On 4 March 2014 14:36, Walter Wang > wrote: > > I tried my best to follow the various guides out there, but the > official > > documentation here > >

Re: View function and URL Conf basic question

2014-02-26 Thread Daniel Roseman
On Wednesday, 26 February 2014 08:10:40 UTC, ApathyBear wrote: > > I am brand new to Django, so bare with me. > > I am a little confused with this example shown in the Django book: > > Here is my urls.py: > > from django.conf.urls.defaults import *from mysite.views import hello, >

Re: heroku better for django?

2014-02-13 Thread Daniel Roseman
On Thursday, 13 February 2014 20:47:58 UTC, Malik Rumi wrote: > > Glyn, I am following your guide but when I get to LoadModule I have run > into 'Permission Denied'. As soon as I finished with 'make install' the > system reported back that wsgi.so was chmod 644. I tried sudo chmod o+w and > did

How to use djblets (I get error)

2014-02-09 Thread Daniel Roseman
So, given the error is in the template, you didn't think it would be a good idea to post that, instead of a load of other code? You have probably forgotten to do {% load static %}. Nor this has nothing to do with djblets. -- DR. -- You received this message because you are subscribed to the

Re: Argument passing between views

2014-02-02 Thread Daniel Roseman
On Sunday, 2 February 2014 09:11:32 UTC, SAHIL SHEKHAWAT wrote: > > I have a variable generated in a view and i want to pass it as an > argument to another view. > Both views have their urls so, i can't use GET request. > I want to create invisible fields and pass it using POST request. > Also,

moving from sqlite3 to mysql

2014-01-28 Thread Daniel Roseman
You're confusing databases with tables. Django will create the tables for you, but they need a database to go in You need to create that yourself with the simple CREATE DATABASE command in mysql. -- DR. -- You received this message because you are subscribed to the Google Groups "Django

Re: Questions about how Django handles user authentication.

2014-01-20 Thread Daniel Roseman
On Monday, 20 January 2014 05:35:40 UTC, Chen Xu wrote: > > Hi Everyone, > I am wondering how request.User get set during the authentication, do we > have to do anything like: > > request.User = User() or it will have value by itself? > > > Thanks in advance. > -- > ⚡ Chen Xu ⚡ > Did you

Re: session modification question

2014-01-18 Thread Daniel Roseman
On Saturday, 18 January 2014 17:11:56 UTC, Spork Spork wrote: > > Hi, > > I have a question about what gets persisted when session data gets > updated. I've read the sessions chapter of the book, and it's not entirely > clear to me. > > Say I have two keys in the session object that I'm

Re: DecimalField Problem

2014-01-08 Thread Daniel Roseman
On Wednesday, 8 January 2014 16:47:52 UTC, Erik Cederstrand wrote: > > Den 08/01/2014 kl. 17.11 skrev Timothy W. Cook : > > > > But one would think that if Django calls it a decimal field, it would > convert the float to decimal. > > I suppose I'll do that before writing it

Re: Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread Daniel Roseman
On Wednesday, 8 January 2014 05:16:32 UTC, David Nides wrote: > > Greeting, > > I am trying to bind a jQuery grid to MySql database using PHP and serve up > using Django. I am a complete noob to web dev and Django. I followed the > directions > on JQuery's >

Re: Django GenericRelation not working

2014-01-03 Thread Daniel Roseman
On Thursday, 2 January 2014 21:09:22 UTC, arthur...@gmail.com wrote: > > I have the following model in my app, using the content-type django > framework in version 1.6.1 : > > class GenericMedia(models.Model): > limit = models.Q(model = 'Image') | models.Q(model = 'Video') | >

Re: NameError "SignUpAdmin"

2014-01-03 Thread Daniel Roseman
On Friday, 3 January 2014 03:02:30 UTC, Eddie29 wrote: > > Hi Guys, > I am really new to Django and Python. I have recently started learning > them from a course on Udemy and I got stuck on the first example, making a > web app. I'm not sure what I have done wrong but when I run my Django >

Re: Using input for an IntegerField

2013-12-28 Thread Daniel Roseman
On Saturday, 28 December 2013 20:12:24 UTC, Cody Scott wrote: > > I have a model with an IntegerField and I would like to display the model > form for it with a input. > > With the following code I get an error : > > 'ChoiceField' object has no attribute 'is_hidden' > > > Here is a minimal

Re: Django session question.

2013-12-25 Thread Daniel Roseman
Did you Google "Django sessions" before posting? Or even look on the Django documentation index for any page entitled "sessions", such as this one: https://docs.djangoproject.com/en/1.6/topics/http/sessions/ ? -- DR. On Tuesday, 24 December 2013 22:30:08 UTC, Chen Xu wrote: > > I am working on

Re: invalid syntax (urls.py, line 10)

2013-12-12 Thread Daniel Roseman
On Thursday, 12 December 2013 13:33:47 UTC, MikeKJ wrote: > > Warning: This is a port from 0.97 to 1.3.7 (thanks DR) > > The front end of the site is working just the admin is being difficult > SyntaxError at /admin/honorary/member/ > > invalid syntax (urls.py, line 10) > location >

Re: ManyToMany field creation problem

2013-12-06 Thread Daniel Roseman
On Friday, 6 December 2013 19:15:32 UTC, Mrinmoy Das wrote: > > Hi Daniel, > > I can always add a field manually, question is why does not south does it. > :) > > Mrinmoy Das > http://goromlagche.in/ > Sigh. One last time, then. There is no other field. A many-to-many relationship is *only* a

Re: ManyToMany field creation problem

2013-12-06 Thread Daniel Roseman
As I've already said, you don't need any help. If the through table is created, *that is all you need*. -- DR. -- 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

Re: ManyToMany field creation problem

2013-12-06 Thread Daniel Roseman
On Friday, 6 December 2013 07:44:27 UTC, Mrinmoy Das wrote: > > Hi, > > I have these tables > > > on apps/common/models.py > > > class UnitType(models.Model): > title = models.CharField(max_length=50) > > def __unicode__(self): > return u'%s' % self.title > > class

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Daniel Roseman
On Thursday, 5 December 2013 12:23:52 UTC, Matt Lind wrote: > > Ok, I get what what you're saying, but I seem to be having a heck of a > time getting the randDir passed into the instance to perform the upload. > > Here is the new code snippets: > > views.py > instance = Upfile( file = file) >

Re: GET and POST in forms. Please help me understand the logic!

2013-11-28 Thread Daniel Roseman
On Thursday, 28 November 2013 03:24:11 UTC, Andrew Taylor wrote: > > Hi, > > I'm struggling with the concepts of get and post and where these status > come from in the workflow. I have worked my way through the official pages > on forms but I have not quite understood this to my satisfaction. >

Re: MultiValueDictKeyError editing inlineformset

2013-11-26 Thread Daniel Roseman
On Tuesday, 26 November 2013 12:43:56 UTC, Ariel Calzada wrote: > > hi i'm getting MultiValueDictKeyError while editing InlineFormset any idea? > > Regards, > > -- > Ariel Calzada > Homepage: >

Re: Form cleaned_data

2013-11-26 Thread Daniel Roseman
On Monday, 25 November 2013 21:42:51 UTC, Timothy W. Cook wrote: > > On Mon, Nov 25, 2013 at 8:22 AM, Daniel Roseman > <dan...@roseman.org.uk> > wrote: > > On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote: > >> > >> On Sun, No

Re: Form cleaned_data

2013-11-25 Thread Daniel Roseman
On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote: > > On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman > <dan...@roseman.org.uk> > wrote: > > Hmm, I tried to post an answer to your original question earlier but it > never appeared. > > > >

Re: How to use modpython in django version 1.5

2013-11-25 Thread Daniel Roseman
On Monday, 25 November 2013 06:01:35 UTC, Russell Keith-Magee wrote: > > > On Mon, Nov 25, 2013 at 1:39 PM, nobody >wrote: > >> Hi, >> >> After version 1.5, django has disabled mod_python. Can we still use the >> modpython instead of mod_wsgi? If so, how can we install

Re: how to get at the manytomany fields in for

2013-11-24 Thread Daniel Roseman
No, that is incorrect. `dir_list` is a queryset of AdviceLevel objects, and `specialism` is a field defined directly on that model. You only need to add `_set` for a reverse relationship, which this isn't. -- DR. -- You received this message because you are subscribed to the Google Groups

Re: Form cleaned_data

2013-11-24 Thread Daniel Roseman
Hmm, I tried to post an answer to your original question earlier but it never appeared. The reason why adding the values to `cleaned_data` doesn't work is that those fields aren't in the `fields` list for the form in the first place, so it doesn't know to do anything with them. Adding them to

Re: how to get at the manytomany fields in for

2013-11-22 Thread Daniel Roseman
On Friday, 22 November 2013 10:53:42 UTC, MikeKJ wrote: > > Got this model > class AdviceLevel(models.Model): > advice = models.ForeignKey(Advice) > organisation = models.ForeignKey(Organisation) > specialism = models.ManyToManyField(Specialism, null=True, blank=True) >

Re: CreateView and get_context_data()

2013-11-22 Thread Daniel Roseman
On Friday, 22 November 2013 13:13:46 UTC, Timothy W. Cook wrote: > > Lucas, > > On Fri, Nov 22, 2013 at 9:58 AM, Lucas Magnum > > wrote: > > Timothy, > > The "get_context_data" is called in get method, once you override it > > "get_context_data" isn't called anymore. >

Re: Model Design: Adding Params to Relationship FIelds

2013-11-21 Thread Daniel Roseman
On Wednesday, 20 November 2013 22:49:28 UTC, Thomas Murphy wrote: > > Hi all, > > I'm working on a hour-reporting system. > > Each Project has many Users, and each User has many Projects(These are > established and working nicely). > > My design issue is this: > How can I assign each User an

Re: Using Aggregate and Count

2013-11-21 Thread Daniel Roseman
On Thursday, 21 November 2013 00:49:52 UTC, Timothy W. Cook wrote: > > Does the fact that I use a relat_name on the Review.paper field have > anything to do with it not working? > > In the Review model, notice: > paper = models.ForeignKey(Paper, verbose_name=_('Paper'), >

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 20:04:13 UTC, Timothy W. Cook wrote: > > Hi Daniel, > > On Wed, Nov 20, 2013 at 5:47 PM, Daniel Roseman > <dan...@roseman.org.uk> > wrote: > > On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > >

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > I see there was a similar question on this issue earlier today but > alas it didn't answer my question. > > In my app I have models for: > Project: a project (not really part of this question but used for > context in the

Re: wsgi vs. debug server URL's

2013-11-13 Thread Daniel Roseman
On Tuesday, 12 November 2013 17:42:06 UTC, fred wrote: > We deploy with Apache and it serves both django and generic html. We > are a small shop with internal applications and minimal server load and we > are not ready to have a django server and an html server. > > > > I use the /wsgi

Re: How can I use {% for ROW in LIST %} within

2013-11-13 Thread Daniel Roseman
On Wednesday, 13 November 2013 00:46:55 UTC, Pepsodent Cola wrote: > How can I use *{% for ROW in LIST %}* within

Re: Why serializer only works for QuerySet

2013-11-03 Thread Daniel Roseman
On Sunday, 3 November 2013 18:09:49 UTC, Leon Sasson wrote: > Django serializer works really well when you need to serialize a QuerySet, > but often times I need to serialize a JSON object with more than just a > QuerySet. > This leads me to serialize the QuerySet, and then load it again to a

Re: New to django,need help! just trying to retrieve values from a template to a view.py (ie user may input text, make choice selection, select a radio button value)

2013-10-31 Thread Daniel Roseman
On Wednesday, 30 October 2013 20:17:17 UTC, pete wrote: > Hi > New to django,need help! just trying to retrieve values from a template > to a view.py (ie user may input text, make choice selection, select a > radio button value) > like to know the poll list section, market selection, coupon

Re: Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Daniel Roseman
On Monday, 28 October 2013 15:11:24 UTC, Joshua Orvis wrote: > Thank you for responding, that's extremely helpful. I'm still failing to > query against it though. How would I implement a query for the > get_children() method in the example above? That is, for any given > instance of

Re: Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Daniel Roseman
On Monday, 28 October 2013 07:29:39 UTC, Joshua Orvis wrote: > I'm using Django 1.6 RC1 and Python 3.3 with the following models: > > class StepBlueprint(models.Model): > parents = models.ManyToManyField('self', blank=True, null=True, > related_name='children') > name =

Re: Django ManyToMany performance?

2013-10-27 Thread Daniel Roseman
On Sunday, 27 October 2013 00:46:17 UTC+1, Ruturaj Dhekane wrote: > Hi all, > > I have a particular datastructure where there are two objects > 1. A document - and a lot of its properties - like content, version, > timestamp etc. > 2. Contributors - basically people represented by unique IDs > >

Re: source code of the Django Tutorial?

2013-10-21 Thread Daniel Roseman
On Monday, 21 October 2013 20:47:51 UTC+1, Yang Yang wrote: > the tutorial is extremely helpful: > https://docs.djangoproject.com/en/dev/intro/tutorial01/ > > but the code samples there seems to be somehow out of sync with the text, > for example some parts of the code uses the class "Poll"

Re: User Created Objects (models)

2013-10-21 Thread Daniel Roseman
On Monday, 21 October 2013 01:24:22 UTC+1, Ideo Rex wrote: > Hello, > I'm relatively new to Django. So I have a working (local) web application. > I can create new model objects from the admin site, but I would like my > users to be able to create their own objects and save them to the

Re: How to handle values_list?

2013-10-17 Thread Daniel Roseman
On Thursday, 17 October 2013 19:30:09 UTC+1, Andrew Michael wrote: > Hi, > > I am new to Django and need some help. My issue is on my web page the data > is showing up like this: [u'Green'] and I want it to only show Green - > without the unicode wrapping. Can you please explain why this is

Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2013-10-17 Thread Daniel Roseman
On Thursday, 17 October 2013 21:05:17 UTC+1, michael@farecompare.com wrote: > Hi, > > I'm trying to learn Django and Python at the same time. So I realize this > is a really simple issue for a beginner. But since I'm new to this, I could > use a little help. > > Basically, I'm going

Re: Call method of the session template

2013-10-11 Thread Daniel Roseman
On Friday, 11 October 2013 13:45:01 UTC+1, Ricardo wrote: > I understand what you say, however I know only call methods using {% url > 'app.view.func'%} or {%}% app.view.func. > As I understand this django-aap carton, the shopping cart in the session > live. If it is in session I would have >

Re: Call method of the session template

2013-10-11 Thread Daniel Roseman
On Thursday, 10 October 2013 20:29:32 UTC+1, ke1g wrote: > No. You can't pass an argument to a model method from the template. I > see two options for you: > > 1. Rework the method so that the argument is optional, and if the > argument is not provided, the method uses a reasonable default

Re: Retrieving json stored in TextField as json

2013-10-10 Thread Daniel Roseman
On Thursday, 10 October 2013 10:08:18 UTC+1, Marc Aymerich wrote: > Hi Rafael, thanks ! > I forgot to mention that I was already using django-jsonfield > https://github.com/bradjasper/django-jsonfield > and now I've tried with django-json-field but with the same unfortunate > result: > >

Re: uptodate Account_balance

2013-10-07 Thread Daniel Roseman
On Monday, 7 October 2013 18:07:49 UTC+1, MAurice wrote: > needed to no how to have a uniform account_balance figure(after > withdraw or deposit) > > On 10/7/13, Maurice J Elagu wrote: > > The signals are doin the notifications but not updating > > Please learn how to ask

403 Forbidden messages when saving items in django-admin

2013-10-06 Thread Daniel Roseman
Notice that this is the default Apache error message, not one for Django. That strongly suggests that people are being redirected away from your Django server to another, different one. Perhaps Django is running on a non-standard port, and after saving they are being redirected to the default

Re: Disabling object persistence ?

2013-10-04 Thread Daniel Roseman
On Friday, 4 October 2013 07:45:40 UTC+1, Marc'h wrote: > Hello, > > I'm battling with Django in order to try avoiding object persistence when > initialising foreign key model attributes. The app I'm using Django for > implements a facade for an already existing database. It's main purpose is

Re: Multiple versions of Django

2013-10-01 Thread Daniel Roseman
On Tuesday, 1 October 2013 04:15:37 UTC+1, Jasvir Singh wrote: > On Mon, 30 Sep 2013, Jasvir Singh wrote: > > > Is it possible to install multiple versions of Django on single ubuntu > server. > > If yes, please tell me how to do this. > @all, thanks for their help but my requirement is to

Re: How to Query account/profile information for multiple account and allowing user edit or update acount

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 19:33:31 UTC+1, Okorie Emmanuel wrote: > I have two problems > > 1. How can i populate the account >information of each user, this >what i have done but only info on >user models populates, the info on extended >field does not show on my template >

Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 18:18:00 UTC+1, Zoltan Szalai wrote: > try not to use the same value ('about') for the name attribute of the > textarea and your submit button. > not sure it helps the situation though. > > I'd say that is the exact cause of the problem, actually. -- DR. -- You

Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 15:41:47 UTC+1, Marcin Szamotulski wrote: > > I don't do anything odd: I simply modify it by typing in side textarea. > The page has a very simple JavaScript which does not do anything with > the textarea (though I double-checked that turning it off does not >

Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Sunday, 29 September 2013 22:58:38 UTC+1, Marcin Szamotulski wrote: > Dear Django users, > > The short question is: How to use Textarea widget with initial value? > The long version: I have a form with a simple Textarea widget > > class Form(forms.Form): > > f =

Re: Executing validation on entry to class-based views

2013-09-26 Thread Daniel Roseman
On Thursday, 26 September 2013 07:29:38 UTC+1, dspruell wrote: > Greetings, > > I have an app with a CBV for the main functionality that I'd like to > do some validation on config settings (in settings.py) before carrying > out the view. > > My particular view in this case is a FormWizard,

Re: Aggregation and count - only counting certain related models? (i.e. adding a filter on the count)

2013-09-25 Thread Daniel Roseman
On Tuesday, 24 September 2013 21:58:44 UTC+1, Simon Charette wrote: > Unfortunately the Django ORM's doesn't support conditionnal > aggregates > . > This is true, but completely irrelevant to the OP's question, which doesn't require them. The

Re: and keyword arguments '{u'student_id': None, u'school_id': 1}' not found.

2013-09-21 Thread Daniel Roseman
On Saturday, 21 September 2013 04:44:33 UTC+1, Trung Nguyen wrote: > Django Version:1.5.2Exception Type:NoReverseMatchException Value: > > Reverse for 'gradingstudent' with arguments '()' and keyword arguments > '{u'student_id': None, u'school_id': 1}' not found. > > Exception >

Re: migrating from django 1.3.0 to 1.5.4, getting ImproperlyConfigured exceptions (AUTH_USER_MODEL refers to model 'auth.User' that has not been installed)

2013-09-19 Thread Daniel Roseman
On Thursday, 19 September 2013 08:21:49 UTC+1, Leo wrote: > A question to better understand your problem: do you use a custom User > model in Django 1.3? > Did you perhaps set the AUTH_USER_MODEL=auth.User in your settings.py? > There was no such thing as that setting in 1.3. It's new in 1.5.

Re: migrating from django 1.3.0 to 1.5.4, getting ImproperlyConfigured exceptions (AUTH_USER_MODEL refers to model 'auth.User' that has not been installed)

2013-09-18 Thread Daniel Roseman
On Wednesday, 18 September 2013 18:51:30 UTC+1, Lauri Carpenter wrote: > We have been using django 1.3.0 for a long time. We are now trying to > migrate to 1.5.4. We have not changed any schema or model information. We > have been using two layers of middleware and backends (notably

Re: iterating over a queryset?

2013-09-18 Thread Daniel Roseman
e: > > {% for q in info %} > {% for k, v in q.items %} >{{ k }} {{ v}} > {% empty %} >no data > {% endfor %} > {%endfor%} > ? > > > > > Den onsdag den 18. september 2013 00.02.21 UTC

iterating over a queryset?

2013-09-17 Thread Daniel Roseman
Without the get(), you get a queryset, which is an iterable of all elements that match the query - in effect, a list of dicts. Even though only one record matches, you still get a queryset containing a single dict. So in order to use that in your template, you'd have to add an outer loop

Re: [Deployment + Apache2] difference between development server & production server

2013-09-15 Thread Daniel Roseman
On Sunday, 15 September 2013 07:05:19 UTC+1, hung david wrote: > I've been working with Django like 3 months and I'm trying to get my site > online with Apache2. So please forgive if this is a stupid question. > I'm gonna make this short. > On development server, when I go to, like, >

Re: url path becomes longer and longer

2013-09-13 Thread Daniel Roseman
On Friday, 13 September 2013 12:16:51 UTC+1, Christian Schulz wrote: > Hi, > > i'm wondering why after every click the url become longer. > > > In the project urls.py I have something like: > url(r'^reporting/', include('reporting.urls')), > > In the app urls.py something like: > url(r'total',

Re: form issue.

2013-09-13 Thread Daniel Roseman
On Friday, 13 September 2013 08:45:51 UTC+1, Nigel Legg wrote: > I have a form with a lot of fields in it. Users will never require data > in all fields, so most have the required = False tag: > > > [This is a good example of how the for would be used] > > When I submit the form, I get the

Re: How do I output a variable from Models.py to Detail.html?

2013-09-09 Thread Daniel Roseman
On Monday, 9 September 2013 10:24:54 UTC+1, Pepsodent Cola wrote: > This is my Models code and I want to output the contents of variable * > blackbox* to my screen. > > 1.) Do I need to write some code in Views.py to transfer my variable > "blackbox" from Models to Views to Detail.html? > 2.)

Help with templates

2013-09-05 Thread Daniel Roseman
You should not do this from the standard Python shell, but via the preconfigured Django one which is started with `manage.py shell`. Also, DON'T SHOUT. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Why does the save form order make any difrance?

2013-09-02 Thread Daniel Roseman
On Sunday, 1 September 2013 17:09:11 UTC+1, Gerd Koetje wrote: > so like this? > Can u tell me why this have to be this way? > > > You should be using formsets if you have multiple identical forms on one page. Formsets: https://docs.djangoproject.com/en/1.5/topics/forms/formsets/ Model

Re: How can I get value from a FK model?

2013-08-21 Thread Daniel Roseman
On Wednesday, 21 August 2013 20:53:36 UTC+1, Fellipe Henrique wrote: > Hi, > > I got this models: http://pastebin.com/w2TmyLzt > > First: I used db_columns because I used a legacy database from company ERP. > > I try to get, in my template the "descricao" field, in my "mercadoria" > model. but I

Re: Defining custom template tags in a new app

2013-08-20 Thread Daniel Roseman
On Tuesday, 20 August 2013 11:53:27 UTC+1, kandelabr wrote: > Hello! > > I want to define a new template tag and use it in a number of applications > inside my django project. The documentation says: > > *Custom template tags and filters must live inside a Django app. If they > relate to an

Re: Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Daniel Roseman
On Tuesday, 20 August 2013 12:10:34 UTC+1, Victor Hooi wrote: > Hi, > > 1. Hmm, in that case, using bulk_create may not work - I'm currently > relying on generating the full lists of Products and ProductImages, then > saving in a batch at the end. > > So I need to loop through and call .save()

Re: Is it possible to have 1-to-Many and 1-to-1 relationships for one specific table?

2013-08-20 Thread Daniel Roseman
On Tuesday, 20 August 2013 12:12:40 UTC+1, Pepsodent Cola wrote: > Ok let's start from the very beginning because this MVC business is making > me juggle too many balls all at once. More than I can handle and > understand. > > > ### PART A.1 > With this Filter 5 view code I get the list result

Re: Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Daniel Roseman
On Tuesday, 20 August 2013 10:57:52 UTC+1, Victor Hooi wrote: > Hi, > > *1. Bulk Creating Products/ProductImages* > > I have a Django custom management command that bulk-loads a list of > products and product images from a JSON file. > > I have a Product model, along with an ProductImage model -

Re: Is it possible to have 1-to-Many and 1-to-1 relationships for one specific table?

2013-08-20 Thread Daniel Roseman
On Tuesday, 20 August 2013 11:25:02 UTC+1, Pepsodent Cola wrote: > > But the above Detail list initially works by a 1-to-Many relationship. > When I add my 1-to-1 relationship in order to connect the votes field to > Word table then I get a bunch of weird MVC conflicts that I don't >

Re: Capturing a search query + params in Django 1.5

2013-08-17 Thread Daniel Roseman
On Saturday, 17 August 2013 20:04:22 UTC+1, Lloyd Dube wrote: > > Hi, > > I have a simple web application in which I have a search box. When a user > enters a query in the box and hits "search", they get a list of results via > a popular search API. > > My issue is that I am using

Re: Can't seem to get "votes" to work right

2013-08-16 Thread Daniel Roseman
On Friday, 16 August 2013 21:05:46 UTC+1, bud wrote: > > but now an error page came up when I tried to vote for one of the polls: > > Environment: > > > Request Method: POST > Request URL: http://127.0.0.1:8000/polls/1/vote/ > > Django Version: 1.5.1 > Python Version: 2.7.3 > Installed

Re: Can't seem to get "votes" to work right

2013-08-16 Thread Daniel Roseman
On Friday, 16 August 2013 16:40:24 UTC+1, bud wrote: > Hi, > > I've finished the Django tutorial but I just can't seem to get my "votes" > function to work right. I would start the server, go to polls, and every > time I try to vote for something, the KeyError message comes up i.e. "You >

Re: My poll doesn't work when I start using related_name, help please.

2013-08-16 Thread Daniel Roseman
On Friday, 16 August 2013 14:06:38 UTC+1, Pepsodent Cola wrote: > ### PART A > > My altword_list template file receives a primary key ID from my Index > template file. > > #___ > *altword_list.html* > > {{ poll.rosword

Re: Do we need to setup Database Settings before Using Admin feature in Django?

2013-08-15 Thread Daniel Roseman
On Wednesday, 14 August 2013 21:29:54 UTC+1, Christophe Pettus wrote: > > > On Aug 14, 2013, at 11:31 AM, Harmeet Singh wrote: > > > Can we use the built in ADMIN feature in Django by just configuring > 'django.contrib.admin' under INSTALLED_APPS in settings.py file without > configuring

Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Daniel Roseman
On Wednesday, 24 July 2013 00:26:44 UTC-7, Peter wrote: > > > Sorry, that should be: django.contrib.auth.views.password_reset > > In fact, I'm pretty sure it's this line of code in auth:: > > File "/usr/local/lib/python2.7/ > dist-packages/django/contrib/auth/views.py" in password_reset >

Re: Object Model

2013-07-24 Thread Daniel Roseman
On Wednesday, 24 July 2013 04:32:51 UTC-7, Sivaprakash Shanmugam wrote: > Hi > > I'm new to DJango framework I fairly understand how the basics works. I > want to define an object (typically getter setter in Java) in which I want > to fill data to create my own response through web service. But

Re: form.errors

2013-07-12 Thread Daniel Roseman
On Friday, 12 July 2013 14:27:31 UTC+1, Kakar wrote: > Okay! That did solved the problem. Thank you! Here's my new view.py: > > def register_page(request): > if request.method == 'POST': > form = RegistrationForm(request.POST) > if form.is_valid(): > user =

Re: Total number of flags on a comment (django.contrib.comment)

2013-07-12 Thread Daniel Roseman
On Wednesday, 10 July 2013 16:27:16 UTC+1, surya wrote: > I am using Django 1.4.5, using django.contrib.comments.. > Is there any field or model method that gives total number of flags on a > comment? > > CommentFlag is related to Comment by a ForeignKey, so you can use the normal aggregation

Re: form.errors

2013-07-12 Thread Daniel Roseman
On Thursday, 11 July 2013 23:08:25 UTC+1, Kakar wrote: > Hi, > I am learning Django from an old Django version book, and i am stuck with > a problem regarding forms. When i render forms, i get the registration > right, but if its incorrect, it does not show the error msg in the html. I > tried

Re: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Daniel Roseman
On Tuesday, 9 July 2013 14:16:59 UTC+1, Hélio Miranda wrote: > ah yes, it was me who got sick. But the code is correct > You really need to post your actual code. There are at least two other errors there ( *.get = (id = id) *and * **request.FILES.getlist*) which mean your code would not run.

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