Passing arguments to Admin index in Django 1.0

2008-12-27 Thread raj
Hi all, I'm new to Django, started out with 0.96 and very soon switched to 1.0 version. Here, I'm facing the following problem. My Admin index page needs to have a small custom form snippet in addition to all other usual things. It will be accommodated in the admin_index page as follows: {%

Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread raj
In the usual admin index at http://host:port/admin/ page, there are the auth and sites app visible on top of our custom app list. I'd to customize the admin index page and the AdminSite. After that those apps are not visible. The only change I made in the custom AdminSite is to add two key-value

Re: Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread raj
On Dec 29, 6:35 pm, "Alex Koshelev" wrote: > How have you created custom AdminSite? Have you registered auth and site > models to it? Well, I haven't done that. Just defined the class and hooked all my apps to that. I thought all such default apps would be taken care of by

Re: Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread raj
On Dec 29, 6:35 pm, "Alex Koshelev" wrote: > How have you created custom AdminSite? Have you registered auth and site > models to it? I haven't done that. Thought that being built-in apps they would already be hooked to the parent class AdminSite. I'll try what you

Re: Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread raj
Yes, I've found the way out. Adding these lines to the admin module will help: from django.contrib.sites.models import Site from django.contrib.sites.admin import SiteAdmin from django.contrib.auth.models import User, Group from django.contrib.auth.admin import UserAdmin, GroupAdmin ##

Re: Model fields and arrays?

2008-12-31 Thread raj
I too checking for similar thing. Need to store a list of integers/ floats in the model. When we find existing form fields as inadequate, we can define our own fields. What about following the same way here for model fields too? On Dec 31, 9:40 am, schwim wrote: > I'm trying

Re: Your IDE of choice

2009-01-07 Thread raj
what about kdevelop in linux? --~--~-~--~~~---~--~~ 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

Re: dynamic / updating foreign key choices

2009-01-13 Thread raj
One possible way seems to override the render_change_form in AdminClass as pointed in this post: http://groups.google.com/group/django-users/browse_thread/thread/94bdf5d7eeefc99b/9cbdb25672387c33?lnk=gst=select+foreign+key+list#9cbdb25672387c33 On Jan 12, 8:34 pm, GuyBowden

Re: Years

2009-02-13 Thread raj
Better ways? You mean something as simple as this? YEAR_CHOICES= [(str(y), str(y)) for y in range(1901,date.today().year +1)] .. year= forms.ChoiceField (choices=YEAR_CHOICES) Or something else?

How to populate a custom ModelForm?

2009-02-21 Thread raj
I've defined a custom ModelForm for one of my models. Many of the custom form fields differ from the model fields. I've made the 'save_model' method to calculate required model_field_values from the given form_field_values. Now after adding one instance, how can I do the reverse? I mean, how to

Where to put jquery/dojo js files

2009-03-08 Thread raj
To make use of any popular js framework, I've the following settings: MEDIA_ROOT = '/home/raj/django/my_project/media' MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX = '/media/' After copying dojo.js to '/home/raj/django/my_project/media/js', I edit my custom made change_form.html to include

Re: 500.html does not load

2009-10-22 Thread raj
Hi, > On Oct 21, 2:50 pm, NoviceSortOf wrote: > > Although I have 500.html in my > > site-packages/django/contrib/admin/templates folder 500.html does not > > appear when it should, below see my errors (I've included the > > traceback items below). > > > Is there

Question on the user auth model

2011-08-24 Thread raj
I'm reading the django docs, and I come across the following: from django.contrib.auth.models import User class UserProfile(models.Model): # This field is required. user = models.OneToOneField(User) # Other fields here accepted_eula = models.BooleanField() favorite_animal =

Setting default form value in template

2011-08-24 Thread raj
I'm trying to set a default form value in the template, and not in the forms.py file (because I'm trying to make the default value dynamic depending on something that javascript will return). So To test it, I have the following line in my template: {{ form.first_name|default:"Enter Your first

Re: Problem at activating the admin site (Django tutorial part 2)

2011-08-25 Thread raj
In ur urls.py, Did u import admin, make it discoverable, and also uncomment the / admin/ url? Also, make sure that you syncdb by running python manage.py syncdb. Lemme know if that helps :) On Aug 25, 9:29 am, pasztilla wrote: > Hi there, > I'm just trying to accomodate

Re: Setting default form value in template

2011-08-25 Thread raj
25, 2:08 am, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Thursday, 25 August 2011 06:10:38 UTC+1, raj wrote: > > > I'm trying to set a default form value in the template, and not in the > > forms.py file (because I'm trying to make the default value dynamic &g

Re: Setting default form value in template

2011-08-25 Thread raj
Actually, I think I'm figuring it out. Just a quick question though. Is it possible to pass javascript values through the form attrs attribute? For example: class forms(forms.Form): name = forms.TextInput(attrs={'size': 10, 'value': ''',}) On Aug 25, 12:13 pm, raj <nano.ri...@gmail.

Re: Setting default form value in template

2011-08-25 Thread raj
Bump** On Aug 25, 12:49 pm, raj <nano.ri...@gmail.com> wrote: > Actually, I think I'm figuring it out. Just a quick question though. > Is it possible to pass javascript values through the form attrs > attribute? For example: > > class forms(forms.Form): >     name = form

Re: Problems during webcast (Using django for 40mil+ rows) - sorry!!!

2011-08-29 Thread Raj
Hi Cal, I attended the entire morning session and got a lot from it even without the desktop display. Am looking forward to getting the presentation though. Thanks for sharing your experience! Raj On Aug 29, 2:41 pm, "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitym

Password Field Not being encrypted

2011-08-30 Thread raj
Hey guys, I'm trying to make a custom registration form for a custom UserProfile class. I have the following form: class UserForm(ModelForm): username = forms.EmailField(label = _("Email"), widget = forms.TextInput(attrs ={ 'id':'email'}), required=True) first_name =

Re: Password Field Not being encrypted

2011-08-31 Thread raj
l. while saving your custom form pass the password to set > password method and save returned encrypted password  in your model. > > Lokesh > > On Aug 31, 12:05 am, raj <nano.ri...@gmail.com> wrote: > > > > > > > > > Hey guys, I'm trying to make a cus

Re: row level permissions

2011-12-01 Thread raj
Isn't this possible with a custom UserProfile and overriding the queryset() & has_change_permission() methods of each ModelAdmin? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

using django on a server?

2011-05-09 Thread raj
mysql? (like php scripting) 2. If I do use a framework like django, how exactly do I use django on a server? Like I have hosting through ipage. How do I use django on it? If ipage can't handle django scripting, what hosting websites would handle it? Thank you, Sincerely, -Raj Agarwal -- You

Re: using django on a server?

2011-05-09 Thread raj
don't really understand your second statement either... I really want to learn all of this stuff. Please help. Thank you! Sincerely, -Raj On May 9, 10:38 pm, Greg Donald <gdon...@gmail.com> wrote: > On Mon, May 9, 2011 at 6:25 PM, raj <nano.ri...@gmail.com> wrote: > >

Weird Error when following django book?

2011-05-25 Thread raj
I'm up to the html template part of the djangobook, and I keep getting a weird output error whenever I do a t.render() call. It's a really small error but I want to make sure that my django module is correctly working. This is the output I got from the example in the django book: u"Dead John

Re: Weird Error when following django book?

2011-05-25 Thread raj
Thank you, so I guess everything is working okay. :) On May 25, 2:30 pm, Jacob Kaplan-Moss wrote: > On Wed, May 25, 2011 at 1:04 PM, Boštjan Mejak > wrote: > > HTML source code can't be passed as a string. You morons. > > This isn't OK. Stop it at

running a django app, help please?

2011-05-25 Thread raj
about app's really. What I want to know is what is the point of apps, and how do you use them? Thank you. -Raj -- 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 unsubs

urls for multiple django apps?

2011-06-05 Thread raj
Hey guys, just a little confused about something python related. If i have multiple apps, and they all have a views.py file. How do I import them correctly in my urls.py file? I'm asking this because you get the following code: from mysite.app1 import views from mysite.app2 import views well,

Re: Preview for the new website..

2011-06-05 Thread raj
I'm a very beginner developer. I'm just wondering how you got the actual styling together? Did you bang all that out with photoshop/css/ javascript or something? Cause I want to make a website, but I don't know if I should go ahead and learn this way, or if there is an easier way. Thank you. -Raj

Making a login/create user interface

2011-06-06 Thread raj
the auth_user table, should I create a "login" app? Thank you. -Raj -- 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 d

Re: Making a login/create user interface

2011-06-07 Thread raj
simple demo project that includes very simple login interface and send it to me? Thank you. -Raj On Jun 6, 1:03 pm, Shawn Milochik <sh...@milochik.com> wrote: > Most of the info you need is here: > > https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-... >

VERY cheap django hosting?

2011-06-08 Thread raj
ideas? Thank you. -Raj -- 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 django-users+unsubscr...@googlegroups.com. For mo

Re: VERY cheap django hosting?

2011-06-08 Thread raj
Ya, i think as a first timer, I'm gunna go with something that is non- vps. I'll learn about preconfiguring stuff when the time comes. I think djangohosting.ch looks the best. But asmallorange and alwaysdata also look appealing. Thanks all. On Jun 8, 8:58 pm, ApogeeGMail

Re: VERY cheap django hosting?

2011-06-08 Thread raj
Actually, I might reconsider, What do you guys think of hostgator? They also have django hosting with fastcgi, And there's is shared hosting. Pros, cons? Thanks -Raj On Jun 9, 12:27 am, raj <nano.ri...@gmail.com> wrote: > Ya, i think as a first timer, I'm gunna go with something that is n

Re: VERY cheap django hosting?

2011-06-09 Thread raj
Can you please elaborate on the second part of your statement? What do you mean by specifying what python you use? I've also been trained in using python 2.7, will I notice a difference if I use 2.4? Thank you. -Raj On Jun 9, 3:32 pm, elliot <offonoffoffon...@gmail.com> wrote: > more

forms messing up css, help?

2011-06-10 Thread raj
Hey guys, Whenever i try and add a contact form (from the django book) into my current website, all my css/javascripts stop working. What is the issue? Here are my codes: #views.py def contact(request): if request.method == 'POST': form = ContactForm(request.POST) if

Re: forms messing up css, help?

2011-06-10 Thread raj
Another thing i just noticed, When i view the source of my contact form, all the css/javascript includes are missing part of the path where i placed a {{ STATIC_URL }} tag. Why isn't this tag being rendered? Thank you. On Jun 11, 12:14 am, raj <nano.ri...@gmail.com> wrote: > Hey guys, W

Re: forms messing up css, help?

2011-06-10 Thread raj
uggestions? On Jun 11, 12:17 am, raj <nano.ri...@gmail.com> wrote: > Another thing i just noticed, When i view the source of my contact > form, all the css/javascript includes are missing part of the path > where i placed a {{ STATIC_URL }} tag. Why isn't this tag being > rendered? Tha

Re: forms messing up css, help?

2011-06-12 Thread raj
form': form}, >             context_instance=RequestContext(request) >         ) > > That should give you a functioning template. > > Ian > > > > > > > > > > On Fri, Jun 10, 2011 at 9:27 PM, raj <nano.ri...@gmail.com> wrote: > > I also

Creating a simple contact form

2011-06-17 Thread raj
Hey guys, I have a webfaction account, and I was trying to get a contact form working for my website. The problem is that I can't seem to get it to work. Can someone walk me through this? I couldn't figure it out from the djangobook tutorial. I think something is wrong with my settings and stuff.

Re: Creating a simple contact form

2011-06-17 Thread raj
Thanks, I tried the shell thing above. It says that it sends without error, but I still dont receive any emails. Thank you -Raj On Jun 17, 12:23 pm, william ratcliff <william.ratcl...@gmail.com> wrote: > If you can wait, I use webfaction and can give you a response for what we do >

contribute_to_class and the admin site

2011-06-17 Thread raj
Hey guys, I want to find an easy way to expand fields in the User model. I'm not quite understanding the tutorial where I need to create a model from a new app. I heard that there is a function called contribute_to_class. This is what my model.py file looks like: from django.db import models

Alternate user fields

2011-06-17 Thread raj
would one go about doing so? I attempted to add fields into the User profile in the admin site, but i couldn't do so. Would it be better to create an app that handles this part (a new table), and it shares a relation with the auth user? Thank you. -Raj -- You received this message because you

Re: Alternate user fields

2011-06-18 Thread raj
om/questions/44109/extending-the-user-model-wit...https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional...http://www.djangobook.com/en/1.0/chapter12/#cn222 > > > > > > > > On Sat, Jun 18, 2011 at 1:17 PM, raj <nano.ri...@gmail.com> wrote: > > Hey

Re: Creating a simple contact form

2011-06-19 Thread raj
Thank you so much. It worked, but I had to also comment out the EMAIL_BACKEND part of the settings.py file. Thanks again. On Jun 17, 10:57 pm, william ratcliff <william.ratcl...@gmail.com> wrote: > Hi Raj, > > It sounds like your problem is email, rather than the form.   In our &

Re: Alternate user fields

2011-06-20 Thread raj
Its asking me to locate this admin.py file inside my application. I can't find this file. Should I just make one inside an application (after running the startapp function)? On Jun 18, 12:40 pm, creecode <creec...@gmail.com> wrote: > Hello Raj, > > On Saturday, June 18, 2011 8:52:4

Re: Alternate user fields

2011-06-20 Thread raj
%}, will it automatically attribute that to the new user class? Thank you. On Jun 20, 2:43 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote: > On Sun, 2011-06-19 at 23:39 -0700, raj wrote: > > Its asking me to locate this admin.py file inside my application. I > > can't find this file. Should I

Social Networking basics? -Raj

2011-06-20 Thread raj
field? I'm confused on how all this would break down. Thank you. -Raj -- 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 d

Re: Alternate user fields

2011-06-20 Thread raj
Sorry, can you give me more details. What other things would I have to do to make these changes? thank you. On Jun 20, 3:08 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote: > On Mon, 2011-06-20 at 00:03 -0700, raj wrote: > > Ya i got that working. Just another quick question,

Re: Social Networking basics? -Raj

2011-06-20 Thread raj
I'm not quite sure what you mean. Where would I learn about these concepts. Thank you. On Jun 20, 3:10 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote: > On Mon, 2011-06-20 at 00:06 -0700, raj wrote: > > Just wondering something. I have an idea to build a social networking- &

updating a user form?

2011-06-22 Thread raj
I'm trying to create an update_profile form. This form will be able to update extended user information that is not in the original form. So, I have a form that allows you to create an account. There a lot of other fields that aren't listed in this form. The rest of these fields will be found

Re: updating a user form?

2011-06-22 Thread raj
"value" parameter). I looked through the ModelForm section of the djangobook, as well as the forms section, and I couldn't come up with anything. On Jun 22, 2:37 am, Herman Schistad <herman.schis...@gmail.com> wrote: > On Wed, Jun 22, 2011 at 08:28, raj <nano.ri...@gmail.com&

Re: updating a user form?

2011-06-22 Thread raj
; wrote: > On Wed, Jun 22, 2011 at 10:14, raj <nano.ri...@gmail.com> wrote: > > If I didn't have the url > > set up in this manner, how would I manage to extract the userprofile? > > If you have the "AuthenticationMiddleware" activated you would use > req

Re: updating a user form?

2011-06-22 Thread raj
nevermind, i figured it out. thanks anyway On Jun 22, 5:11 pm, raj <nano.ri...@gmail.com> wrote: > I think I'm starting to get the hang of it a little. I was able to > extract the data from the profile and set it as the initial value. > From what I understand, you would like me t

FileField model question

2011-06-23 Thread raj
I was reading https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, and I got a little confused when looking at the handle_uploaded_file function. def handle_uploaded_file(f): destination = open('some/file/name.txt', 'wb+') for chunk in f.chunks():

Re: FileField model question

2011-06-23 Thread raj
, Herman Schistad <herman.schis...@gmail.com> wrote: > On Thu, Jun 23, 2011 at 18:51, raj <nano.ri...@gmail.com> wrote: > > I was > > readinghttps://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, > > and I got a little confused when looking at the handle_up

upload file isn't working

2011-06-24 Thread raj
# models.py # def content_file_name(instance, filename): return '/'.join(['uploads', instance.user.username, 'docs', filename]) class upload_model(User): user = models.ForeignKey(User, related_name = 'user_upload') title = models.CharField(max_length = 50) doc =

Re: upload file isn't working

2011-06-24 Thread raj
another thing is the fact that the file name isn't changing, even though I'm trying to change it. On Jun 24, 12:36 pm, raj <nano.ri...@gmail.com> wrote: > # models.py # > > def content_file_name(instance, filename): >     return '/'.join(['uploads', instance.user.username,

rss feed question

2011-06-24 Thread raj
I was trying to follow the following guide: https://docs.djangoproject.com/en/dev/ref/contrib/syndication/?from=olddocs and I had some questions. I'm not quite sure, but it seems like this guide is showing how to create your own feed. How would I go about retrieving the feed instead of creating

Re: upload file isn't working

2011-06-27 Thread raj
How do you view the debugger? I am using webfaction hosting. Otherwise, does the code look fine? On Jun 27, 5:48 am, Malcolm Box <malcolm@gmail.com> wrote: > On 24 June 2011 17:36, raj <nano.ri...@gmail.com> wrote: > > > > > > > > > >

giving download links

2011-06-27 Thread raj
I allow a user to upload a file, how do I now allow them to download this file? I looked at the "serving static files" thing in the djangoproject, but they said it causes security flaws or something. Can someone help me? I couldn't find good information on google. Thank you. -- You received this

Implementing a User Search Feature

2011-06-30 Thread raj
Tried googling but couldn't come up with much. How do I implement a User Search feature? Where an individual can type in the first and/or last name of user and come up with results? I saw some things about how to search through a site, but I think this is a little different. Thank you. -- You

Re: Implementing a User Search Feature

2011-07-02 Thread raj
Thanks, when I get back to my production comp, ill give this a try. Did know about this queryset thing. Thanks again. Just a quick question, the **filters thing u placed, i would put something like first_name last_name or something right? On Jun 30, 11:25 pm, Doug Ballance

Django Memory hosting issues?

2011-07-29 Thread raj
Hey guys, Just need some advice. I currently have a webfaction account, and It gives me 80mb of space. But I didn't know that each django application takes up approximately 40mb (ran over the limit without realizing it), so I can make only a max of 2 different websites. If I want to have the

Re: Django Memory hosting issues?

2011-07-29 Thread raj
applications. Can I link one domain to one of those applications, and another domain to another one of those applications? On Jul 29, 9:29 pm, raj <nano.ri...@gmail.com> wrote: > Hey guys, > Just need some advice. I currently have a webfaction account, and It > gives me 80mb of spac

'str' object has no attribute 'resolve' when access admin site

2011-08-09 Thread raj
I keep getting this error: 'str' object has no attribute 'resolve' when trying to accessing the django admin site and I can't figure out why. I have apps within my project that have their own admin.py files. Could this cause it? here is my urls.py: from django.conf.urls.defaults import * import

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-09 Thread raj
*bump* really need an answer for this. On Aug 9, 11:41 am, raj <nano.ri...@gmail.com> wrote: > I keep getting this error: > 'str' object has no attribute 'resolve' > > when trying to accessing the django admin site and I can't figure out > why. > I have apps within my pro

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-10 Thread raj
') if sub_tried is not None: tried.extend([[pattern] + t for t in sub_tried]) else: tried.append([pattern]) ▶ Local vars On Aug 10, 6:09 am, Reinout van Rees <rein...@vanrees.org> wrote: > On 09-08-11 1

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-11 Thread raj
On 10-08-11 21:26, raj wrote: > > > And yea, admin docs is in my installed list. Much appreciated. > > Still can't get it to work. > > This was my traceback: > > 'str' object has no attribute 'resolve' > > It sounds like one of those url patterns isn't

Running the orbited server?

2011-08-11 Thread raj
Odd question, but I'm trying to follow this tutorial which explains how to set up comet with django. I'm just confused about some stuff when I'm trying to do the tutorial. Firstly, where does the orbited.cfg file go? I just placed it at the root of my application (where the settings.py file etc.

Re: Running the orbited server?

2011-08-12 Thread raj
t; > the live data part, but it should give you an idea where to put things and > > what goes in a cfg file) > > > On Thu, Aug 11, 2011 at 10:24 PM, raj <nano.ri...@gmail.com> wrote: > > >> Odd question, but I'm trying to follow this tutorial which explains > &g

Re: Running the orbited server?

2011-08-12 Thread raj
Oh, and I found that first app interesting. What exactly did that do? On Aug 12, 9:32 am, raj <nano.ri...@gmail.com> wrote: > This is wayyy over my head. Thanks for the project files, but I don't > even know where to begin with all of this. I wish there was more of an > orbit

Quick question on importing

2011-08-22 Thread raj
I am editing my user model, and I want to place a foreign key to a class in another model, that is in a different app. How would I go about importing it? Tree: /project/myapp/model1.py /project/myapp2/model2.py can i simply just say: from myapp2 import model2 or do I need to edit something in

Re: Quick question on importing

2011-08-23 Thread raj
Ya, well i got it to work by adding the project in front of it. Thank you for the help! On Aug 23, 1:55 am, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 23/08/2011 3:29pm, raj wrote:> I am editing my user model, and I want to > place a foreign key to a > > c

Weird Model question django

2011-08-23 Thread raj
This may be difficult to explain. I'm a little new to django and the whole idea of models. Let's say I'm making an article app, where each article has a creator, but other users can edit the article at will. I'm having a little difficult on how to create the models for this. Firstly, I extend

Re: Weird Model question django

2011-08-23 Thread raj
nvm, I think i'm starting to figure it out. Need to read up on many-to- many fields. On Aug 23, 2:21 am, raj <nano.ri...@gmail.com> wrote: > This may be difficult to explain. I'm a little new to django and the > whole idea of models. > > Let's say I'm making an article app, wher

Re: unexpected error with inline model

2010-08-08 Thread raj
> type object 'MeetingTalkInline' has no attribute 'date_hierarchy' date_hierarchy is an attribute expected to be with every 'normal' admin classes. Why do django tries to search it in your inline admin? Just because you have registered it as you do with normal admins. Usually, inlines are not to

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread raj
. Raj. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit

Re: manage.py syncdb error

2010-06-13 Thread raj
The problem is obvious, right? Which comment says you to leave the ENGINE as blank? set it to the db you want, say, sqlite3. Rajeesh. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Rendering the Admin app list?

2010-06-25 Thread raj
> Before I "pass the variable app_list"; do I not need to create what is > in this variable first?  If so, how? That template is rendered by the view, AdminSite.index() found at django.contrib.admin.sites. Please Check it to know how it's done. Rajeesh. -- You received this message because

Re: list display based on logged-in user

2010-07-07 Thread raj
Try overriding changelist_view of your ModelAdmin. Reset self.list_display based on user and then call the super method changelist_view. Rajeesh. On Jul 8, 2:40 am, rahul jain wrote: > I would like to display model fields based on the logged-in user. > How is it

Re: models.py import from other models.py

2010-07-07 Thread raj
try importing from myproject.master.models, not master.models. Rajeesh. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: list display based on logged-in user

2010-07-09 Thread raj
You are trying to override change_view instead of changelist_view. Otherwise your approach must work. class CustomAdmin(admin.ModelAdmin): def changelist_view(whatever_args_are_here): if condition: self.list_display = custom_list return super(CustomAdmin,

Re: list display based on logged-in user

2010-07-17 Thread raj
Re-posting the reply since the 1st didn't appear here: This happens because We've excluded 'action_checkbox', an item put by the ModelAdmin by default, from list_display. * Rewrite the prev code so as to include 'action_checkbox' also to list_display * OR just leave it to ModelAdmin. You'll first

Re: list display based on logged-in user

2010-07-17 Thread raj
Sorry for the trouble. ModelAdmin by default has an attribute named 'action_checkbox' in list_display to show the checkbox in each result row. On overridding we've excluded it. * You may change your code as list_display = ['action_checkbox'] + list(list_display). * Or better forget it by setting

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-27 Thread raj
Most probably it has something to do with permissions. Go thru the exact code block which tries to post the data. Is the login successful and does the logged-in user have got all necessary permissions required? Post that part of the code if you can't find out. Rajeesh. On Jul 27, 11:20 pm,

Re: help with Django model and 'choices'

2010-02-02 Thread raj
To populate a ModelMultipleChoiceField of a ModelForm I'd used a hack similar to Shawn's initial suggestion. So I hope this will work: Add to your modelform: def __init__(self, whatever_there_are_as_args): super() # with usual syntax and required_args if instance is not None and

Re: About response.status_code on testing

2010-03-02 Thread raj
Had tried with login using client.login() and the above result was after that. Will try with printing out response.content. Thanks for the time spent. Rajeesh. On Mar 2, 7:03 pm, Daniel Roseman wrote: > Doing "print response.content" before the assertion should show

Re: About response.status_code on testing

2010-03-02 Thread raj
You're Right. The problem is that my attempt at client.login() has failed somehow. Rajeesh. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group,

Re: Help with Date Functions

2010-03-02 Thread raj
Now that's a pure python typo. You must add(+) datetime.timedelta to read_receipt. On Mar 2, 8:01 pm, Chris McComas wrote: > I tried this: > > new_admit.read_receipt.datetime.timedelta(days=7) > > and I got this error: > > http://dpaste.com/166919/ -- You received this

Re: how to check size of a dict or list in template

2010-03-03 Thread raj
To find whether a list/dict, say dd, is empty or not {% if dd %} is enough. It'll return False when there is no dd defined or if it's value can be False. Empty lists/dicts are evaluated to be False. Check built-in filters like length, length_is etc also. Rajeesh. -- You received this

Re: Permissions help

2010-03-12 Thread raj
If you want to impose the restriction only upon delete through admin interface, try to override modelAdmin's has_delete_permission() method. Or else, model.delete(). On Mar 12, 8:37 pm, Brandon Taylor wrote: > I need to add a custom permission to only allow deletes on

Re: ManagementForm validation error in unit test

2010-03-18 Thread raj
> ValidationError: [u'ManagementForm data is missing or has been tampered > with'] > >> formset = ImageFormset(data,prefix='image_form') > > This works, but if I leave out the prefix in the last command then the same > ValidationError is raised. You've almost found it yourself. When you don't

Re: ManagementForm validation error in unit test

2010-03-18 Thread raj
> This works, but if I leave out the prefix in the last command then the same > ValidationError is raised. You've almost worked it out yourself. This error usually occurs when the given prefix does not match with what django expected. When you don't provide any prefix argument on generating

Re: how to add a field to a model form when the field is not in the model

2010-04-07 Thread raj
On Apr 7, 8:05 am, Merrick wrote: > How should I go about adding a field to a model form > when the field is not part of the model? Define a Custom ModelForm by specifying model in Meta and declare the required addnl field there. (check-box means boolean, right?). Now set

Re: label when customize django form

2011-01-24 Thread raj
Have you checked `form.email.label_tag`? > > But this may looks ugly. Is there a way to load the label from > > forms.py even if we are not using form.as_ ?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django - Verfication of runserver vs browser

2011-01-24 Thread raj
If none of above seems to work, You may be using a browser like google chrome, which by default ignores the localhost. -- 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

Re: Advanced Tutorial (how to write reusable app), last step does not work

2013-12-20 Thread Raj
Faced the same problem with the Django 1.6 tutorial... circumvented it by renaming "index.html" to "poll_list.html". Read on if you want to know more about this issue... It seems there is a problem with the template loader, or the specification of which template to load for the

Industrial Analytics

2018-02-25 Thread Raj
Dear All, Can we use Django for Industrial Analytics ? . Where data volume is huge & with frequency in Mill seconds. Can someone name some examples of such industrial analytics application developed using Django. Thanks, Raj -- You received this message because you are subscr

Where is in django-cms venv folder exactly I can find edit and structure panel source code in pycharm IDE?

2020-03-17 Thread RAJ
How to see dajngo CMS all source code of administration page in pycharm . "View published" and "publish changes" button code in django cms adminstation panel in pycharm after installing django cms in pycharm through terminal. My New Created page is where is saving I can't understand.After

  1   2   >