I have my DEV server pointing to the svn repository, and I can try out
changes there. The web server admins take care of moving the
application to production.
On Apr 29, 4:25 pm, Dexter wrote:
> This was not really a feature request or how its really setup.
> But I wanted to know how the communi
Storing credit card numbers (and other info) isn't the only concern of
the PCI standards. If your form collects a number an passes it on to
the processor, you could also be vulnerable.
On Jun 18, 2:09 pm, surtyaar wrote:
> Hi Bobby,
>
> You might be interested in a django clone of the sample shop
I'm trying to move some code from a view to a decorator to use with
many views. This is the view:
views.py:
def list_type(request):
inst_id=request.session.get('inst_id',None)
## move to decorator
if not inst_id:
path = urlquote(request.get_full_path())
tup = reverse
When I attempt to use the decorator logic, the view becomes this:
views.py
@institution_required
def list_type(request):
inst_id=request.session.get('inst_id',None)
queryset = RecordType.objects.filter(institution=inst_id)
return object_list(request, queryset, paginate_by = 12)
I do
Forgot to paste in the urls.
urls.py
from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
from views import *
urlpatterns = patterns('person',
url(r'^create_type/$',create_type,name='type_create'),
url(r'^view_type/(?P\d+)/$',view_type,name='type_v
den wrote:
> On 8/4/2010 10:52 AM, Dan Gentry wrote:
>
>
>
>
>
> > When I attempt to use the decorator logic, the view becomes this:
>
> > views.py
> > @institution_required
> > def list_type(request):
>
> > inst_id=request.session.ge
As I deploy my application into production, I haven't found a good way
to migrate the groups of permissions I have defined and tested in
development. In fact, due to my poor typing and reviewing, I missed
one in production and caused a small amount of concern with the users
until I figured it out.
In the early stages of writing an app that will serve two
constituencies, each with their own CAS service. (I work at a
university, and we serve both staff/students and alumni.) The idea is
to attempt authentication with the first CAS server, and try the other
if the first is unsuccessful.
I've
I agree with Aaron. I upgraded 5 apps from v1.0.4 to 1.3 earlier this
year, and it was pretty easy after reviewing the release notes.
Moving to class based views (to replace generic views) was not
required for 1.3, but I had fun and learned quite a bit.
On Jan 28, 7:35 pm, Aaron Cannon
wrote:
>
I'm going to guess that maybe there is a syntax in one of the lines
preceding this one. Could you share the entire DATABASE session of
your settings file?
FYI, I have written a more up to date procedure for running Django on
Dreamhost - built on the great posts by Jeff Croft and others.
http://da
I've solved this problem in an app, but not with the built-in
permissions system. Instead, I created a DB structure that links
users to companies and stores the r/w status for each.
On Feb 3, 12:58 am, Mike Dewhirst wrote:
> I want to use the built-in auth_groups permissions system in a
> many-t
Dreamhost shared account
http://dashdrum.com/blog/2011/08/django-on-dreamhost/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
dj
I use generic views - either function or class based - for the common
functionality in my apps. As Serge mentioned, a list works pretty
much the same in every application, so I just provide a few parameters
to a generic view. More complicated forms still require custom code.
On Apr 3, 1:07 am, a
My Django app runs on an Oracle database.
A few times a year, the database is unavailable because of a scheduled
process or unplanned downtime. However, I can't see how to catch the error
and give a useful message back to the requester. Instead, a 500 error is
triggered, and I get an email (o
Thanks Ian. I'll see what I can do.
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/EYbdNNR4bS8J.
To post to this group, send email to django-users@g
Do you have the proper level of security on the machine to install software?
On Wednesday, July 18, 2012 8:50:48 AM UTC-4, Владислав Иванов wrote:
>
> when I run the installation of Django python setup.py install - comes at
> the end of an error that can not be put Django in C: \ Python27 \ Lib \
I too am a little confused by the clean() method and the data_set field.
It seems that the data_set would contain a copy of the ID value for a
change operation, and be None for an add. What purpose does that serve?
Perhaps comment the clean() method just to see if the other fields can be
save
Agreed that virtualenv will allow you to install python packages - however
not any linux/unix packages. I have no problems using Django on Dreamhost.
http://dashdrum.com/blog/2011/08/django-on-dreamhost/
On Thursday, August 2, 2012 10:34:35 PM UTC-4, trevorj wrote:
>
> You are trying to instal
>
> Complicated indeed!
>
I once worked on a similar project that tackled the first 2 requirements as
part of a multi-tenant application, storing both the userID and company ID
for each detail record (content). Plus, the user profile was extended to
tie a User record to one or more companies.
It would be helpful to see some more complex examples with these classes.
One thing I like about the CBVs is that they include all of the necessary
code for common functions. I have used them extensively (once I figured
them out).
On Wednesday, September 12, 2012 12:59:12 PM UTC-4, Cal Leemin
To address the original question, I saw a similar error when overriding the
save() function of a model. The solution was to include *args and **kwargs
in the function definition:
def save(self,*args, **kwargs):
# your custom code here #
super(MyModel, self).save(*args, **kwa
I've been using factory-boy as of late, and have found it to be a great way
to setup each test exactly as I need it. Fixtures aren't bad either, but
working with a large amount of data can make it difficult to predict the
proper output for a test, and changes to this data to accommodate a new
t found
anything helpful in my searches.
Thanks,
Dan Gentry
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/WUsQvc_QxKAJ.
To post to this grou
Correction:
My URL tag does not include the quotes. Should be:
{% url admin:jsi18n %}
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/ifbpxbJtw_wJ.
T
Quick note: when using virutalenv on Windows, one runs the activate script
to use the environment. \Scripts\activate.bat
Same function as the source command in Linux.
Dan Gentry
>>
--
You received this message because you are subscribed to the Google Groups
"Django users"
Ubuntu, Eclipse with PyDev, virtualenv, pip, django debug toolbar,
Chrome, and lots of hot chocolate :)
On Aug 22, 6:07 pm, Stephen Jackson
wrote:
> I am new to the world of Django. I would like to hear from other django
> developers describe their dev environment (tools, os, editors, etc.).
--
In the docs there a paragraph or two about this. Basically, one must
decorate the dispatch method instead. See this link for the details.
https://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-the-class
Good luck!
On Oct 5, 11:42 am, Kurtis wrote:
> Hey,
>
> What's the bes
Instead, you should decorate the dispatch method in the class-based
view. See the docs here:
https://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-the-class
On Oct 5, 10:27 am, Victor Hooi wrote:
> Hi,
>
> I'm attempting to use one of the new class-based TemplateView with
With all due respect to Mr. Gonsalves, I do not care to work with the
Django trunk unless I'm just playing around with something. My goal
is always to produce a production quality application. Even the more
stable than average Django trunk cannot provide the consistency needed
to deliver an app t
I can't test this, but the code below may do what you want. (I
learned this stuff from Reinout's blog posts)
# urls.py
(r'^tags/(?P[a-zA-Z0-9_.-]+)/$',
djangoblog.tag_views.TagDetailListView.as_view())
# views.py
from django.views.generic import ListView
class TagDetailListView(ListView):
I faced a similar situation where I had to check for valid input data
used to build the query in get_queryset(). My solution was to use a
decorator around the dispatch() function, but I think it could also be
used within that function. I chose dispatch() because it acts like a
traditional view fu
Just looking at the models, I'd like to make a couple of suggestions.
Instead of using a Foreign Key relationship in Customer to indicate
the billing address, I would include a flag called 'billing_address'
in the Address table that would be set to True for the customer
selected address.
An over
It took me a few months to warm up to using class based views, and it was
the pending decommissioning of the generic function based views that first
caused me to take a look. Now, I have converted all but the most
complicated views to the class format (why change what works?). Any new
work I
You've probably already tried the simple things:
- Confirm that the server name and port are correct.
- Ensure that firewall/routing rules will allow the connection.
- Try a simple connection on the same box with sqlplus.
Walking through this list has helped me a number of times.
Rafael,
This is a bit of a wild guess, but I'm wondering if your form isn't
validating. Since your template doesn't seem to be displaying any errors,
you wouldn't know it.
Also, since the Url column is marked as unique, but you are excluding it
from the form, it may be the field throwing th
Agree with Tom that ccbv is a great resource for help with CBVs. In fact,
I used it to help me with this comment.
I would probably override the delete() method in DeleteView to do what you
want to do. The original justs deletes the record and redirects to the
supplied URL:
1. def delete(
Andrei, I once received this error when the problem was actually in another
python module being imported - in my case views.py. Hope this helps, Dan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiv
Roy, I agree with Fallen that a subclass of TemplateView is required here.
I have used this technique often. Dan
class MyTemplateView(TemplateView):
template_name = 'my_template.html'
def get_context_data(self, **kwargs):
context = super(MyTemplateView, self).get_context_data(*
Something I'm looking forward to learning as well. My app uses the older
user_profile approach.
--
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+un
A couple of thoughts:
Override the delete() method in your model to set the flag to True rather
than delete the record.
Write a manager that filters out the 'deleted' records. Use it for every
query, except those used to retrieve or undo.
On Monday, May 13, 2013 3:07:16 PM UTC-4, Subodh Nijsur
I use the same pattern in my application, and it works just fine.
def dispatch(self, *args, **kwargs):
self.tc = get_object_or_404(TrainingClass, pk=kwargs.get('class_id',
None))
return super(TrainingScheduleCreateView, self).dispatch(*args,
**kwargs)
def form_vali
1) I've been using Factory Boy to create test data rather than fixtures.
It is so much easier to ensure that I know exactly what data is available
for a given test.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this grou
I'm not a fan of testing with actual data, except maybe as a final run to make
sure no existing data breaks something or for stress testing with large amounts
of data. Your legacy DB will not cover all of the possible cases that need to
be tested in your code.
Instead, write quality unit tests
What is the purpose of checking test.id for a value of 3 or 6?
--
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
When using sqlite3, one has to provide a full path to the database file.
For my projects I use something like this on my development machines (for
a database file named 'db'):
import os
PROJECT_DIR = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backen
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 possible to minimize my risk of hitting a
de
Just my opinion, but I see no reason to use English names in models. Use
whatever you wish. English speaking programmers have been using cryptic
variable names for decades.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from
Seems to me your call to get_object_or_404() would effectively check for
the object's existence.
>
>
--
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-us
I would write views for the client to access their tables rather than using
the built-in admin. Your situation is not really what the admin was
designed to do.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group a
Thanks. I'll give raw() a try.
On Apr 11, 11:51 am, Jacob Kaplan-Moss wrote:
> On Mon, Apr 11, 2011 at 7:53 AM, Dan Gentry wrote:
> > Where I run into trouble is that the query returns data in columns,
> > but not objects. That means that I can’t reference an object att
, time, location) and the radio button in a tabular
format. Any thoughts here?
Thanks for pondering my questions.
Dan Gentry
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googleg
I should have included that my desire is to access these objects in
the template.
On Apr 21, 11:22 am, Dan Gentry wrote:
> I'm trying to use a formset to display a variable number of detail
> rows on a form. It's what they were created for, right?
>
> However, in order to
I have set the choices list in the view:
choices =
SomeModel.objects.filter(user=request.user).values_list('id','label')
Then, after the form is instantiated, modify the choices attribute of
the ChoiceField:
form = SomeOtherModelForm()
form.fields['model_dropdown'].choices = choices
I tend to use the Admin for internal tasks - ones that would be
performed by a application or system administrator. These are people
that understand the data structure and know things like the effects of
a cascaded delete.
For users, even a customer 'admin' person, I would write my own views
that
When faced with a similar problem (I wanted to mark one of the 'B'
records as the primary of the group), I extended the save function of
the 'B' model to ensure that none of the other records were marked as
such.
def save(self):
if self.primary:
other_primaries =
B_Model.ob
My application includes some existing tables from another, non-Django
application. One of them does not have an atomic primary key, and I’m
not in a position to change that. Therefore, I’m using one raw SQL to
access the data.
Where I run into trouble is that the query returns data in columns,
but
This is a bit of a stumper!
I don't see any big glaring issues. A couple of housekeeping things: Is
there data in the table? Are you certain that you are using the correct
template?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubsc
No need to test the Django provided logic, but I like to write a few tests
for each view that check the permissions, urls, updates, etc. More of a
functional test than a unit test. I find that when these tests fail it is
usually something changed somewhere else in the app. For example, a chan
To modify the generic CBVs to handle two forms would mean changes in many
of the base classes and mixins, including ProcessFormView, FormMixin, and
BaseFormView. It would make more sense to start with the View base class
and roll your own methods. If this is a one-off, I would probably keep it
While your form_invalid method is looking for reference_form as a
parameter, the post method by default passes the form from
get_form(form_class). I would recommend overriding post to pass both form
and reference form to form_invalid and form_valid.
Best of luck, Dan
--
You received this mes
I created a couple of mixins for a project that might help you. See this
gist: https://gist.github.com/dashdrum/03858d79ddfd9bba44d6
Pretty easy to use. Here's an example Create view:
class RegistrationView(FormsetCreateMixin,CreateView):
template_name = 'registration/registration_form.htm
I would suggest that in the UpdateView you should set the object to the
master record being updated rather than to none for both get() and post().
On Saturday, January 10, 2015 at 8:08:47 AM UTC-5, Ranjith Kumar wrote:
>
> Hello all,
> I have been trying to do Django class-based CreateView and
With a formset, like your application form, the template could look like
one of these examples:
{{ formset.management_form }}
{% for form in formset %}
{{ form }}
{% endfor %}
{{ formset }}
(found on
https://docs.djangoproject.com/en/de
Malik, in order to install within your virtualenv, you should activate it
first /bin/activate . Then run the pip install command.
Cheers!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emai
I've had good luck hosting an app with a Dreamhost shared hosting account.
I even wrote a post about it a couple of years ago. (Maybe I should update
it for 2014)
http://dashdrum.com/blog/2011/08/django-on-dreamhost/
On Saturday, March 8, 2014 11:53:54 PM UTC-5, Chen Xu wrote:
>
> I am tryin
I would setup a data structure keyed off the session ID (or maybe a logged
in user ID) that stored the transaction in progress for the user. As the
user went through the pages this data would be used to display what has
already been selected and be updated for each screen.
I suppose that one c
I would suggest the managed option in the Meta class of the model. Setting
this to false will stop Django from trying to create the table, and it will
instead expect it to already be available. Also, the db_table option can
be used if the name of your model is different than the existing table
What does it do instead?
>
--
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, send email to djan
68 matches
Mail list logo