Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
Ah, that clears things up somewhat. I can certainly start using the basic View class straight away and can slowly start moving over to the generic class based views as time permits and as I get more used to them. The base View class sounds like it has all the advantages of function based vie

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
I'm about to start a new website and I'll make it a point to use some generic class based views when I think they are appropriate. I'll also try and move my custom user application that I use for all of my projects over to class based views as wells. Especially as the login() and logout() funct

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
Most views are incredibly simple. Query database, maybe do a security check on the logged in user if the data shouldn't be public or only some users / groups can view it (yeah one thing I don't use as often as I should but will be using more of in the future is the built in Django permissions s

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
my last attempt to use the FormView class based view with multiple forms on the same page and giving up in disgust because it was so much harder than doing the same thing in a function based view. Some Developer. On 02/04/2017 06:37, James Bennett wrote: If you're ask

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
doing the same thing in a function based view. Some Developer. On 02/04/2017 06:37, James Bennett wrote: If you're asking "Will there ever be a point when all built-in views in Django are class-based", the answer is "maybe", because whether to write one of those clas

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
will replicate across several views, I create my own custom generic view subclassing the |django.views.generic.View|. Regards, A. Antonis Christofides http://djangodeployment.com On 04/02/2017 06:37 AM, Some Developer wrote: Hi, I was wondering if function based views will ever be depre

Re: Will function based views ever be deprecated?

2017-04-03 Thread Some Developer
On 02/04/2017 04:37, Some Developer wrote: Hi, I was wondering if function based views will ever be deprecated? I absolutely hate class based views with a passion for various reasons (too complex, trying to solve a problem that doesn't exist etc). With a function based view I can write it

Will function based views ever be deprecated?

2017-04-01 Thread Some Developer
function based views. Please don't take this as an aggressive post. I love working with Django and I'm just passioniate about it. This isn't a flame post. Thank you for any help :). Some Developer. -- You received this message because you are subscribed to the Google Gr

Building a UNIX style permissions system in Django

2015-07-27 Thread Some Developer
I have a need for a more robust permission system for objects in Django than the one provided by it in the core distribution. I want to have users and groups and each to have read, write and edit permissions but I have no idea how to go about how to implement this. I was thinking of having a

Re: Creating model (table) inheritance in Django 1.8 using PostgreSQL

2015-07-02 Thread Some Developer
On 02/07/15 13:56, Vijay Khemlani wrote: You could dynamically create a ModelForm based on the model class: from django.forms import ModelForm MetaClass = type('Meta', (), {'model': ProductItemText}) MetaModelForm = type('ProductModelForm', (ModelForm, ), {'Meta': MetaClass}) form = MetaModel

Creating model (table) inheritance in Django 1.8 using PostgreSQL

2015-07-02 Thread Some Developer
I have a model which defines an item and many sub-models which inherit from it to define the type of the model. Something like this: Product(models.Model): owner = models.ForeignKey(settings.AUTH_USER_MODEL) name = models.CharField(max_length=255) ProductItemText(Product):

Re: Defining base templates for reusable apps

2015-05-11 Thread Some Developer
On 09/05/15 11:47, Bruno A. wrote: Hi, I've never done it, but I myself want to do a similar thing, so I've been thinking about it a bit. The solutions I've thought of are the following: * Template inheritance, as you mention. You provide the base template, but it might not be straightfor

Defining base templates for reusable apps

2015-05-08 Thread Some Developer
I'm looking into building a set of open source reusable apps for Django and was wondering what the currently accepted best practice was for defining base templates for reusable apps was? I want my reusable apps templates to be easy to slot into an already existing site design but I'm unsure of

Re: Fixing a poorly written Django website (no unit tests)

2015-03-07 Thread Some Developer
On 06/03/15 16:23, Ilya Kazakevich wrote: You may start from highest level testing: 1) create "usage scenarios" for your website. Like "customer opens page 'foo', and should see 'bar'". You use such scenarios for manual testing, right? 2) code such scenarios against Django project. You may use BD

Fixing a poorly written Django website (no unit tests)

2015-03-04 Thread Some Developer
Hi, I've been working on a Django website for about 2 months on and off and am nearing the end of development work where I can start thinking about making it look pretty and the after that deploy to production. I've been doing lots of manual testing and I'm sure that the website works correc

Re: Instructions from Django to run under Python don't work.

2015-01-18 Thread Some Developer
On 19/01/15 00:41, Lisa Jennings wrote: I keep getting syntax errors. What syntax errors? Be specific. -- 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

Re: Two QuerySets on a FormSet

2015-01-16 Thread Some Developer
On 12/01/15 20:46, Collin Anderson wrote: Hi, You can merge the two querysets like this. Would that help? | qs =Song.objects.filter(artist__made_by=request.user)|Song.objects.filter(album__made_by=request.user) | or use models.Q | fromdjango.db.models importQ qs =Song.objects.filter(Q(artist_

Two QuerySets on a FormSet

2015-01-09 Thread Some Developer
I have a model Song which has a FormSet associated with it using a ModelForm. The Song model has two ForeignKeys (Artist and Album) but I want to limit the options shown in the FormSet to only Artists and Albums made by the currently logged in user. I know to make the QuerySets themselves but

Re: FormSets with arbitary number of forms

2015-01-02 Thread Some Developer
On 01/01/15 19:52, Edgar Gabaldi wrote: The formset allow you create many instances of an object. What you need is the inline formset. When you create a Album, you can create one or more songs. Ah! Thank you. I must have missed that. I'll check it out. -- You received this message because yo

FormSets with arbitary number of forms

2014-12-31 Thread Some Developer
I've been reading the documentation on FormSets and must admit that I am a bit confused. I have a model called Album that contains many Songs. But when a user creates a new album I have no idea how many songs the Album will contain. So I want to create a FormSet that has an Album form and man

Re: Storing files to Google Cloud Storage or Amazon S3 using Python 3.4

2014-12-27 Thread Some Developer
On 27/12/14 21:47, Vijay Khemlani wrote: What error are you getting when using storages-redux? Hmm. Seems I have managed to fix it. Not entirely sure what I was doing wrong before though. Anyway for future reference django-storages-redux and the latest version of boto with Python 3.4.2 see

Storing files to Google Cloud Storage or Amazon S3 using Python 3.4

2014-12-27 Thread Some Developer
I know about Django storages (which is not compatible with Python 3.4) and Django storages redux (which is compatible with Python 3.4 but gives an error when trying to use it to sync static files to Amazon S3). I'm really looking for another alternative to store my static files and my media fi

Re: Form doesn't show in HTML template

2014-11-21 Thread Some Developer
On 21/11/14 15:31, Vijay Khemlani wrote: If you manually call the form "as_p" method in the view (not the template), does it print the form? OK. Sorted that out. Running my program through the debugger shows that the form object exists and has the correct fields associated with it. I don't

Re: Form doesn't show in HTML template

2014-11-21 Thread Some Developer
On 21/11/14 15:31, Vijay Khemlani wrote: If you manually call the form "as_p" method in the view (not the template), does it print the form? Which method in the FormView class would I override to put that in? The get() method or the render_to_response() method? -- You received this message be

Re: Form doesn't show in HTML template

2014-11-21 Thread Some Developer
On 20/11/14 22:07, Vijay Khemlani wrote: If you set the settings TEMPLATE_DEBUG to True, does it display any errors? Hmm still been trying to figure out what is going on but haven't really managed to get very far. I'm completely stumped. Has anyone got any tips as to what the problem might

Re: Form doesn't show in HTML template

2014-11-20 Thread Some Developer
On 20/11/14 22:07, Vijay Khemlani wrote: If you set the settings TEMPLATE_DEBUG to True, does it display any errors? No. -- 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 a

Re: Form doesn't show in HTML template

2014-11-20 Thread Some Developer
On 20/11/14 21:15, James Schneider wrote: Dumb question, but there is a "main_content" block in base.html, right? I'm assuming the "Please register..." message shows but the form doesn't? Or does that message not show up? -James Yes main_content block exists and the page displays the forms s

Form doesn't show in HTML template

2014-11-20 Thread Some Developer
I'm having a bit of a perplexing issue with Django 1.7.1 running on Arch Linux using Python 3.4.2. If it matters I'm using Pycharm 3.4 as my IDE. I have the following Python modules installed in my virtualenv: bcrypt boto braintree cffi django-braces django-debug-toolbar psycopg2 pycparser requ

Re: Is django framework feasible for developing online LMS?

2014-11-14 Thread Some Developer
On 14/11/2014 07:20, Pradip Shahi wrote: *Avraham Serour,* Sorry man, I mean to heart django guys.. I am pretty much sure with mysql as a backend and javascript on client. Would you help me decide on web server.. I had some research on Apache with mod wsgi, gnuicorn and nginx. Thank you.

Re: Using Django with Gulp.js

2014-11-14 Thread Some Developer
we do it here, but it's unlikely to be released for another month. Hope this helps Cal PS) You should consider using your real name, or at least an alias, for friendly/public mailing lists like this one. This isn't full-disclosure :) On Thu, Nov 13, 2014 at 9:29 AM, Some Develop

Using Django with Gulp.js

2014-11-13 Thread Some Developer
I'm using Gulp.js to deal with my JavaScript and SASS files to concatenate them and minify them but I'm unsure how to merge it with my Django workflow. I want to be able to automatically minify the files into one big JavaScript and CSS file to reduce HTTP requests and to allow easy uploading to

Re: Using ContentType to link two different objects together

2014-11-05 Thread Some Developer
On 05/11/2014 18:47, Carl Meyer wrote: On 11/05/2014 11:35 AM, Some Developer wrote: On 05/11/2014 18:16, Carl Meyer wrote: On 11/05/2014 11:09 AM, Some Developer wrote: I'm trying to write my own implementation of the Django comments framework for various reasons and am wondering ho

Re: Using ContentType to link two different objects together

2014-11-05 Thread Some Developer
On 05/11/2014 18:16, Carl Meyer wrote: Hi, On 11/05/2014 11:09 AM, Some Developer wrote: I'm trying to write my own implementation of the Django comments framework for various reasons and am wondering how one would link comments to a particular object (model) of another type. For insta

Using ContentType to link two different objects together

2014-11-05 Thread Some Developer
Hi, I'm trying to write my own implementation of the Django comments framework for various reasons and am wondering how one would link comments to a particular object (model) of another type. For instance I could have a ForeignKey in the Comment model pointing to a Blog post article but that

Switching from Linux to Windows for development of Django applications

2014-09-27 Thread Some Developer
Hi, For reasons outside of my control I have to switch from Linux to Windows for Django development and was wondering if any Windows developers had any tips? On Linux I make heavy use of pip and virtualenv to make sure that my packages are kept separate from the system packages. I'm thinking

Re: Using an application is more than one other application

2014-08-06 Thread Some Developer
On 06/08/2014 15:09, Collin Anderson wrote: I recommend in Application B's templates pulling in the data from Application A using an assignment tag. https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#assignment-tags Otherwise, in Application B's views, you can always: from appa.

Using an application is more than one other application

2014-08-06 Thread Some Developer
Hi, I have a Django application that I want to provide a global messaging system that can be used in all the applications in my project. So for instance if someone sends a message to a user while using Application A then the user should be able to access the message from Application B. But I'

Re: Questions about Django email packages.

2014-06-27 Thread Some Developer
On 27/06/2014 20:05, Chen Xu wrote: Hi Everyone, Any recommendations on Django email packages? Recently, I started looking at django-sitemessage, which looks pretty good to me. I wonder how it does comparing to others. Thanks -- ⚡ Chen Xu ⚡ -- What exactly do you want to do with this emai

Re: Showing which users are viewing a given page

2014-03-05 Thread Some Developer
On 04/03/2014 13:06, Paul J Stevens wrote: On 04-03-14 13:28, Some Developer wrote: Hopefully someone here will be able to point me in the right direction. Basically I want to be able to view which users are viewing a page at any given time and I want to be able to update it in real time

Showing which users are viewing a given page

2014-03-04 Thread Some Developer
Hopefully someone here will be able to point me in the right direction. Basically I want to be able to view which users are viewing a page at any given time and I want to be able to update it in real time using JavaScript but I'm at a loss as to how to track which users are viewing any given p

Re: Using a paginator with two models in the same view

2014-02-11 Thread Some Developer
riday, February 7, 2014 10:46:54 AM UTC-6, Some Developer wrote: I have two models: Thread and EmailThread. As the names suggest the Thread model relates to threads created via the web interface and the EmailThread model relates to threads created via email. I want to displa

Using a paginator with two models in the same view

2014-02-07 Thread Some Developer
I have two models: Thread and EmailThread. As the names suggest the Thread model relates to threads created via the web interface and the EmailThread model relates to threads created via email. I want to display a list of all threads from both models on the same page and I want to paginate thi

Re: Making sure I'm not missing out on some must have Django apps

2013-12-16 Thread Some Developer
On 15/12/2013 23:06, Frank Bieniek wrote: Hi, I would add some: django-userena - user self registration django-organizations - user and organizations django-guardian - object level permissions django-paranoia - paranoid security stuff django-cache machine / johnny-cache Thx Frank Thank for the

Making sure I'm not missing out on some must have Django apps

2013-12-15 Thread Some Developer
Right so it has been quite awhile since I updated my list of must have Django apps. I was wondering if anyone had any suggestions? Currently I use the following in all my Django projects: Django Debug Toolbar debug_toolbar_htmltidy inspector_panel debug_toolbar_user_panel South Django Compresso

Re: Preferred virtualenv layout for Django projects

2013-10-17 Thread Some Developer
On 17/10/2013 16:26, Tim Chase wrote: How do folks prefer to layout their Django projects when using virtualenv? Do you do either of the following, or something else? Method 1: (project & apps at same level) ~/tmp$ virtualenv my_proj ~/tmp$ cd my_proj ~/tmp/my_proj$ . bin/activate (my_proj)~/t

Re: Script to move django 1.4.3 to 1.5.1

2013-08-31 Thread Some Developer
On 31/08/2013 02:14, Dan Gentry wrote: I've been using Django since v1.0, and when each major version is released, I run through the release notes to see what I need to change. Russell is correct that most things will work from one version to the next, but I like to keep as up to date as possib

Re: JSON or YAML?

2013-08-30 Thread Some Developer
On 30/08/2013 14:34, Floor Tile wrote: Helle everybody, Just a short and simple question: It seams that both JSON and YAML can be used for initial data loading. (among other data types but I don't care about them for the moment) But can't figure out what the up and/or downsides of them are. Is

Re: Template variables in translation blocks

2013-08-26 Thread Some Developer
On 24/08/13 14:56, Ariel Calzada wrote: you have to append strings first http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates and then call trans 2013/8/24 Some Developer mailto:someukdevelo...@gmail.com>> I have a title and a header block

Re: Template variables in translation blocks

2013-08-24 Thread Some Developer
On 24/08/13 14:56, Ariel Calzada wrote: you have to append strings first http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates and then call trans 2013/8/24 Some Developer mailto:someukdevelo...@gmail.com>> I have a title and a header block

Template variables in translation blocks

2013-08-24 Thread Some Developer
I have a title and a header block which normally contain static text but for some pages I need to display some dynamic information contained in a template variable. So I might have the template variable: {{ app.name }} and the block code: {% block title %} {% trans "{{ app.name }} Inf

Re: Django Periodic tasks

2013-08-21 Thread Some Developer
On 20/08/13 21:36, Arnold Krille wrote: On Sat, 17 Aug 2013 03:36:29 +0100 Some Developer wrote: I'm aware of django-cron and django-celery, both of which are capable of doing what I want but I was wondering if I was just making a fundamental design mistake and there maybe a better option

Re: Django Periodic tasks

2013-08-16 Thread Some Developer
On 17/08/13 03:43, Christophe Pettus wrote: On Aug 16, 2013, at 7:36 PM, Some Developer wrote: Alternately I could get rid of the hourly period task and just work it out when a customer visits a certain page but that is likely to lead to long load times and heavy database use. Any

Django Periodic tasks

2013-08-16 Thread Some Developer
I'm aware of django-cron and django-celery, both of which are capable of doing what I want but I was wondering if I was just making a fundamental design mistake and there maybe a better option that someone here could explain. Basically customers pay money into their account in advance so that

Re: is Django useful for a basic site as well?

2013-07-18 Thread Some Developer
On 18/07/2013 22:41, Alex Hall wrote: Yes, I suspected as much but was hoping for something easier than CSS. My last adventure in CSS somehow put my navigation buttons squashed against the right side of their div, and my footer ended up floating behind my main content. Well, at least Django will

Re: More robust way of handling login_required decorator?

2013-07-13 Thread Some Developer
On 13/07/13 14:50, Peith Vergil wrote: django-braces have a LoginRequiredMixin. Using it is a much cleaner solution to overriding the dispatch method. Thanks for the tip. I'll check it out. -- You received this message because you are subscribed to th

More robust way of handling login_required decorator?

2013-07-13 Thread Some Developer
I make heavy use the login_required decorator and for the most part it is extremely easy to use when using FBVs but when using CBVs one either has to add a dispatch method to the class calling the super classes dispatch method or you need to put the login_required in the url configuration which

Re: TEMPLATE_CONTEXT_PROCESSORS missing in settings.py

2013-06-25 Thread Some Developer
On 22/06/2013 02:24, asax...@princeton.edu wrote: # Make this unique, and don't share it with anybody. SECRET_KEY = '8c(j)m3dm!m3gd_n#vjjfqdeuq!ltsj3+xii617dos1i@_pc7*' You'll want to change your secret key now that you have posted it on a public mailing list if you are actual

Re: Best practices for serving images?

2013-06-21 Thread Some Developer
On 22/06/2013 03:33, Jacky Tian wrote: I've got an app that serves galleries of user-uploaded photos, some of which can be quite large in size. I've been serving scaled thumbnails for most templates, but I need a higher resolutions for a detail page. These images will still be smaller than the si

Re: Application Migration form Django 1.3 to Django 1.5

2013-06-16 Thread Some Developer
On 16/06/2013 21:24, Andreas Kuhne wrote: Apart from that there are a couple of small things that didn't work. We had procedure based views, they had to be migrated to class based instead. You can still use function based views in Django 1.5. There is no need to migrate unless you really want

Re: Application Migration form Django 1.3 to Django 1.5

2013-06-16 Thread Some Developer
On 16/06/2013 21:13, Sandeep kaur wrote: I have this Web application made in Django 1.3. And now when I use it on Django 1.5, it does not work. It give error as no module simple. So, Is there any migration tool to make my application work easily on 1.5 version without manually making lot of chang

Re: django version 1.5 development server is more slow than early version

2013-03-03 Thread Some Developer
On 03/03/13 08:08, Fangzx wrote: It is very obvious when I press F5 to refresh whole index page. I've just upgraded one of my projects to Django 1.5 and can't say I've noticed a change in the speed of the development server. Are you sure you are not trying to compress your static files on ac

Re: IntegrityError when creating a brand new model instance

2013-02-16 Thread Some Developer
On 11/02/13 14:54, Bill Freeman wrote: On Sun, Feb 10, 2013 at 10:50 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: On 10/02/13 15:07, Bill Freeman wrote: Did you previously have a field named 'title' in this model that was marked unique, tha

Re: IntegrityError when creating a brand new model instance

2013-02-10 Thread Some Developer
On 10/02/13 15:07, Bill Freeman wrote: Did you previously have a field named 'title' in this model that was marked unique, that you have since removed? If so, the column may still be in the database with a unique constraint. Since it's no longer in the model, some default may be being used when

Re: IntegrityError when creating a brand new model instance

2013-02-09 Thread Some Developer
On 08/02/13 14:08, Andre Terra wrote: Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: I have a model for a Tag object with simply has two fields. A title (which has the unique constraint)

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Some Developer
On 08/02/13 14:08, Andre Terra wrote: Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer mailto:someukdevelo...@gmail.com>> wrote: I have a model for a Tag object with simply has two fields. A title (which has the unique constraint)

IntegrityError when creating a brand new model instance

2013-02-07 Thread Some Developer
I have a model for a Tag object with simply has two fields. A title (which has the unique constraint) and a description. I also have a FormView based view class which handles the creation of Tag objects. When I try and save the object in the form_valid() method I always get an IntegrityError s

Re: Why doesn't form_valid() in FormView take a request argument?

2013-02-07 Thread Some Developer
On 06/02/13 23:00, Rainy wrote: On Wednesday, February 6, 2013 3:09:39 PM UTC-5, Some Developer wrote: Why doesn't the form_valid() (and for that matter the form_invalid()) method in the FormView generic class based view take a request argument? I've found that if

Why doesn't form_valid() in FormView take a request argument?

2013-02-06 Thread Some Developer
Why doesn't the form_valid() (and for that matter the form_invalid()) method in the FormView generic class based view take a request argument? I've found that if you have a form which requires you to override the form_valid() method because you need to do custom logic before you save the model

Re: Is this a bug or am I doing it wrong? (trans tag)

2012-11-27 Thread Some Developer
On 27/11/12 12:33, Tom Evans wrote: On Mon, Nov 26, 2012 at 9:43 PM, Some Developer wrote: On 10/11/12 21:49, Some Developer wrote: In the documentation it is quite clear that the following syntax is correct in templates: {% load i18n %} {% trans "my_string" as b

Re: Is this a bug or am I doing it wrong? (trans tag)

2012-11-26 Thread Some Developer
On 10/11/12 21:49, Some Developer wrote: In the documentation it is quite clear that the following syntax is correct in templates: {% load i18n %} {% trans "my_string" as blah_string %} {{ blah_string }} etc etc. This works fine if the original trans tag is inside a block bu

Vim Django template syntax checker

2012-11-26 Thread Some Developer
I've been using Syntastic along with Vim for Django development for sometime but I'd like to see if I could improve my Vim configuration. The problem with Syntastic is that it does not work too well when checking partial HTML documents (which is often the case with Django because of template in

Is this a bug or am I doing it wrong? (trans tag)

2012-11-10 Thread Some Developer
In the documentation it is quite clear that the following syntax is correct in templates: {% load i18n %} {% trans "my_string" as blah_string %} {{ blah_string }} etc etc. This works fine if the original trans tag is inside a block but then the blah_string variable is only valid within that

Re: Custom Admin Panel

2012-10-30 Thread Some Developer
On 30/10/2012 12:06, Bill Freeman wrote: On Mon, Oct 29, 2012 at 12:13 PM, Some Developer wrote: Hi, I'm in the process of writing a Django site and one of the requirements is that it have a custom admin panel and a custom control panel but I am having some problems coming up with the

Re: Help me choose OS for django server

2012-10-30 Thread Some Developer
On 30/10/2012 19:50, Chris Pagnutti wrote: First, is this a good idea? Do you think I can do this securely using the django, apache, and lighttpd docs? or am I asking for trouble? What are the major security issues I need to be aware of when administering a server? Configure a firewall to b

Custom Admin Panel

2012-10-29 Thread Some Developer
Hi, I'm in the process of writing a Django site and one of the requirements is that it have a custom admin panel and a custom control panel but I am having some problems coming up with the best way to organise my application. My initial idea was to have the admin (and control) panels as separ

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Some Developer
On 29/10/2012 16:03, Isaac XXX wrote: Hi there, thank you for response Tom. Actually, I've a complete idea at how to build this system, but I lack the exact information about how to join systems, and what I was looking for was a source of cohesive information on all systems. At least, when I