Django authentication for external apache

2009-08-04 Thread rahul

Hello,

I am sure this question would have come up a number of times but I
couldn't find any links to suit my requirements.

I want to run an external apache to serve media. Apache is to serve
media only if the user is logged in. I saw a couple of links for
installing Apache Authentication Handlers but they are using basic
request without the middlewares.

I would need the same request for apache authentication so that I can
check the authentication and decide the permissions. Can someone point
me towards some resources?
pass

--~--~-~--~~~---~--~~
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



New Release of ibm_db_django(1.0) is out of beta

2010-07-19 Thread Rahul
IBM_DB_DJANGO-1.0
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Added IBM Dataservers backend support for Django 1.0.x and 1.1.x
application Framework using Jython language

SVN access to the source
---
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django

Installation

$ easy_install ibm_db_django

Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback. Have fun.

Thanks,
Rahul Priyadarshi

Get Started with DB2 Express-C 9.7.1

DB2 9.7 is now available. Download Express-C for free, go to:
http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&S_TACT=ACDB2011

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Help needed for XML to xslt conversion

2010-08-13 Thread Rahul
Hi
I have seen a lots of example to pick the data from simple xml for example






Empire Burlesque
Bob Dylan
USA
Columbia
10.90
1985



to convert it into a table following xsl works

  



  
  

But what if input is something complex like



  
This defines the origin of the last configuration action
affecting the object.
  
  
This defines the origin of the last configuration action
affecting the object..
  
  
  
  

  

  
  
  


  




  change_origin_t
  








  
Value is set by the system
  

  



If I need to pick class="XXX" or name="Origin".

Please help

Regards
Rahul

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



New Release of ibm_db_django(1.0.1)

2010-09-01 Thread Rahul
IBM_DB_DJANGO-1.0.1
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Fixed LIMIT constraint in select statement with column name alias
 - Fixed Unique column constraint with one NULL value
 - Fixed Unique columns together with one null value
 - Added Standard deviation, Variance function support (for population
standard deviation and variance)
 - Added MOD, BITAND and BITOR function support

SVN access to the source
---
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/

Installation

$ easy_install ibm_db_django

Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback. Have fun.

Cheers,
Rahul Priyadarshi

Download Express-C for free, go to:
---
-
http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&S_TACT=ACDB2011

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



ANNOUNCE:- ibm_db_django-0.2.0 IBM Dataservers backend support for Django 1.2 Released

2010-03-27 Thread Rahul
IBM_DB_DJANGO-0.2.0
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Added support for Django-1.2
 - Backward compatibility - Same codebase works with Django 1.0.x,
1.1.x and 1.2
 - Exact look-up for LOB fields upto 4k Chars of data
 - added tablespace_sql method in operations.DatabaseOperations


SVN access to the source
---
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/


Installation

$ easy_install ibm_db_django


Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback. Have fun.


Thanks,
Rahul Priyadarshi

Get Started with DB2 Express-C 9.7.1

DB2 9.7 is now available. Download Express-C for free, go to:
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=swg-db2expressc&S_CMP=ECDDWW01&S_TACT=ACDB206

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



static files not getting served

2021-12-04 Thread Rahul
hey guys  am using default database i.e. SQL Lite3 but when i deploy it on 
heroku my static files are not getting served . Please suggest what should 
i do??

should i use postgres ???

Please HELP

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3afdbdd1-c481-498e-b659-44bfc2e691c4n%40googlegroups.com.


Re: static files not getting served

2021-12-05 Thread Rahul
see brother i am not shouting at all . i am using heroku for deployment and 
i didnt got any big error just in websites console ''failed to load 
resource server responded with the status of 404 ''
i had deployed by pushing files to github and then using heroku  . i had 
also used whitenoise but it didnt worked ,, im using sqllite3 which is 
provided by django .. 

my website is working fine . just all the images which are shown in picture 
are not working[image: problem.PNG]
On Saturday, 4 December 2021 at 22:03:56 UTC+5:30 Kasper Laudrup wrote:

> On 04/12/2021 10.52, Rahul wrote:
> > hey guys  am using default database i.e. SQL Lite3 but when i deploy it 
> > on heroku my static files are not getting served . Please suggest what 
> > should i do??
> >
>
> You should tell us some relevant details, e.g. how you are deploying 
> your project, any error messages, which instructions you have followed 
> for deploying etc. so someone actually has a chance of helping you.
>
>
> > should i use postgres ???
> > 
>
> Static files and the choice of database are not related so that won't 
> make a difference.
>
> > Please HELP
> > 
>
> Please don't SHOUT.
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41c8d789-8edd-4e63-9a14-98a7f10ec2den%40googlegroups.com.


Django not load CSS

2022-09-02 Thread Rahul
Hey there,  I really need a help for this. I m try to deploy django project 
on live serve as we need to off debug=False. But when Debug is false  it 
won't load the css of any page. please do need fully. waiting for reply.

Thanks .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7216f46c-5532-4fc4-9d17-651fa471912dn%40googlegroups.com.


New Release of IBM_DB_DJANGO (1.0.4)

2012-05-16 Thread Rahul
IBM_DB_DJANGO-1.0.4
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Added support for Django-1.4

 - Backward compatibilty - Same codebase works with older supported
version of Django

 - Added support to enable Django's USE_TZ feature

 - Added support for Django's bulk_create

 - Added support for 'SELECT FOR UPDATE'

 - Added module version string __version__


SVN access to the source
---
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/

Installation

$ easy_install ibm_db_django

Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback. Have fun.

Cheers,
Rahul Priyadarshi

Download Express-C for free, go to:
---
-
http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&S_TACT=ACDB2011

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Python Weekly

2011-09-26 Thread Rahul
Hi Everyone,

I have started a free weekly newsletter called Python Weekly which
includes curated news, articles, new releases, software & tools,
events, jobs etc about Python and related technologies. It's a great
way to keep abreast of what's happening in Python land. You can
subscribe to it here, http://www.pythonweekly.com/

Regards
Rahul Chaudhary

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



New Release of IBM_DB_DJANGO (1.0.5)

2013-05-10 Thread Rahul
IBM_DB_DJANGO-1.0.5
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Added support for Django-1.5, with backward compatibilty
 - Added support for REGEX lookup
 - Added support for Python-3.x


GIT access to the source
---
http://code.google.com/p/ibm-db/source/browse/#git/IBM_DB/ibm_db_django/

Installation

$ easy_install ibm_db_django

Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback.

Cheers,
Rahul Priyadarshi

Download Express-C for free, go to:
---
http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&S_TACT=ACDB2011

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




ibm_db_django-1.0.2 IBM Dataservers backend support for Django 1.3 Released

2011-03-30 Thread Rahul
IBM_DB_DJANGO-1.0.2
---
IBM_DB_DJANGO adaptor enables access to IBM databases from Django
applications http://www.djangoproject.com/. The adaptor is developed
and maintained by IBM.

What's New?

 - Added support for Django-1.3
 - Backward compatibility - Same codebase works with Django 1.0.x,
1.1.x, 1.2.x and 1.3.x
 - Fixed Unique column constraint having more than one NULL value
 - Fixed Unique columns together having more than one NULL value
 - Added date interval functionality
 - Fixed Boolean data type return for BooleanField/NullBooleanField

SVN access to the source
---
http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/

Installation

$ easy_install ibm_db_django

Feedback/Suggestions/Issues

You can provide us feedback/suggestions, or report a bug/defect, or
ask for help by using any of the following channels:
1. Mailing us at open...@us.ibm.com
2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
For prerequisites, installation steps and help details, visit -
http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
Try this out and let us know you valuable feedback. Have fun.

Cheers,
Rahul Priyadarshi

Download Express-C for free:
---
http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&S_TACT=ACDB2011

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ANN: Django 1.1.2 and Django 1.2 released

2010-05-17 Thread rahul jain
Awesome job...but I discovered just one problem. Select all missing from
admin panel. So now i cannot select all the objects if i want to from admin
panel. It was fine on django 1.1. Its not fine on django 1.2 nor in the
development versions.

--RJ

On Mon, May 17, 2010 at 7:11 PM, Joshua Partogi wrote:

> I have just read through the release notes, and really amazed how
> django 1.2 has evolved from 1.1.
>
> Kudos to everyone that is involved and put all effort into delivering
> django 1.2
>
>
> Kind regards,
> Joshua
>
>
> On May 18, 9:46 am, Continuation  wrote:
> > Congrats to the Django team.
> >
> > Thanks for the great job. Really appreciate all your work.
> >
> > On May 17, 2:19 pm, James Bennett  wrote:
> >
> >
> >
> > > We're pleased today to announce the release of both Django 1.1.2 --
> > > the second bugfix release in the 1.1 series -- and the long-awaited
> > > Django 1.2.
> >
> > > More information is available over at djangoproject.com:
> >
> > > * Django 1.1.2 release announcement:
> http://www.djangoproject.com/weblog/2010/may/17/112/
> > > * Django 1.1.2 release notes:
> http://docs.djangoproject.com/en/1.1/releases/1.1.2/
> > > * Django 1.2 release announcement:
> http://www.djangoproject.com/weblog/2010/may/17/12/
> > > * Django 1.2 release notes:
> http://docs.djangoproject.com/en/dev/releases/1.2/
> >
> > > --
> > > "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
> >
> > > --
> > > 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 this group athttp://
> groups.google.com/group/django-users?hl=en.
>
> --
> 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 this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



django filters

2010-05-19 Thread rahul jain
Hi,

In my model, I have set up one filter which helps in filtering out the
results on admin Panel. The way its works now
that its displays the old objects first and then the most recent ones. Is it
possible to make it other way around ?.

Let me know.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



is it possible ?

2010-05-20 Thread rahul jain
Hi Everyone,

I would like to implement different views in admin panel based on the user.

if the user is any other user apart from admin

then for all those models, the user should just be able to see those
objects,( no change, delete and add).
Those users should also not see the select boxes or basically select all.

So by default django provides three permissions, add, delete,change. I
would like to add one more permission on admin panel.

I know this could be done on our own views through this

class USCitizen(models.Model):
# ...
class Meta:
permissions = (
("can_drive", "Can drive"),
("can_vote", "Can vote in elections"),
("can_drink", "Can drink alcohol"),
)


{% if perms.foo %}
You have permission to do something in the foo app.
{% if perms.foo.can_vote %}
You can vote!
{% endif %}
{% if perms.foo.can_drive %}
You can drive!
{% endif %}
{% else %}
You don't have permission to do anything in the foo app.
{% endif %}


But how to do the same thing on the django admin. Also, how to remove
the select all functionality for selected users.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: is it possible ?

2010-05-20 Thread rahul jain
Hi Danfi,

Thanks for your quick response. But can you explain a little more how
can we connect ChangeList class with that function change_view.
Confuse about it.

--RJ



2010/5/20 Danfi :
> In Auth group you can create a group and set the limits.
>
> see different panel maybe use changelist_view
>
> I saw this just be similar to yours'
>
> class Part(models.Model):
> is_deleted = models.BooleanField()
> //
> class PartAdmin(admin.ModelAdmin):
> actions =None
> def change_view(self, request, object_id, extra_context=None):
> if Part.objects.get(id=object_id).is_deleted==True and
> request.user.is_superuser == False:
> return HttpResponseRedirect('/admin/')
> else:
> return super(PartAdmin, self).change_view(request,
> object_id,extra_context=None)
>
> /
> edit admin/views/main.py
> IS_DELETED_VAR = 'is_deleted'
>
> class ChangeList(object):
> def __init__(self, request, model, list_display, list_display_links,
> list_filter, date_hierarchy, search_fields, list_select_related,
> list_per_page, list_editable, model_admin):
> self.model = model
> self.opts = model._meta
> self.lookup_opts = self.opts
> self.root_query_set = model_admin.queryset(request)
>  try:
> f =self.lookup_opts.get_field(IS_DELETED_VAR)
> except models.FieldDoesNotExist:
> self.root_query_set = self.root_query_set
> else:
> if isinstance(f,models.BooleanField) and (request.user.is_superuser ==
> False):
> self.root_query_set = self.root_query_set.exclude(is_deleted = 'True')
> else:
> self.root_query_set = self.root_query_set
>
> On 5月21日, 下午12时01分, rahul jain  wrote:
>> Hi Everyone,
>>
>> I would like to implement different views in admin panel based on the user.
>>
>> if the user is any other user apart from admin
>>
>> then for all those models, the user should just be able to see those
>> objects,( no change, delete and add).
>> Those users should also not see the select boxes or basically select all.
>>
>> So by default django provides three permissions, add, delete,change. I
>> would like to add one more permission on admin panel.
>>
>> I know this could be done on our own views through this
>>
>> class USCitizen(models.Model):
>> # ...
>> class Meta:
>> permissions = (
>> ("can_drive", "Can drive"),
>> ("can_vote", "Can vote in elections"),
>> ("can_drink", "Can drink alcohol"),
>> )
>>
>> {% if perms.foo %}
>> You have permission to do something in the foo app.
>> {% if perms.foo.can_vote %}
>> You can vote!
>> {% endif %}
>> {% if perms.foo.can_drive %}
>> You can drive!
>> {% endif %}
>> {% else %}
>> You don't have permission to do anything in the foo app.
>> {% endif %}
>>
>> But how to do the same thing on the django admin. Also, how to remove
>> the select all functionality for selected users.
>>
>> --RJ
>>
>> --
>> 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 this group 
>> athttp://groups.google.com/group/django-users?hl=en.
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: is it possible ?

2010-05-23 Thread rahul jain
Hi Daniel,

I think this will solve this problem

if i have a boolean field in my model and if I would like to display
only if that fileld id true to the non-super users and otherwise
always show the boolean field.

But my question was

how to disable the select all widget from the admin panel if the user
is non-super user. The select all widget helps in selecting all the
objects but since my action is empty, i dont want to show any widget.

Also, I am not sure why we need this as well

def change_view(self, request, object_id, extra_context=None):
if Part.objects.get(id=object_id).is_deleted==True and
request.user.is_superuser == False:
return HttpResponseRedirect('/admin/')
else:
return super(PartAdmin, self).change_view(request,
object_id,extra_context=None)

Thanks.

--RJ





2010/5/21 Danfi :
> ChangeList is in the file /python**/Lib/site-packages/django/contrib/
> admin/views/main.py ,and we use ModelAdmin so change_view function can
> direct to be used.
>
> On 5月21日, 下午2时08分, rahul jain  wrote:
>> Hi Danfi,
>>
>> Thanks for your quick response. But can you explain a little more how
>> can we connect ChangeList class with that function change_view.
>> Confuse about it.
>>
>> --RJ
>>
>> 2010/5/20 Danfi :
>>
>>
>>
>> > In Auth group you can create a group and set the limits.
>>
>> > see different panel maybe use changelist_view
>>
>> > I saw this just be similar to yours'
>>
>> > class Part(models.Model):
>> > is_deleted = models.BooleanField()
>> > //
>> > class PartAdmin(admin.ModelAdmin):
>> > actions =None
>> > def change_view(self, request, object_id, extra_context=None):
>> > if Part.objects.get(id=object_id).is_deleted==True and
>> > request.user.is_superuser == False:
>> > return HttpResponseRedirect('/admin/')
>> > else:
>> > return super(PartAdmin, self).change_view(request,
>> > object_id,extra_context=None)
>>
>> > /
>> > edit admin/views/main.py
>> > IS_DELETED_VAR = 'is_deleted'
>>
>> > class ChangeList(object):
>> > def __init__(self, request, model, list_display, list_display_links,
>> > list_filter, date_hierarchy, search_fields, list_select_related,
>> > list_per_page, list_editable, model_admin):
>> > self.model = model
>> > self.opts = model._meta
>> > self.lookup_opts = self.opts
>> > self.root_query_set = model_admin.queryset(request)
>> >  try:
>> > f =self.lookup_opts.get_field(IS_DELETED_VAR)
>> > except models.FieldDoesNotExist:
>> > self.root_query_set = self.root_query_set
>> > else:
>> > if isinstance(f,models.BooleanField) and (request.user.is_superuser ==
>> > False):
>> > self.root_query_set = self.root_query_set.exclude(is_deleted = 'True')
>> > else:
>> > self.root_query_set = self.root_query_set
>>
>> > On 5月21日, 下午12时01分, rahul jain  wrote:
>> >> Hi Everyone,
>>
>> >> I would like to implement different views in admin panel based on the 
>> >> user.
>>
>> >> if the user is any other user apart from admin
>>
>> >> then for all those models, the user should just be able to see those
>> >> objects,( no change, delete and add).
>> >> Those users should also not see the select boxes or basically select all.
>>
>> >> So by default django provides three permissions, add, delete,change. I
>> >> would like to add one more permission on admin panel.
>>
>> >> I know this could be done on our own views through this
>>
>> >> class USCitizen(models.Model):
>> >> # ...
>> >> class Meta:
>> >> permissions = (
>> >> ("can_drive", "Can drive"),
>> >> ("can_vote", "Can vote in elections"),
>> >> ("can_drink", "Can drink alcohol"),
>> >> )
>>
>> >> {% if perms.foo %}
>> >> You have permission to do something in the foo app.
>> >> {% if perms.foo.can_vote %}
>> >> You can vote!
>> >> {% endif %}
>> >> {% if perms.foo.can_drive %}
>> >> You can drive!
>> >> {% endif %}
>> >> {% else %}
>> >> You don't have permission to do anything in the foo app.
>> >> {% endif %}
>

view permission on django admin

2010-05-24 Thread rahul jain
Hi Django,

I know this has been discussed lot of times but not implemented on
admin because django developers think that django admin will not be
just used for viewing.

Anyways, I need it for my model.

I went through the path but was not able to solve this problem.

http://code.djangoproject.com/ticket/7150

I think this patch is for some old code

Here what its missing

a/django/contrib/admin/sites.py
old new 
281 281 'add': 
model_admin.has_add_permission(request),
282 282 'change':
model_admin.has_change_permission(request),
283 283 'delete':
model_admin.has_delete_permission(request),
284 'view': 
model_admin.has_view_permission(request),
284 285 }
285 286 
286 287 # Check whether user has any perm for this 
module.

I checked sites.py but none of the above exists now.

Anyone know the recent patch for this.

Thanks.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Just one action on all the objects

2010-05-25 Thread rahul jain
Hi Django,

Can i run an action without any need to select all. It should by
default select everything, basically all the objects. No separate
checkbox for every object, no select all.
Also, possibly no choices, just a single button which say "action"
which should perform that action on all the objects.

for ex:

HTML Button say "Delete" on the top of change list page. When I hit it
performs delete operation on all the objects.

I need it because I want to perform just one action on all the objects.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



disabling dashboard 'recent actions'

2010-05-25 Thread rahul jain
Hi Django,

How to disable the dashboard ('recent actions') on django admin main page ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



django-admin-tools

2010-05-29 Thread rahul jain
Hi Django,

Anybody able to ran django-admin-tools successfully. I followed the
instructions from this website

http://packages.python.org/django-admin-tools/0.2.0/quickstart.html#quickstart

I was expecting a new theme for dashboard and index page after hitting
admin link but its still the same.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-admin-tools

2010-05-31 Thread rahul jain
Hi David,

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@domain.com'),
)

MANAGERS = ADMINS



DATABASE_ENGINE = 'mysql'   # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.


# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/Users/---/Documents/---/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '---'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.csrf.middleware.CsrfMiddleware',
)

ROOT_URLCONF = '---.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"mytemplates",
)

TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.request',
)


INSTALLED_APPS = (
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
'django.contrib.auth',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.contenttypes',
'---.---',
'django.contrib.databrowse'

)

and then if  i do "" ls -ln media """ inside my root project directory,

admin_tools -> /Library/Python/2.6/site-packages/admin_tools/media/admin_tools



urls.py

from django.conf.urls.defaults import *
from django.contrib import databrowse


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Example:
# (r'^---/', include('---.foo.urls')),

# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
(r'^admin_tools/', include('admin_tools.urls')),
(r'^data/(.*)', databrowse.site.root),

)

My guess is documentation is wrong.I think admin_tools media folder
should be inside django.contrib.admin.

--RJ


On Sun, May 30, 2010 at 10:55 AM, izi  wrote:
> Hi,
>
> On 30 mai, 08:43, rahul jain  wrote:
>> Hi Django,
>>
>> Anybody able to ran django-admin-tools successfully. I followed the
>> instructions from this website
>>
>> http://packages.python.org/django-admin-tools/0.2.0/quickstart.html#q...
>>
>> I was expecting a new theme for dashboard and index page after hitting
>> admin link but its still the same.
>>
>
> If you followed the quickstart step by step it should work.
> Please give more information about your settings, urls, the version of
> django you are using, etc.
>
> Note: django-admin-tools has its own mailing list so you should post
> there :
> http://groups.google.

django problems

2010-05-31 Thread rahul jain
Hi Django,

I have few questions and would like to seek your help.


Q1) I have defined lot of admin actions and some of the actions
require creating threads. So I split my long models.py into set of
files. But whenever I try to import anything from models
python complains ?

ex: if i have defined model name

class Test(models.Model):
blah blah

In my second file, I tried importing this class by using following

from models import Test

from app_name.models import Test

but none of them work.I am not sure why ?

Q2) Also, I have split my admin functions into set of functions

func1(){

   func2()

}


and in func2 (), if something bad happens

I would like to do self.message_user (request,"Bad") and then exit.

Right now i have to do return

But once it return back to func1() then it keeps on adding more of
those messages defined inside func1 ().

So how to do the redirect inside func2 () so that it simply exits and
displays just one message on admin.


Q3)Thirdly list_ordering dosent work for django default id. So i am
using django id (autoincrement primary key)

and would like to display in other way around like it should start
from 1 ---100 not from 100  ---1 on display.

so i tried this on admin model

lordering = ('-id',)

but it complains the id does not exist which exists though but not
defined by me.

Q4) how to change the theme for my django admin ?

Thanks for your help.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



django python pi-charts/graphs

2010-06-01 Thread rahul jain
Hi Django,

I would like to represent my db/model content in the form of
pi-charts/graphs. Is there any django python module that already
exists ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



admin modifications

2010-06-01 Thread rahul jain
Hi Django,

I am not sure how this could be done, so on the admin display, on one
of the columns I would like to provide select tab. If i select one of
the options,
it should update some other column on the display.

Firstly, whats the clean way for adding select boxes on the admin
display, it could be one of the columns

Secondly, if i select one of those options, could I do it without
hitting any server, the ajax way.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: admin modifications

2010-06-04 Thread rahul jain
Hi Daniel,

Yes I know about admin actions but I would like to provide a select
option/modify button on every rows inside my admin display. Not just
at one place.

--RJ

On Wed, Jun 2, 2010 at 1:05 AM, Daniel Roseman  wrote:
> On Jun 2, 7:56 am, rahul jain  wrote:
>> Hi Django,
>>
>> I am not sure how this could be done, so on the admin display, on one
>> of the columns I would like to provide select tab. If i select one of
>> the options,
>> it should update some other column on the display.
>>
>> Firstly, whats the clean way for adding select boxes on the admin
>> display, it could be one of the columns
>>
>> Secondly, if i select one of those options, could I do it without
>> hitting any server, the ajax way.
>>
>> --RJ
>
> Admin actions are what you need:
> http://docs.djangoproject.com/en/1.2/ref/contrib/admin/actions/
> --
> DR.
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



django and android application

2010-06-05 Thread rahul jain
Hi Django,

I would like to create an android application which talks to Django.
If I hit a url on my phone, it hits one of my views (urlconf), that
view
processes the request and give the result back to the android app.

Anybody in the community have any knowledge how to proceed with it

Firstlty, how to hit my Django server from android application

Secondly, how to send back the results.

Any tips, suggestions and design help will be appreciated.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



new objects display first on admin filter display

2010-06-06 Thread rahul jain
Hi Django,

How to display ordering on admin filter in reverse order. Its a char Field

I would like to display new objects created first.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: new objects display first on admin filter display

2010-06-07 Thread rahul jain
Hi Daniel,

New objects first on the filter display, but my filter is applied on Charfield.

So for ex: , I am creating like suppose x number of objects with a
field with value key_timestamp (charfield).

Then I am creating a filter on the CharField. I am not sure how its
implementing it but its displaying (key_timetamp) in a reverse order
(I mean older to newest). I was expecting it to be a random order
since its a charfield. So I would like it to display newly created
key_timestamp first. So that I can get all the new objects with that
timestamp.

--RJ

On Mon, Jun 7, 2010 at 1:17 AM, Daniel Roseman  wrote:
> On Jun 7, 4:35 am, rahul jain  wrote:
>> Hi Django,
>>
>> How to display ordering on admin filter in reverse order. Its a char Field
>>
>> I would like to display new objects created first.
>>
>
> Well, which? Do you want it reverse sorted by your charfield? Or do
> you want to display new objects first? Those two seem to be opposing
> requirements.
> --
> DR.
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



no checkboxes for read only objects

2010-06-07 Thread rahul jain
Hi Django,

Is this possible ?

On change list page, I would like to provide check boxes only for the
objects which could be effected by admin actions.
But for some of the objects I would not like to provide admin actions
since I don't wont them to be modified.

check box if we can modify the object, otherwise not.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ordering objects in the admin area

2010-06-08 Thread rahul jain
Could this be used to retrieve new objects first ?.

On Tue, Jun 8, 2010 at 6:41 AM, Alessandro Pasotti  wrote:
> 2010/6/8 grimmus 
>>
>> Hi,
>>
>> I have a staff app that lists staff photos and their names. The client
>> would like to be able to re-order these in the admin area easily.
>> Ideally there would be a dropdown where the user could select between
>> 1 and n which object should appear in what position in the list.
>>
>> I could add an extra integer field to the model, but how would i
>> initially populate it with a value ? And how would the dropdown work
>> in the admin area ?
>>
>> Thank you for any tips/advice.
>
> Hi,
> I'm not sure if this is the same problem, but what I did is to use a Mixin
> like this:
> djangosnippets.org/snippets/259/
> then, in a custom change_list.html template I used JQuery sortable to drag
> and drop items, when an item is dropped to the new position, an ajax call in
> the background calls a custom view that saves the new order (the method is
> just one: insert_at called with the new position as argument).
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
> --
> 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 this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



django's default id (auto primary key) sorting

2010-06-08 Thread rahul jain
Hi Django,

I tried lots of different ways to get my ids listed in ascending order
(1 - x). But it always displays id's (x -1).

This is what I tried

So, I am talking about auto increment id which is generated by default
by Django.

on models admin
ordering = ('-id',)

also i tried

on class meta

order_by = ('-id',)

This is only happening with auto-increment primary key i.e id. Not
with others. Manually I can set it by going to admin
and then sorting. But I need to set the default ascending order
sorting for id's.

Is it a bug or something I am missing.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



removing "All" from django admin filters

2010-06-08 Thread rahul jain
Hi Django,

I would like to remove  "All" from filters. It becomes very confusing
when i change back and forth between pages. Since it always gets back
to "All" instead of keeping the state.

Whats a clean way to do it ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



how to fetch query string in the view

2010-06-08 Thread rahul jain
HI Django,

So I am generating a url of the form

http://test/?test1=test&test2=test

In my views how to process the query string ?test1=test&test2=test.  I
mean how to access test1 and test2 values.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



not able to recognize non-default python files in app + project directory

2010-06-10 Thread rahul jain
Hi Django,

In my app directory, I splitted my models and views.py into multiple
files since they start becoming very long but django is not able to
recognize those files .
It only recognizes models.py, views.py, tests.py (default ones).

So In my other files If i do this

from ..models import 

I get this error

ImportError: cannot import name 

If I do the same on views.py, it just works fine.

Even on Eclipse I can see Django default files with different symbol
and python files with different symbols.

How to solve this problem ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-10 Thread rahul jain
HI Dan,

Thanks for your response but that will not solve my problem.

I am not splitting models. I am splitting actions defined in the
models  across multiple files.

So suppose

one of my model actions is calling which in turn calls the constructor
or simple functions defined in normal python files

for ex:

def action (self, request, queryset):

Test1() //calls default constructor of the class
Test2()

Now each of these are separate class files names as Test1.py Test2.py.

In each of these files i want to do this

from ..models import 

But I get this error

ImportError: cannot import name 

I tired various other variotions like just

from models import 

from .models import 

or without from

but none of them are working.

Also, in order to call this Test1() I thought if  I import
Test1 in models then it will just work but again not

--RJ



On Thu, Jun 10, 2010 at 1:57 PM, Dan Harris  wrote:
> When you split things out into multiple files or directories you have
> to remember to import them into the models.py file or the __init__.py
> file (if using a directory).
>
> So if i had some models in a new file "extraModels.py" for example
>
> # In extraModels.py
> class ExtraModel(models.Model):
>    pass
>
> Then in the regular "models.py"
>
> # In models.py
> from extraModels import ExtraModel
>
> class RegularModels(model.Model):
>   pass
>
> The key is that you ahve to import any models in your split files into
> your normal models.py file. This is because Django looks for models in
> the models.py file only. If you make a models directory, you have to
> import all models you want Django to recognize into your __init__.py
> file within the models directory.
>
> Hopefully this makes sense, if not I can try to be more clear.
>
> Dan Harris
> dih0...@gmail.com
>
>
> On Jun 10, 4:46 pm, rahul jain  wrote:
>> anyone on this ??
>>
>> --RJ
>>
>>
>>
>> On Thu, Jun 10, 2010 at 11:34 AM, rahul jain  wrote:
>> > Hi Django,
>>
>> > In my app directory, I splitted my models and views.py into multiple
>> > files since they start becoming very long but django is not able to
>> > recognize those files .
>> > It only recognizes models.py, views.py, tests.py (default ones).
>>
>> > So In my other files If i do this
>>
>> > from ..models import 
>>
>> > I get this error
>>
>> > ImportError: cannot import name 
>>
>> > If I do the same on views.py, it just works fine.
>>
>> > Even on Eclipse I can see Django default files with different symbol
>> > and python files with different symbols.
>>
>> > How to solve this problem ?
>>
>> > --RJ
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-10 Thread rahul jain
anyone on this ??

--RJ

On Thu, Jun 10, 2010 at 11:34 AM, rahul jain  wrote:
> Hi Django,
>
> In my app directory, I splitted my models and views.py into multiple
> files since they start becoming very long but django is not able to
> recognize those files .
> It only recognizes models.py, views.py, tests.py (default ones).
>
> So In my other files If i do this
>
> from ..models import 
>
> I get this error
>
> ImportError: cannot import name 
>
> If I do the same on views.py, it just works fine.
>
> Even on Eclipse I can see Django default files with different symbol
> and python files with different symbols.
>
> How to solve this problem ?
>
> --RJ
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
Yes they are in the same directory. How to use __initial__.py ?

On Fri, Jun 11, 2010 at 3:38 AM, Scott Gould  wrote:
> Did you put Test1.py and Test2.py into a "models" directory where
> models.py would normally be, and add an __initial__.py file to it?
>
> On Jun 10, 5:18 pm, rahul jain  wrote:
>> HI Dan,
>>
>> Thanks for your response but that will not solve my problem.
>>
>> I am not splitting models. I am splitting actions defined in the
>> models  across multiple files.
>>
>> So suppose
>>
>> one of my model actions is calling which in turn calls the constructor
>> or simple functions defined in normal python files
>>
>> for ex:
>>
>> def action (self, request, queryset):
>>
>>     Test1()     //calls default constructor of the class
>>     Test2()
>>
>> Now each of these are separate class files names as Test1.py Test2.py.
>>
>> In each of these files i want to do this
>>
>> from ..models import 
>>
>> But I get this error
>>
>> ImportError: cannot import name 
>>
>> I tired various other variotions like just
>>
>> from models import 
>>
>> from .models import 
>>
>> or without from
>>
>> but none of them are working.
>>
>> Also, in order to call this Test1() I thought if  I import
>> Test1 in models then it will just work but again not
>>
>> --RJ
>>
>>
>>
>> On Thu, Jun 10, 2010 at 1:57 PM, Dan Harris  wrote:
>> > When you split things out into multiple files or directories you have
>> > to remember to import them into the models.py file or the __init__.py
>> > file (if using a directory).
>>
>> > So if i had some models in a new file "extraModels.py" for example
>>
>> > # In extraModels.py
>> > class ExtraModel(models.Model):
>> >    pass
>>
>> > Then in the regular "models.py"
>>
>> > # In models.py
>> > from extraModels import ExtraModel
>>
>> > class RegularModels(model.Model):
>> >   pass
>>
>> > The key is that you ahve to import any models in your split files into
>> > your normal models.py file. This is because Django looks for models in
>> > the models.py file only. If you make a models directory, you have to
>> > import all models you want Django to recognize into your __init__.py
>> > file within the models directory.
>>
>> > Hopefully this makes sense, if not I can try to be more clear.
>>
>> > Dan Harris
>> > dih0...@gmail.com
>>
>> > On Jun 10, 4:46 pm, rahul jain  wrote:
>> >> anyone on this ??
>>
>> >> --RJ
>>
>> >> On Thu, Jun 10, 2010 at 11:34 AM, rahul jain  
>> >> wrote:
>> >> > Hi Django,
>>
>> >> > In my app directory, I splitted my models and views.py into multiple
>> >> > files since they start becoming very long but django is not able to
>> >> > recognize those files .
>> >> > It only recognizes models.py, views.py, tests.py (default ones).
>>
>> >> > So In my other files If i do this
>>
>> >> > from ..models import 
>>
>> >> > I get this error
>>
>> >> > ImportError: cannot import name 
>>
>> >> > If I do the same on views.py, it just works fine.
>>
>> >> > Even on Eclipse I can see Django default files with different symbol
>> >> > and python files with different symbols.
>>
>> >> > How to solve this problem ?
>>
>> >> > --RJ
>>
>> > --
>> > 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 this group 
>> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
@bruno: yes functions.

So in some other file I want to use models methods like

.objects. all

For that I have to import the  . But I am not able to.

Import works fine on views.py

Also, can you test this for me

Create views1.py (not views.py)

import your model class

and in one of the functions do
.objects. all

and then run python manage.py runserver. I think it will break.

Let me know what i am missing or will __initial__.py will solve this
problem   ?.





On Fri, Jun 11, 2010 at 6:53 AM, rahul jain  wrote:
> Yes they are in the same directory. How to use __initial__.py ?
>
> On Fri, Jun 11, 2010 at 3:38 AM, Scott Gould  wrote:
>> Did you put Test1.py and Test2.py into a "models" directory where
>> models.py would normally be, and add an __initial__.py file to it?
>>
>> On Jun 10, 5:18 pm, rahul jain  wrote:
>>> HI Dan,
>>>
>>> Thanks for your response but that will not solve my problem.
>>>
>>> I am not splitting models. I am splitting actions defined in the
>>> models  across multiple files.
>>>
>>> So suppose
>>>
>>> one of my model actions is calling which in turn calls the constructor
>>> or simple functions defined in normal python files
>>>
>>> for ex:
>>>
>>> def action (self, request, queryset):
>>>
>>>     Test1()     //calls default constructor of the class
>>>     Test2()
>>>
>>> Now each of these are separate class files names as Test1.py Test2.py.
>>>
>>> In each of these files i want to do this
>>>
>>> from ..models import 
>>>
>>> But I get this error
>>>
>>> ImportError: cannot import name 
>>>
>>> I tired various other variotions like just
>>>
>>> from models import 
>>>
>>> from .models import 
>>>
>>> or without from
>>>
>>> but none of them are working.
>>>
>>> Also, in order to call this Test1() I thought if  I import
>>> Test1 in models then it will just work but again not
>>>
>>> --RJ
>>>
>>>
>>>
>>> On Thu, Jun 10, 2010 at 1:57 PM, Dan Harris  wrote:
>>> > When you split things out into multiple files or directories you have
>>> > to remember to import them into the models.py file or the __init__.py
>>> > file (if using a directory).
>>>
>>> > So if i had some models in a new file "extraModels.py" for example
>>>
>>> > # In extraModels.py
>>> > class ExtraModel(models.Model):
>>> >    pass
>>>
>>> > Then in the regular "models.py"
>>>
>>> > # In models.py
>>> > from extraModels import ExtraModel
>>>
>>> > class RegularModels(model.Model):
>>> >   pass
>>>
>>> > The key is that you ahve to import any models in your split files into
>>> > your normal models.py file. This is because Django looks for models in
>>> > the models.py file only. If you make a models directory, you have to
>>> > import all models you want Django to recognize into your __init__.py
>>> > file within the models directory.
>>>
>>> > Hopefully this makes sense, if not I can try to be more clear.
>>>
>>> > Dan Harris
>>> > dih0...@gmail.com
>>>
>>> > On Jun 10, 4:46 pm, rahul jain  wrote:
>>> >> anyone on this ??
>>>
>>> >> --RJ
>>>
>>> >> On Thu, Jun 10, 2010 at 11:34 AM, rahul jain  
>>> >> wrote:
>>> >> > Hi Django,
>>>
>>> >> > In my app directory, I splitted my models and views.py into multiple
>>> >> > files since they start becoming very long but django is not able to
>>> >> > recognize those files .
>>> >> > It only recognizes models.py, views.py, tests.py (default ones).
>>>
>>> >> > So In my other files If i do this
>>>
>>> >> > from ..models import 
>>>
>>> >> > I get this error
>>>
>>> >> > ImportError: cannot import name 
>>>
>>> >> > If I do the same on views.py, it just works fine.
>>>
>>> >> > Even on Eclipse I can see Django default files with different symbol
>>> >> > and python files with different symbols.
>>>
>>> >> > How to solve this problem ?
>>>
>>> >> > --RJ
>>>
>>> > --
>>> > 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 this group 
>>> > athttp://groups.google.com/group/django-users?hl=en.
>>
>> --
>> 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 this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
Yes I have the __init__.py inside my app directory. Also, all my split
files are inside the same directory. If possible can you test

Create views1.py (not views.py)
>
> import your model class
>
> and in one of the functions do
> .objects. all()
>
> and then run python manage.py runserver. I think it will break.



--RJ

On Fri, Jun 11, 2010 at 7:04 AM, rahul jain  wrote:
> @bruno: yes functions.
>
> So in some other file I want to use models methods like
>
> .objects. all
>
> For that I have to import the  . But I am not able to.
>
> Import works fine on views.py
>
> Also, can you test this for me
>
> Create views1.py (not views.py)
>
> import your model class
>
> and in one of the functions do
> .objects. all
>
> and then run python manage.py runserver. I think it will break.
>
> Let me know what i am missing or will __initial__.py will solve this
> problem   ?.
>
>
>
>
>
> On Fri, Jun 11, 2010 at 6:53 AM, rahul jain  wrote:
>> Yes they are in the same directory. How to use __initial__.py ?
>>
>> On Fri, Jun 11, 2010 at 3:38 AM, Scott Gould  wrote:
>>> Did you put Test1.py and Test2.py into a "models" directory where
>>> models.py would normally be, and add an __initial__.py file to it?
>>>
>>> On Jun 10, 5:18 pm, rahul jain  wrote:
>>>> HI Dan,
>>>>
>>>> Thanks for your response but that will not solve my problem.
>>>>
>>>> I am not splitting models. I am splitting actions defined in the
>>>> models  across multiple files.
>>>>
>>>> So suppose
>>>>
>>>> one of my model actions is calling which in turn calls the constructor
>>>> or simple functions defined in normal python files
>>>>
>>>> for ex:
>>>>
>>>> def action (self, request, queryset):
>>>>
>>>>     Test1()     //calls default constructor of the class
>>>>     Test2()
>>>>
>>>> Now each of these are separate class files names as Test1.py Test2.py.
>>>>
>>>> In each of these files i want to do this
>>>>
>>>> from ..models import 
>>>>
>>>> But I get this error
>>>>
>>>> ImportError: cannot import name 
>>>>
>>>> I tired various other variotions like just
>>>>
>>>> from models import 
>>>>
>>>> from .models import 
>>>>
>>>> or without from
>>>>
>>>> but none of them are working.
>>>>
>>>> Also, in order to call this Test1() I thought if  I import
>>>> Test1 in models then it will just work but again not
>>>>
>>>> --RJ
>>>>
>>>>
>>>>
>>>> On Thu, Jun 10, 2010 at 1:57 PM, Dan Harris  wrote:
>>>> > When you split things out into multiple files or directories you have
>>>> > to remember to import them into the models.py file or the __init__.py
>>>> > file (if using a directory).
>>>>
>>>> > So if i had some models in a new file "extraModels.py" for example
>>>>
>>>> > # In extraModels.py
>>>> > class ExtraModel(models.Model):
>>>> >    pass
>>>>
>>>> > Then in the regular "models.py"
>>>>
>>>> > # In models.py
>>>> > from extraModels import ExtraModel
>>>>
>>>> > class RegularModels(model.Model):
>>>> >   pass
>>>>
>>>> > The key is that you ahve to import any models in your split files into
>>>> > your normal models.py file. This is because Django looks for models in
>>>> > the models.py file only. If you make a models directory, you have to
>>>> > import all models you want Django to recognize into your __init__.py
>>>> > file within the models directory.
>>>>
>>>> > Hopefully this makes sense, if not I can try to be more clear.
>>>>
>>>> > Dan Harris
>>>> > dih0...@gmail.com
>>>>
>>>> > On Jun 10, 4:46 pm, rahul jain  wrote:
>>>> >> anyone on this ??
>>>>
>>>> >> --RJ
>>>>
>>>> >> On Thu, Jun 10, 2010 at 11:34 AM, rahul jain  
>>>> >> wrote:
>>>> >> > Hi Django,
>>>>
>>>> >> > In my app directory, I splitted my models and views.py into mu

Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
@also I meant .objects. all().

It will give import error that  cannot be imported.



On Fri, Jun 11, 2010 at 7:09 AM, rahul jain  wrote:
> Yes I have the __init__.py inside my app directory. Also, all my split
> files are inside the same directory. If possible can you test
>
> Create views1.py (not views.py)
>>
>> import your model class
>>
>> and in one of the functions do
>> .objects. all()
>>
>> and then run python manage.py runserver. I think it will break.
>
>
>
> --RJ
>
> On Fri, Jun 11, 2010 at 7:04 AM, rahul jain  wrote:
>> @bruno: yes functions.
>>
>> So in some other file I want to use models methods like
>>
>> .objects. all
>>
>> For that I have to import the  . But I am not able to.
>>
>> Import works fine on views.py
>>
>> Also, can you test this for me
>>
>> Create views1.py (not views.py)
>>
>> import your model class
>>
>> and in one of the functions do
>> .objects. all
>>
>> and then run python manage.py runserver. I think it will break.
>>
>> Let me know what i am missing or will __initial__.py will solve this
>> problem   ?.
>>
>>
>>
>>
>>
>> On Fri, Jun 11, 2010 at 6:53 AM, rahul jain  wrote:
>>> Yes they are in the same directory. How to use __initial__.py ?
>>>
>>> On Fri, Jun 11, 2010 at 3:38 AM, Scott Gould  wrote:
>>>> Did you put Test1.py and Test2.py into a "models" directory where
>>>> models.py would normally be, and add an __initial__.py file to it?
>>>>
>>>> On Jun 10, 5:18 pm, rahul jain  wrote:
>>>>> HI Dan,
>>>>>
>>>>> Thanks for your response but that will not solve my problem.
>>>>>
>>>>> I am not splitting models. I am splitting actions defined in the
>>>>> models  across multiple files.
>>>>>
>>>>> So suppose
>>>>>
>>>>> one of my model actions is calling which in turn calls the constructor
>>>>> or simple functions defined in normal python files
>>>>>
>>>>> for ex:
>>>>>
>>>>> def action (self, request, queryset):
>>>>>
>>>>>     Test1()     //calls default constructor of the class
>>>>>     Test2()
>>>>>
>>>>> Now each of these are separate class files names as Test1.py Test2.py.
>>>>>
>>>>> In each of these files i want to do this
>>>>>
>>>>> from ..models import 
>>>>>
>>>>> But I get this error
>>>>>
>>>>> ImportError: cannot import name 
>>>>>
>>>>> I tired various other variotions like just
>>>>>
>>>>> from models import 
>>>>>
>>>>> from .models import 
>>>>>
>>>>> or without from
>>>>>
>>>>> but none of them are working.
>>>>>
>>>>> Also, in order to call this Test1() I thought if  I import
>>>>> Test1 in models then it will just work but again not
>>>>>
>>>>> --RJ
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jun 10, 2010 at 1:57 PM, Dan Harris  wrote:
>>>>> > When you split things out into multiple files or directories you have
>>>>> > to remember to import them into the models.py file or the __init__.py
>>>>> > file (if using a directory).
>>>>>
>>>>> > So if i had some models in a new file "extraModels.py" for example
>>>>>
>>>>> > # In extraModels.py
>>>>> > class ExtraModel(models.Model):
>>>>> >    pass
>>>>>
>>>>> > Then in the regular "models.py"
>>>>>
>>>>> > # In models.py
>>>>> > from extraModels import ExtraModel
>>>>>
>>>>> > class RegularModels(model.Model):
>>>>> >   pass
>>>>>
>>>>> > The key is that you ahve to import any models in your split files into
>>>>> > your normal models.py file. This is because Django looks for models in
>>>>> > the models.py file only. If you make a models directory, you have to
>>>>> > import all models you want Django to recognize into your __init__.py
>>>>> > file within the models directory.
&

Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
Hi Tim,

Here is my structure

app
|-- __init__.py
|-- models.py (all  my models)
|-- auth.py  (python functions referencing models defined in models.py)
|-- blogs.py (python functions referencing models defined in models.py)
|-- views.py (python functions referencing models defined in models.py)


for auth.py and blogs.py referencing is giving import error.

Again in these files. If I do import like

from app.models import User then I get import error.

For views.py I am able to easily import @above.

--RJ






On Fri, Jun 11, 2010 at 7:18 AM, Tom Evans  wrote:
> I'll give you the benefit of the doubt since it seems some of this is
> getting lost in translation.
>
> Your app must have this sort of structure:
>
> app
> |-- __init__.py
> |-- models
> |   |-- __init__.py
> |   |-- auth.py
> |   `-- blogs.py
> `-- views.py
>
>
> If app/models/auth.py defines a User class, and app/models/blogs.py
> defines a Blog class, then in app/views.py you would refer to them
> like this:
>
> from app.models.auth import User
> from app.models.blog import Blog
>
> You cannot refer to them like so:
>
> from app.models import *
>
> unless you first import them into app/models/__init__.py.
>
> This is well documented python semantics; read the python docs for
> more information.
>
> Cheers
>
> Tom
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: not able to recognize non-default python files in app + project directory

2010-06-11 Thread rahul jain
It was rw-r--r-- . I also modified it to 777 by" chmod -R 777". But
did not fix my problem.

This is the error which I am getting
ImportError: cannot import name 

--RJ


On Fri, Jun 11, 2010 at 7:59 AM, Tom Evans  wrote:
> On Fri, Jun 11, 2010 at 3:47 PM, rahul jain  wrote:
>> Hi Tim,
>>
>> Here is my structure
>>
>> app
>> |-- __init__.py
>> |-- models.py (all  my models)
>> |-- auth.py  (python functions referencing models defined in models.py)
>> |-- blogs.py (python functions referencing models defined in models.py)
>> |-- views.py (python functions referencing models defined in models.py)
>>
>>
>> for auth.py and blogs.py referencing is giving import error.
>>
>> Again in these files. If I do import like
>>
>> from app.models import User then I get import error.
>>
>> For views.py I am able to easily import @above.
>>
>> --RJ
>>
>
> That all looks correct. Are the file permissions correct?
>
> Can you show 'ls -l /path/to/app/' please.
>
> Cheers
>
> Tom
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



admin actions

2010-06-16 Thread rahul jain
Hi,

I would like to display javascript alert boxes when something goes
wrong during admin actions. Is it possible ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



admin filters getting reset after admin action

2010-06-16 Thread rahul jain
Hi there,

I have some filters set-up on admin page. As soon as I perform admin
action. All filters are getting reset.

Is this is a bug from framework ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: admin filters getting reset after admin action

2010-06-19 Thread rahul jain
well I solved that problem with one line of statement.

before self.message_user

just use this

return HttpResponseRedirect(request.get_full_path())

Hope it helps.

--RJ



On Sat, Jun 19, 2010 at 11:09 AM, derek  wrote:
> On Jun 18, 9:18 pm, swinton  wrote:
>> On Jun 17, 4:13 pm, derek  wrote:
>>
>> > On Jun 17, 5:44 am, rahul jain  wrote:
>>
>> > > Hi there,
>>
>> > > I have some filters set-up on admin page. As soon as I perform admin
>> > > action. All filters are getting reset.
>>
>> > > Is this is a bug from framework ?
>>
>> > No.  There are work-arounds to get back to these; Google this group
>> > for suggestions.
>>
>> Hi there,
>>
>> I'm trying to do the same (retain admin filters after action). I've
>> searched this group for suggestions, but have failed to come up with
>> anything. Can anyone give me some pointers?
>
> Not sure how you searched or why you missed this:
> http://groups.google.com/group/django-users/browse_thread/thread/d403af7a8dcdc90e/d69717b0e9a1f075
>
> Derek
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: list_editable and save changes to individual row/cell

2010-06-27 Thread rahul jain
Good question. Anyone on this ?

On Fri, Jun 25, 2010 at 9:48 AM, Jason Wang  wrote:
> Hi all,
>
> Does anyone know if there is a way to save changes on a per row/cell
> basis for forms with list_editable in django admin? I would like to
> have a button for each row and each cell to do that.
>
> Thanks a lot!
>
> Jason
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Just one action on all the objects

2010-06-27 Thread rahul jain
Hi Tom,

One possible solution could be you can increase the number of objects
shown on change list page and set it to your max objects. Only problem
is your page becomes super long. Which is not a good solution.
Secondly, before doing any action on admin objects, you can select
"show all".  Thirdly, in your admin function, you can override
queryset. So even if the user selects one object, or the number of
objects on the same page, you can set  the queryset to
(.objects.all()) in your admin function. These are all
workarounds but not a good solution.

I think there has to be something from Django which let you apply an
action on all the objects. I mean both functionalities should exist.
One to let you apply admin action on individual objects and the
another is to let you apply admin action on all the objects, hiding
the check-boxes.

--RJ






On Sun, Jun 27, 2010 at 4:43 AM, tom  wrote:
> In the same manner - 'check all' only check the currently visible
> results (100 by default) in the change list page.
> I want that check all will actually check all the results, even the
> tuples in the next pages...
>
> anyone?
>
> thanks!
> tom
>
> On May 26, 9:46 am, rahul jain  wrote:
>> Hi Django,
>>
>> Can i run an action without any need toselectall. It should by
>> defaultselecteverything, basicallyalltheobjects. No separate
>> checkbox for every object, noselectall.
>> Also, possibly no choices, just a single button which say "action"
>> which should perform that action onalltheobjects.
>>
>> for ex:
>>
>> HTML Button say "Delete" on the top ofchangelistpage. When I hit it
>> performs delete operation onalltheobjects.
>>
>> I need it because I want to perform just one action onalltheobjects.
>>
>> --RJ
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



None field : Admin save setting it to empty value instead of NULL during save

2010-06-29 Thread rahul jain
Hi there !

One of my model fields attribute is set to null="true" to allow None
values. But if I use admin to save those model objects and leave it
blank, it saves blank value instead of None.
How to fix this ?

And Blank value is not None. Blank is "" (empty) but None is NULL in databases.

-RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



list display based on logged-in user

2010-07-07 Thread rahul jain
Hi there !

I would like to display model fields based on the logged-in user.

If user is restricted user

list_display = (field1, field2)

else

list_display = (field1, field2, field3, field4)

How is it possible ?

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: list display based on logged-in user

2010-07-08 Thread rahul jain
I am not sure what I am doing wrong but this should work

class TestAdmin(admin.ModelAdmin):

list_display = (field1, field2, field3, fileld4, field5,field6)


class CustomTestAdmin(TestAdmin):

custom_list_display = (field1, field2, field3) # showing less
number of fields

def change_view(self, request, *args, **kwargs):
if not request.user.is_superuser:
self.list_display = self.custom_list_display# 
setting list display
return TestAdmin.change_view(self, request, *args, 
**kwargs)
else:
return TestAdmin.change_view(self, request, *args, 
**kwargs)

admin.site.register (Test, CustomTestAdmin)

So even if the user is not super user display is same, all the fields :( .

--RJ









On Thu, Jul 8, 2010 at 6:56 AM, derek  wrote:
> On Jul 7, 11:40 pm, rahul jain  wrote:
>> Hi there !
>>
>> I would like to display model fields based on the logged-in user.
>>
>> If user is restricted user
>>
>> list_display = (field1, field2)
>>
>> else
>>
>> list_display = (field1, field2, field3, field4)
>>
>> How is it possible ?
>>
>
> Also see:
> http://stackoverflow.com/questions/2297377/how-do-i-prevent-permission-escalation-in-django-admin-when-granting-user-change
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: list display based on logged-in user

2010-07-08 Thread rahul jain
anyone on this ?

On Thu, Jul 8, 2010 at 11:56 AM, rahul jain  wrote:
> I am not sure what I am doing wrong but this should work
>
> class TestAdmin(admin.ModelAdmin):
>
>        list_display = (field1, field2, field3, fileld4, field5,field6)
>
>
> class CustomTestAdmin(TestAdmin):
>
>        custom_list_display = (field1, field2, field3)     # showing less
> number of fields
>
>        def change_view(self, request, *args, **kwargs):
>                if not request.user.is_superuser:
>                        self.list_display = self.custom_list_display    # 
> setting list display
>                        return TestAdmin.change_view(self, request, *args, 
> **kwargs)
>                else:
>                        return TestAdmin.change_view(self, request, *args, 
> **kwargs)
>
> admin.site.register (Test, CustomTestAdmin)
>
> So even if the user is not super user display is same, all the fields :( .
>
> --RJ
>
>
>
>
>
>
>
>
>
> On Thu, Jul 8, 2010 at 6:56 AM, derek  wrote:
>> On Jul 7, 11:40 pm, rahul jain  wrote:
>>> Hi there !
>>>
>>> I would like to display model fields based on the logged-in user.
>>>
>>> If user is restricted user
>>>
>>> list_display = (field1, field2)
>>>
>>> else
>>>
>>> list_display = (field1, field2, field3, field4)
>>>
>>> How is it possible ?
>>>
>>
>> Also see:
>> http://stackoverflow.com/questions/2297377/how-do-i-prevent-permission-escalation-in-django-admin-when-granting-user-change
>>
>> --
>> 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 this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: list display based on logged-in user

2010-07-09 Thread rahul jain
yup that's 100% correct :)

Rahul

On Fri, Jul 9, 2010 at 10:27 AM, raj  wrote:
> 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, self).changelist_view(...)
>
> On Jul 9, 6:16 am, rahul jain  wrote:
>> anyone on this ?
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: None field : Admin save setting it to empty value instead of NULL during save

2010-07-13 Thread rahul jain
Could it be generic ?. I mean i don't want to specify self.naughty_field.

How to do it for self.any_field ?

RJ

On Tue, Jun 29, 2010 at 9:29 AM, euan.godd...@googlemail.com
 wrote:
> Django admin can't differentiate between empty string and None and
> picks empty string which makes sense in most cases.
>
> If you don't like the idea of empty string override the save method
> and coerce empty string to None before calling the super classes save,
> e.g.
>
> class YourModel(models.Model):
>    ...
>
>   def save(self, *args, **kwargs):
>        if self.naughty_field == '':
>            self.naughty_field = None
>        super(YourModel, self).save(*args, **kwargs)
>
> Euan
>
> On Jun 29, 4:15 pm, rahul jain  wrote:
>> Hi there !
>>
>> One of my model fields attribute is set to null="true" to allow None
>> values. But if I use admin to save those model objects and leave it
>> blank, it saves blank value instead of None.
>> How to fix this ?
>>
>> And Blank value is not None. Blank is "" (empty) but None is NULL in 
>> databases.
>>
>> -RJ
>
> --
> 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 this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: None field : Admin save setting it to empty value instead of NULL during save

2010-07-15 Thread rahul jain
anyone on this ?

On Tue, Jul 13, 2010 at 2:44 PM, rahul jain  wrote:
> Could it be generic ?. I mean i don't want to specify self.naughty_field.
>
> How to do it for self.any_field ?
>
> RJ
>
> On Tue, Jun 29, 2010 at 9:29 AM, euan.godd...@googlemail.com
>  wrote:
>> Django admin can't differentiate between empty string and None and
>> picks empty string which makes sense in most cases.
>>
>> If you don't like the idea of empty string override the save method
>> and coerce empty string to None before calling the super classes save,
>> e.g.
>>
>> class YourModel(models.Model):
>>    ...
>>
>>   def save(self, *args, **kwargs):
>>        if self.naughty_field == '':
>>            self.naughty_field = None
>>        super(YourModel, self).save(*args, **kwargs)
>>
>> Euan
>>
>> On Jun 29, 4:15 pm, rahul jain  wrote:
>>> Hi there !
>>>
>>> One of my model fields attribute is set to null="true" to allow None
>>> values. But if I use admin to save those model objects and leave it
>>> blank, it saves blank value instead of None.
>>> How to fix this ?
>>>
>>> And Blank value is not None. Blank is "" (empty) but None is NULL in 
>>> databases.
>>>
>>> -RJ
>>
>> --
>> 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 this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: list display based on logged-in user

2010-07-15 Thread rahul jain
nope there is a problem after overriding it, i cannot see the check
boxes now. One which is used for performing admin actions, even though
i can see all the admin actions. If I uncomment the CustomAdmin then i
am able to  see the select boxes on the individual rows as well as
"select all". What could be missing now ?

-Rahul

On Fri, Jul 9, 2010 at 2:50 PM, rahul jain  wrote:
> yup that's 100% correct :)
>
> Rahul
>
> On Fri, Jul 9, 2010 at 10:27 AM, raj  wrote:
>> 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, self).changelist_view(...)
>>
>> On Jul 9, 6:16 am, rahul jain  wrote:
>>> anyone on this ?
>>
>> --
>> 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 this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



python threading admin actions weird problem

2010-08-14 Thread rahul jain
Hi there !

Some weird problem happening with admin actions.

My admin action create threads which access a shared variable.
Those threads change the state of the variable for ex

check = False (a boolean)

One of the thread sets it to True

At this time I am done with that entire request.

Now if I run the admin action again the state of the variable "check" is

check = True

which is not right. It should be

check = False since its a completely new request.

Its happening on both on development (django local server ) and
production (Apache server).

What could be the problem ?

-RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: python threading admin actions weird problem

2010-08-14 Thread rahul jain
Sorry one more thing

Sometimes it starts with

check = False

Its happening at random time.


--RJ

On Sat, Aug 14, 2010 at 7:36 PM, rahul jain  wrote:
> Hi there !
>
> Some weird problem happening with admin actions.
>
> My admin action create threads which access a shared variable.
> Those threads change the state of the variable for ex
>
> check = False (a boolean)
>
> One of the thread sets it to True
>
> At this time I am done with that entire request.
>
> Now if I run the admin action again the state of the variable "check" is
>
> check = True
>
> which is not right. It should be
>
> check = False since its a completely new request.
>
> Its happening on both on development (django local server ) and
> production (Apache server).
>
> What could be the problem ?
>
> -RJ
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



change ordering of objects/rows on change list view on admin

2010-09-19 Thread rahul jain
Hi there !,

How to change ordering of objects/rows on change list view on admin ?

--Rahul

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: change ordering of objects/rows on change list view on admin

2010-09-19 Thread rahul jain
 I mean graphically/directly on the UI itself.

On Sun, Sep 19, 2010 at 2:29 PM, Sævar Öfjörð  wrote:

>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.ordering
>
> On Sep 19, 10:56 pm, rahul jain  wrote:
> > Hi there !,
> >
> > How to change ordering of objects/rows on change list view on admin ?
> >
> > --Rahul
>
> --
> 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 this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



list_editable asynchronous

2010-11-27 Thread rahul jain
How to make list _editable asynchronus ?

I would not like to save by pressing save button. Instead, as soon as I
modify the wizard it should save by itself.

Thanks.

Rahul

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Tracking model object changes

2010-11-27 Thread rahul jain
Found very similar projecst but not sure which one to use it. Would like to
track the modified object , modified time and the user who modified it.


   - Django Audit for MongoDB <https://launchpad.net/django-audit>
   - AuditTrail <http://code.djangoproject.com/wiki/AuditTrail>
   - AuditLog <http://code.google.com/p/django-audit-log/>
   - Django-audit <http://code.google.com/p/django-audit/>

Please let me know which one will be ideal for my case.

Thanks.

Rahul

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Add my link

2007-12-20 Thread Rahul Dewan
Hello,

I am not sure what you have to do with this list? I could not find anything
to do with Django on your website.
Please do not spam this developer list.

Thanks,
Rahul

-- 
Srijan Technologies Pvt. Ltd. INDIA
www.srijan.in | [EMAIL PROTECTED]
91-11-2622 5926 / 2622 5931  |  Fax: 91-11-4160 8543
Blog: http://blogs.srijan.in
CSR: http://srijanfoundation.wordpress.com/


On 12/20/07, Tandon <[EMAIL PROTECTED]> wrote:
>
>
> Title:
> Custom Software Solutions Provider
>
> URL:
> http://www.tandoninfo.com
>
> Description:
> Tandoninfo: Custom Software Solutions Provider - We provide Custom
> software development services like application development, web
> development, Project management, quality testing. We also provide SAP
> Business one implementation, Support, add-on product development
> services.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Stuck

2022-03-28 Thread rahul sharma
Cd comand and app name..

On Mon, Mar 28, 2022, 11:57 Samapika Nayak 
wrote:

> you need to configure the media files in settings.py
> MEDIA_URL = "/media/"
> MEDIA_ROOT = BASE_DIR / "media"
> also need to configure it in project level urls.py
>
> if settings.DEBUG:
> urlpatterns += static(settings.MEDIA_URL,
> document_root=settings.MEDIA_ROOT)
>
> On Mon, Mar 28, 2022 at 10:04 AM 'Delvin Alexander' via Django users <
> django-users@googlegroups.com> wrote:
>
>> Hello everyone,
>>
>> I am trying to register a new user by watching the Django tutorial. I
>> have created the new user but upon attempting to log the new user in I get
>> an,
>>
>> *"FileNotFoundError at /login/[Errno 2] No such file or directory:
>> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*
>>
>> But on my visual code it tells me this, "Exception has occurred:
>> ImproperlyConfigured
>>
>>-
>>
>> *Requested setting INSTALLED_APPS, but settings are not configured. You
>> must either define the environment variable DJANGO_SETTINGS_MODULE or call
>> settings.configure() before accessing settings.*
>> * File "C:\Users\delvi\django_project\users\models.py", line 2, in
>>  from django.contrib.auth.models import User"*
>>
>>
>> Here is my model.py file:
>>
>> from django.db import models
>> from django.contrib.auth.models import User
>> from PIL import Image
>> import os
>> from django.core.asgi import get_asgi_application
>>
>> class Profile(models.Model):
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> image = models.ImageField(default='default.jpg',
>> upload_to='profile_pics')
>>
>> def __str__(self):
>> return f'{self.user.username} Profile'
>>
>> def save(self, *args, **kwargs):
>> super(Profile, self).save(*args, **kwargs)
>>
>> img = Image.open(self.image.path)
>> file = open('media')
>>
>> if img.height > 300 or img.width > 300:
>> output_size = (300, 300)
>> img.thumbnail(output_size)
>> img.save(self.image.path)
>> And here is my views.py file for the User folder:
>>
>> from django.shortcuts import render, redirect
>> from django.contrib import messages
>> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
>> from django.contrib.auth.decorators import login_required
>>
>>
>> def register(request):
>> if request.method == 'POST':
>> form = UserRegisterForm(request.POST)
>> if form.is_valid():
>> form.save()
>> username = form.cleaned_data.get('username')
>> messages.success(request, f'Your Account has been created you
>> are now able to log in {username}!')
>> return redirect('login')
>> else:
>> form = UserRegisterForm()
>> return render(request, 'users/register.html', {'form': form})
>>
>> @login_required
>> def profile(request):
>> if request.method == 'POST':
>> u_form = UserUpdateForm(request.POST, instance=request.user)
>> p_form = ProfileUpdateForm(request.POST, request.FILES,
>> instance=request.user.profile)
>> if u_form.is_valid() and p_form.is_valid():
>> u_form.save()
>> p_form.save()
>> messages.success(request, f'Your Account has been updated!')
>> return redirect('profile')
>> else:
>> u_form = UserUpdateForm(instance=request.user)
>> p_form = ProfileUpdateForm(instance=request.user.profile)
>>
>> context = {
>> 'u_form': u_form,
>> 'p_form': p_form,
>> }
>>
>> return render(request, 'users/profile.html', context)
>> *Would anyone know the reason why i am getting two mistakes ?*
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJG1qUKb2Ar9V-YnTUHRBW6CcgkdSOaQR4Tdm8f79_Ajc2V7pw%40mail.gmail.com
> 
> .
>

-- 
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...@google

Re: CSRF issue in default login

2022-06-17 Thread rahul sharma
 {% crsf_token %} use this action form down


On Fri, Jun 17, 2022, 20:47 Mike Kilmer  wrote:

> Hi.
>
> I'm fairly new to Django. Here's what I need insight on:
>
> Local server, no issue.
>
> On production: CSRF 403 error on login.
>
> There's a cookie loaded on the login page containing csrftoken:
> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>
> (Local and Session storage are empty)
>
> In the FORM element:
>
>  value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>
> Notice they don't match.
>
> I tried running ./migrate.py clearsessions.
>
> Once, yesterday, it seemed that the error did not occur in an Incognito
> Window, but today it persists even in an incognito window, as well as a
> different browser.
>
> One additional piece of information, I have allauth installed, but it
> doesn't seem to be correctly configured. It's login page is not loading.
>
> Additionally, the problem was there even when I removed allauth from Apps
> and Authentication Backends.
>
> Thanks much.
>
> –Mike
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWiqBzm7%2BZ6tnN0J5FkdetM%3DaPH6hKRuGV7GNjcYdOR1grg%40mail.gmail.com.


Re: CSRF issue in default login

2022-06-17 Thread rahul sharma
Html form like action form use

On Fri, Jun 17, 2022, 21:23 Mike Kilmer  wrote:

> By the way, using Django 4.0.
>
> Thanks, Rahul.
>
> I believe this is a default Django template, and wouldn't the fact the the
> page/form creates a cookie be a sign that that action triggered by `{%
> crsf_token %}` has taken place?
>
> On Friday, June 17, 2022 at 10:51:24 AM UTC-5 rahul@gmail.com wrote:
>
>>  {% crsf_token %} use this action form down
>>
>>
>> On Fri, Jun 17, 2022, 20:47 Mike Kilmer  wrote:
>>
>>> Hi.
>>>
>>> I'm fairly new to Django. Here's what I need insight on:
>>>
>>> Local server, no issue.
>>>
>>> On production: CSRF 403 error on login.
>>>
>>> There's a cookie loaded on the login page containing csrftoken:
>>> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>>>
>>> (Local and Session storage are empty)
>>>
>>> In the FORM element:
>>>
>>> >> value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>>>
>>> Notice they don't match.
>>>
>>> I tried running ./migrate.py clearsessions.
>>>
>>> Once, yesterday, it seemed that the error did not occur in an Incognito
>>> Window, but today it persists even in an incognito window, as well as a
>>> different browser.
>>>
>>> One additional piece of information, I have allauth installed, but it
>>> doesn't seem to be correctly configured. It's login page is not loading.
>>>
>>> Additionally, the problem was there even when I removed allauth from
>>> Apps and Authentication Backends.
>>>
>>> Thanks much.
>>>
>>> –Mike
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4522cbf1-cb66-49a2-b033-d438dd5b7200n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4522cbf1-cb66-49a2-b033-d438dd5b7200n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWiqRd3aW6oRBRfxVoc3LpKr%3DtuMKhsYT37OPXDFrsL6JPA%40mail.gmail.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread rahul sharma
Import module name

On Fri, Sep 2, 2022, 12:21 Pooja Kumari  wrote:

> Hello team,
> please help me with this error.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3e46fc90-4d92-4db9-abed-7733babf7d4dn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWio2hupV-zQf3RnHfFS097hDaS_JjB-n89_kagawq6e3VA%40mail.gmail.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread rahul sharma
Ti install in terminal pip install totorial.quickstart


On Fri, Sep 2, 2022, 12:57 rahul sharma  wrote:

> Import module name
>
> On Fri, Sep 2, 2022, 12:21 Pooja Kumari  wrote:
>
>> Hello team,
>> please help me with this error.
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/3e46fc90-4d92-4db9-abed-7733babf7d4dn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/3e46fc90-4d92-4db9-abed-7733babf7d4dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWiqWN54QrAt%3DEoi6Op2%3DN%3Dp0wVFKn9yn%3D52dfo2gU2fRQA%40mail.gmail.com.


Re: makemigrations

2022-09-15 Thread rahul sharma
Select option 1

On Fri, Sep 16, 2022, 11:24 shiva singh  wrote:

> Thank You  everyone for help me
>
> On Friday, September 16, 2022 at 4:25:44 AM UTC+5:30 fortu...@gmail.com
> wrote:
>
>> In the new added field “logo” set default = None or specify a default
>> value
>>
>> On Thu, Sep 15, 2022 at 8:38 PM shiva singh 
>> wrote:
>>
>>> Hello I am new in Django users group. I am using Django and faching a
>>> problem when i do any changes in existing models after run  makemigrations.
>>>
>>>
>>> This is problem :-It is impossible to add a non-nullable field 'logo' to
>>> jobdetails without specifying a default. This is because the database needs
>>> something to populate existing rows.
>>> Please select a fix:
>>>  1) Provide a one-off default now (will be set on all existing rows with
>>> a null value for this column)
>>>  2) Quit and manually define a default value in models.py.
>>> Select an option: 2
>>>
>>>
>>> please help how can i solve this problem .
>>>
>>> Thank you
>>>
>>> --
>>>
>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/10c70cce-9e8e-46ca-8ab1-a2fc73ef4181n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/75c35525-6664-41cd-969c-ba0a2ad99218n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWirMB%3DjAyFOqanEjj4PpdDoH_uPzFSdV4aj-pcG1CRk9-A%40mail.gmail.com.


Re: Permission for admin to add patient

2022-12-12 Thread rahul sharma
connect with me in zoom

On Tue, Dec 13, 2022 at 12:34 PM Manjusha 
wrote:

> I'm junior may it will work!!
>
> On Tuesday, December 13, 2022 at 12:31:17 PM UTC+5:30 Manjusha wrote:
>
>> Hi, need to register the model.py file in admin.py file and then make
>> migrations as like mention in following documentation.
>> https://docs.djangoproject.com/en/4.1/intro/tutorial02/
>>
>> On Monday, December 12, 2022 at 4:49:26 AM UTC+5:30 curtis...@gmail.com
>> wrote:
>>
>>> Hello to all. Please, I would like to know in Django, how to allow an
>>> administrator to add a patient, but not a simple connected user? the
>>> following pics are my models.py, view.py and my template.py.
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ce231dd-8fb3-474a-b359-7a549837e07bn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWio%2BOwjmnHrU_si6Cq9RPopoafbJwBd-9itTqoyOKGX2Ww%40mail.gmail.com.


Re: Arrayfield constraint issue in 4.1

2022-12-13 Thread rahul sharma
Last time i told u give me excess ur laptop

On Tue, Dec 13, 2022, 15:02 Manjusha  wrote:

> Hey anyone reply me.
>
> On Monday, December 12, 2022 at 10:51:00 PM UTC+5:30 Manjusha wrote:
>
>> Yes,I got it !!
>> I have a doubt about the following link :
>> https://github.com/django/django/branches
>>
>> I want to ask you about this branches.desktop file.
>> And I have attached a screenshot.
>>
>>
>> On Mon, Dec 12, 2022 at 8:22 PM James Gillard 
>> wrote:
>>
>>> I agree it looks odd, but the docs I linked say that list is fine, and
>>> here's example from a test inside Django itself:
>>> https://github.com/django/django/blob/cb791a2540c289390b68a3ea9c6a79476890bab2/tests/postgres_tests/models.py#L51
>>>
>>> [image: James from Journee] 
>>> *James Gillard*
>>> *Technical Co-Founder at Journee*
>>> Trustpilot 4.9⭑ 
>>> Instagram  | TikTok
>>> 
>>> Journee, London, United Kingdom
>>> [image: Journee Logo] 
>>>
>>>
>>> On Mon, 12 Dec 2022 at 14:45, Manjusha  wrote:
>>>
 I think default should be assigned like this

  default=[ ] or
 default= list()


 But I'm junior so may I don't know well

 On Mon, 12 Dec 2022, 03:13 James Gillard, 
 wrote:

> The callable list is indeed assigned as the default for the
> ArrayField, as documented here:
> https://docs.djangoproject.com/en/4.1/ref/contrib/postgres/fields/#django.contrib.postgres.fields.ArrayField
>
> The original issue has already had a patch merged, which will be
> released in 4.1.5, see the fix here:
> https://docs.djangoproject.com/en/dev/releases/4.1.5/
>
> On Sunday, 11 December 2022 at 18:02:24 UTC manjushak...@gmail.com
> wrote:
>
>> Hello Sir, I need to understand the form.py  file because , what  is
>> the only list you have assigned as default in arrayfield, is it the 
>> method
>> list() ?
>>
>>
>> On Sat, Dec 10, 2022 at 10:00 PM James Gillard <
>> ja...@journeetrips.com> wrote:
>>
>>> Thanks for the feedback. I opened a ticket and it was indeed
>>> confirmed as a bug: https://code.djangoproject.com/ticket/34205
>>>
>>> On Thursday, 8 December 2022 at 15:04:40 UTC Ryan Nowakowski wrote:
>>>
 Might be a bug. Check the release notes for the post 4.0.8 versions
 to see if anything related changed. File a bug with the simplest 
 example
 code that demonstrates the issue.


 On December 8, 2022 6:37:52 AM CST, James Gillard <
 ja...@journeetrips.com> wrote:
>
> I can't yet work out whether this is a Django bug or how I'm using
> model constraints... Upgraded from 4.0.8 to 4.1.4 and have hit this 
> issue
> when saving this model in the admin. I'd read in the release notes 
> that
> these constraints would be validated on model save, and that's the 
> code
> that's leading to this exception. If it's not something I've done, it 
> seems
> ArrayField isn't working with this new validation of my condition. 
> The same
> happens for Q(phone_numbers__len__gte=0), and the error disappears if 
> I
> comment out this condition. It seems the generated code might be 
> wrong, as
> I see 12 "%s" and only 11 elements in params. All it's trying to do is
> ensure that an empty list isn't considered unique.
>
> Here's the failing model:
>
> phone_numbers = ArrayField(models.CharField(max_length=200),
> default=list, blank=True)
>
> class Meta:
> constraints = [
> models.UniqueConstraint(
>fields=['phone_numbers'],
>condition=~Q(phone_numbers__len=0),
>name='unique_email_phones',
> ),
> ]
> )
>
> [image: Screenshot 2022-12-08 at 12.30.35.png]
>
> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4a8a0941-dd65-4c22-bf16-4e11181794a0n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 dja

Re: Arrayfield constraint issue in 4.1

2022-12-13 Thread rahul sharma
What error tell me??

On Tue, Dec 13, 2022, 15:40 Manjusha  wrote:

> I am not understanding what you are telling.
>
> On Tuesday, December 13, 2022 at 3:58:19 PM UTC+5:30 rahul@gmail.com
> wrote:
>
>> Last time i told u give me excess ur laptop
>>
>> On Tue, Dec 13, 2022, 15:02 Manjusha  wrote:
>>
>>> Hey anyone reply me.
>>
>>
>>>
>>> On Monday, December 12, 2022 at 10:51:00 PM UTC+5:30 Manjusha wrote:
>>>
>>>> Yes,I got it !!
>>>> I have a doubt about the following link :
>>>> https://github.com/django/django/branches
>>>>
>>>> I want to ask you about this branches.desktop file.
>>>> And I have attached a screenshot.
>>>>
>>>>
>>>> On Mon, Dec 12, 2022 at 8:22 PM James Gillard 
>>>> wrote:
>>>>
>>>>> I agree it looks odd, but the docs I linked say that list is fine, and
>>>>> here's example from a test inside Django itself:
>>>>> https://github.com/django/django/blob/cb791a2540c289390b68a3ea9c6a79476890bab2/tests/postgres_tests/models.py#L51
>>>>>
>>>>> [image: James from Journee] <https://www.journeetrips.com/ourstory>
>>>>> *James Gillard*
>>>>> *Technical Co-Founder at Journee*
>>>>> Trustpilot 4.9⭑
>>>>> <https://www.trustpilot.com/review/www.journeetrips.com>
>>>>> Instagram <https://to.mysocial.io/s/rI_M3vpIK> | TikTok
>>>>> <https://to.mysocial.io/s/Gs-RQu8n7>
>>>>> Journee, London, United Kingdom
>>>>> [image: Journee Logo] <https://www.journeetrips.com/>
>>>>>
>>>>>
>>>>> On Mon, 12 Dec 2022 at 14:45, Manjusha  wrote:
>>>>>
>>>>>> I think default should be assigned like this
>>>>>>
>>>>>>  default=[ ] or
>>>>>> default= list()
>>>>>>
>>>>>>
>>>>>> But I'm junior so may I don't know well
>>>>>>
>>>>>> On Mon, 12 Dec 2022, 03:13 James Gillard, 
>>>>>> wrote:
>>>>>>
>>>>>>> The callable list is indeed assigned as the default for the
>>>>>>> ArrayField, as documented here:
>>>>>>> https://docs.djangoproject.com/en/4.1/ref/contrib/postgres/fields/#django.contrib.postgres.fields.ArrayField
>>>>>>>
>>>>>>> The original issue has already had a patch merged, which will be
>>>>>>> released in 4.1.5, see the fix here:
>>>>>>> https://docs.djangoproject.com/en/dev/releases/4.1.5/
>>>>>>>
>>>>>>> On Sunday, 11 December 2022 at 18:02:24 UTC manjushak...@gmail.com
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello Sir, I need to understand the form.py  file because , what
>>>>>>>> is the only list you have assigned as default in arrayfield, is it the
>>>>>>>> method list() ?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Dec 10, 2022 at 10:00 PM James Gillard <
>>>>>>>> ja...@journeetrips.com> wrote:
>>>>>>>>
>>>>>>>>> Thanks for the feedback. I opened a ticket and it was indeed
>>>>>>>>> confirmed as a bug: https://code.djangoproject.com/ticket/34205
>>>>>>>>>
>>>>>>>>> On Thursday, 8 December 2022 at 15:04:40 UTC Ryan Nowakowski wrote:
>>>>>>>>>
>>>>>>>>>> Might be a bug. Check the release notes for the post 4.0.8
>>>>>>>>>> versions to see if anything related changed. File a bug with the 
>>>>>>>>>> simplest
>>>>>>>>>> example code that demonstrates the issue.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On December 8, 2022 6:37:52 AM CST, James Gillard <
>>>>>>>>>> ja...@journeetrips.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>> I can't yet work out whether this is a Django bug or how I'm
>>>>>>>>>>> using model constraints... Upgraded from 4.0.8 to 4.1.4 and have 
>>>>>>>>>>> hit this
>&g

Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread rahul sharma
Delete_status=0
Add coloum in database table
Like delete_status

On Sat, Dec 24, 2022, 20:23 Manjusha  wrote:

> want to know how to allow user to delete the created profile with default
> id of the user.
>
> On Saturday, December 24, 2022 at 8:52:32 PM UTC+5:30 Manjusha wrote:
>
>> that incorrect picture
>>
>>
>> On Saturday, December 24, 2022 at 8:51:56 PM UTC+5:30 Manjusha wrote:
>>
>>> actually the code I have written it is for function based view but it
>>> not working that's why I am trying to do with generic editing views sorry
>>> for that
>>>
>>> On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski
>>> wrote:
>>>
 You're using a class-based view here but your code looks like it's
 supposed to be for a function based view. Which style do you want to use?


 On December 24, 2022 8:13:09 AM CST, Manjusha 
 wrote:
>
> Hi, I have created authentication system in Django. Anyone just tell
> me how to allow user to delete the created profile with default id of the
> user.[image: Screenshot 2022-12-24 193133.png]. I I am using
> built-in  User authentication libraries for this purpose and haven't
> created database model for the user. But the function (the commented
> function under delete_account) that I have created it is not deleting the
> user.
> Now I am trying to delete user profile using generic editing views  of
> Django.
> Anyone tell me how to allow user to delete the created profile with
> default id of the user.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/45912e33-592c-4ca2-b618-c8fb9a1b6066n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACvpWir3vHN1u%3D2%3DtVJkM7D_eV2St8_xu0M9QzB%2Bq%2BvzfpF2mQ%40mail.gmail.com.


Re: Problem with Django tutorial

2012-04-05 Thread Rahul Katragadda
>
> [04/Apr/2012 14:36:13] "GET */admin/admin/css/*base.css HTTP/1.1" 404 3861
> [04/Apr/2012 14:36:13] "GET */admin/admin/css/*dashboard.css HTTP/1.1"
> 404 3876


Is this directory (in bold) correct?

On 5 April 2012 00:19, maxim  wrote:

> Continuing on in the tutorial, I got to the part where it explains how to
> use the admin site. It seems that after enabling the admin, it cannot find
> the css files it uses, so the web page looks very strange.
>
> When making a request for an admin page I get the following output from
> the runserver:
> [04/Apr/2012 14:36:12] "GET /admin/ HTTP/1.1" 200 3740
> [04/Apr/2012 14:36:13] "GET /admin/admin/css/base.css HTTP/1.1" 404 3861
> [04/Apr/2012 14:36:13] "GET /admin/admin/css/dashboard.css HTTP/1.1" 404
> 3876
>
> Which seems to indicate that it can't find base.css and dashboard.css.
>
> I tried following the steps in the Customizing Admin Look and feel to get
> custom templates working to change the urls, but with no luck.
> How do I get the default admin to find its css files?
>
>
> On Wednesday, 4 April 2012 12:51:39 UTC-4, maxim wrote:
>>
>> I can't get the tutorial working for me. When I try to run the command:
>> python manage.py syncdb
>>
>> I get this error:
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.**argv)
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>> line 443, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>> line 382, in execute
>> self.fetch_command(subcommand)**.run_from_argv(self.argv)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 196, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 232, in execute
>> output = self.handle(*args, **options)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 371, in handle
>> return self.handle_noargs(**options)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**
>> management/commands/syncdb.py"**, line 57, in handle_noargs
>> cursor = connection.cursor()
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/db/backends/**dummy/base.py",
>> line 15, in complain
>> raise ImproperlyConfigured("**settings.DATABASES is improperly
>> configured. "
>> django.core.exceptions.**ImproperlyConfigured: settings.DATABASES is
>> improperly configured. Please supply the ENGINE value. Check settings
>> documentation for more details.
>>
>> My settings file has this for databases:
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3', # Add
>> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>> 'NAME': '/home/maxim/mysite/mysite.db'**,  #
>> Or path to database file if using sqlite3.
>> 'USER': '',  # Not used with sqlite3.
>> 'PASSWORD': '',  # Not used with sqlite3.
>> 'HOST': '',  # Set to empty string for
>> localhost. Not used with sqlite3.
>> 'PORT': '',  # Set to empty string for
>> default. Not used with sqlite3.
>> }
>> }
>>
>>
>>  --
> 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/-/7-6nFmQGXpMJ.
>
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



celery workers not consuming messages

2012-07-17 Thread rahul jain
All,

I have started celery on development server using this:

python manage.py celeryd -E --loglevel=info

I can see from rabbitmq management UI that its receiving messages under
ready Queue.
Screenshot attached.

Rabbitmq logs though sometimes print it and sometimes not


=INFO REPORT 17-Jul-2012::19:42:07 ===
accepting AMQP connection <0.8577.0> (127.0.0.1:51123 -> 127.0.0.1:5672)

But the major problem is celery workers not consuming these messages and
not processing them.

I am using django 1.3

rabbit,"RabbitMQ","2.8.4"

amqp_client,"RabbitMQ AMQP Client","2.8.4


My django settings file:


INSTALLED_APPS = (

blah,
'djcelery',
'celerytest',
)

import djcelery
djcelery.setup_loader()

Running python manage.py runserver

Any pointers will be appreciated. How to debug this?

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

<>

Re: ANN: django-socketio 0.1.0 released

2012-10-07 Thread rahul jain
Hi Stephen,

I am having issues with the installation. Is this project still
active? is there any goggle group?

I just downloaded the latest file. Then i tried running the example
chat application. I can see the messages from the client.
However, events inside event.py are never getting fired. I think my
setup is not able to load "events.py". I inserted some print
statements in both these functions but they never getting printed out

@events.on_message(channel="^room-")
def message(request, socket, context, message):

@events.on_finish(channel="^room-")
def finish(request, socket, context):

Please can you let me know how to fix this?

My django version:

(1, 3, 1, 'final', 0)

Messages from the client after running on python manage.py runserver_socketio

127.0.0.1 - - [2012-10-07 17:02:13] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:02:54] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:03:05] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:03:16] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:04:23] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:06:45] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:06:50] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:07:52] "Socket.IO subscribe: room-2"

Appreciate your time!

Thanks.

RJ





On Fri, Aug 12, 2011 at 9:06 PM, Stephen McDonald  wrote:
> Hi all,
>
> Our Django Dash entry http://drawnby.jupo.org made extensive use of
> Socket.IO (cross-browser websockets) and born out of that I've created a new
> django-socketio package which is now available:
>
> Github: https://github.com/stephenmcd/django-socketio
> Bitbucket: https://bitbucket.org/stephenmcd/django-socketio
> PyPI: http://pypi.python.org/pypi/django-socketio/
>
> Here's an overview from the docs:
>
> django-socketio is a BSD licensed Django application that brings together a
> variety of features that allow you to use WebSockets seamlessly with any
> Django project. django-socketio was inspired by Cody Soyland's introductory
> blog post on using Socket.IO and gevent with Django, and made possible by
> the work of Jeffrey Gelens' gevent-websocket and gevent-socketio packages.
> The features provided by django-socketio are:
>
> - Installation of required packages from PyPI
> - A management command for running gevent's pywsgi server with
> auto-reloading capabilities
> - A channel subscription and broadcast system that extends Socket.IO
> allowing WebSockets and events to be partitioned into separate concerns
> - A signals-like event system that abstracts away the various stages of a
> Socket.IO request
> - The required views, urlpatterns, templatetags and tests for all the above
>
> Cheers,
> Steve
>
> --
> Stephen McDonald
> http://jupo.org
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ANN: django-socketio 0.1.0 released

2012-10-09 Thread rahul jain
Can someone please let me know how to fix this?

On Sun, Oct 7, 2012 at 5:35 PM, rahul jain  wrote:
> Hi Stephen,
>
> I am having issues with the installation. Is this project still
> active? is there any goggle group?
>
> I just downloaded the latest file. Then i tried running the example
> chat application. I can see the messages from the client.
> However, events inside event.py are never getting fired. I think my
> setup is not able to load "events.py". I inserted some print
> statements in both these functions but they never getting printed out
>
> @events.on_message(channel="^room-")
> def message(request, socket, context, message):
>
> @events.on_finish(channel="^room-")
> def finish(request, socket, context):
>
> Please can you let me know how to fix this?
>
> My django version:
>
> (1, 3, 1, 'final', 0)
>
> Messages from the client after running on python manage.py runserver_socketio
>
> 127.0.0.1 - - [2012-10-07 17:02:13] "Socket.IO message: {u'action':
> u'start', u'room': 2, u'name': u'test'}"
> 127.0.0.1 - - [2012-10-07 17:02:54] "Socket.IO message: {u'action':
> u'start', u'room': 2, u'name': u'test'}"
> 127.0.0.1 - - [2012-10-07 17:03:05] "Socket.IO subscribe: room-2"
> 127.0.0.1 - - [2012-10-07 17:03:16] "Socket.IO subscribe: room-2"
> 127.0.0.1 - - [2012-10-07 17:04:23] "Socket.IO subscribe: room-2"
> 127.0.0.1 - - [2012-10-07 17:06:45] "Socket.IO subscribe: room-2"
> 127.0.0.1 - - [2012-10-07 17:06:50] "Socket.IO message: {u'action':
> u'start', u'room': 2, u'name': u'test'}"
> 127.0.0.1 - - [2012-10-07 17:07:52] "Socket.IO subscribe: room-2"
>
> Appreciate your time!
>
> Thanks.
>
> RJ
>
>
>
>
>
> On Fri, Aug 12, 2011 at 9:06 PM, Stephen McDonald  
> wrote:
>> Hi all,
>>
>> Our Django Dash entry http://drawnby.jupo.org made extensive use of
>> Socket.IO (cross-browser websockets) and born out of that I've created a new
>> django-socketio package which is now available:
>>
>> Github: https://github.com/stephenmcd/django-socketio
>> Bitbucket: https://bitbucket.org/stephenmcd/django-socketio
>> PyPI: http://pypi.python.org/pypi/django-socketio/
>>
>> Here's an overview from the docs:
>>
>> django-socketio is a BSD licensed Django application that brings together a
>> variety of features that allow you to use WebSockets seamlessly with any
>> Django project. django-socketio was inspired by Cody Soyland's introductory
>> blog post on using Socket.IO and gevent with Django, and made possible by
>> the work of Jeffrey Gelens' gevent-websocket and gevent-socketio packages.
>> The features provided by django-socketio are:
>>
>> - Installation of required packages from PyPI
>> - A management command for running gevent's pywsgi server with
>> auto-reloading capabilities
>> - A channel subscription and broadcast system that extends Socket.IO
>> allowing WebSockets and events to be partitioned into separate concerns
>> - A signals-like event system that abstracts away the various stages of a
>> Socket.IO request
>> - The required views, urlpatterns, templatetags and tests for all the above
>>
>> Cheers,
>> Steve
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django free deployement help

2012-10-30 Thread Rahul Gaur
On Tue, Oct 30, 2012 at 8:16 PM, Alex Clark  wrote:

> **
>
> On 2012-10-30 13:33:31 +, Amr Abdel-wahab said:
>
>
> I have good experience with django developement but over local machines, I
> have never built a project so can someone recommend me a free service to
> deploy an experimental project on it along with easy tutorial to handle
> that.
>
>
> https://devcenter.heroku.com/articles/django
>
>
>
Checkout https://openshift.redhat.com/community/get-started/django


---
*Rahul Gaur*
*irc : iamaregee2*
*blogs : *aregee.wordpress.com ,  <http://sanencynicalwriter.wordpress.com/>
http://sanencynicalwriter.wordpress.com/
*fb:* http://facebook.com/iamaregee
*github: *https://github.com/aregee

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: runserver namespace problem?

2011-12-27 Thread rahul jain
Having the same problem "Received unregistered task of type blah" . Can
someone help ?




On Sun, Nov 13, 2011 at 5:26 PM, Ken  wrote:

> Does anybody have any idea?
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



MySQL limit sub-query problem

2012-01-26 Thread rahul jain
All,

I have a query. Its working fine on sqlite server but not working fine
on mysql server.

This is the error message on mysql server:  "This version of MySQL
doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery"

This is the query:

inner_q = obj_unassigned.values_list('pk', flat=True)[:diff]
total_objects = (obj_assigned | obj_class.objects.filter(pk__in=inner_q))

Any help appreciated on how to fix this.

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL limit sub-query problem

2012-01-26 Thread rahul jain
Works! Great! thanks!!! Lazy querysets!

On Thu, Jan 26, 2012 at 12:32 PM, Alasdair Nicol  wrote:
> Hi RJ,
>
>
> On 26/01/12 20:10, rahul jain wrote:
>>
>> All,
>>
>> I have a query. Its working fine on sqlite server but not working fine
>> on mysql server.
>>
>> This is the error message on mysql server:  "This version of MySQL
>> doesn't yet support 'LIMIT&  IN/ALL/ANY/SOME subquery"
>>
>>
>> This is the query:
>>
>> inner_q = obj_unassigned.values_list('pk', flat=True)[:diff]
>> total_objects = (obj_assigned | obj_class.objects.filter(pk__in=inner_q))
>>
>> Any help appreciated on how to fix this.
>>
>> Thanks.
>>
>> RJ
>>
>
> You can prevent the error by using `list()` to fetch the inner queryset in a
> separate query:
>
> total_objects = (obj_assigned |
> obj_class.objects.filter(pk__in=list(inner_q)))
>
> Alasdair
>
> --
> Alasdair Nicol
> Developer, MEMSET
>
> mail: alasd...@memset.com
>  web: http://www.memset.com/
>
> Memset Ltd., registration number 4504980. 25 Frederick Sanger Road,
> Guildford, Surrey, GU2 7YD, UK.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



CSRFmiddlewaretoken issue ?

2013-01-14 Thread Rahul Gaur
Hi,
  I am working on a Project which implements micro blogging(river flow)
like twitter.

I made a django app for this and here is the snippet of the models.py

I registered the app with 'admin'

 class uPost(models.Model):
body = models.TextField(max_length=150)
author = models.ForeignKey(auth.User)
pub_date = models.DateTimeField('Date')

def __unicode__(self):
return (self.body)

def get_author_url(self):
return "/u/%s/p/0" % (self.author)

class Meta:

ordering = ['-pub_date']


here is snippet from  post.html page


{% csrf_token %}


Report a Story: 





# I use this to post the tweet  and below is the

#views.py function

def tweet(request):
assert(request.method=='POST')
body = smart_unicode(request.raw_post_data)
topic = uPost(body=body, author=request.user)
topic.pub_date = datetime.datetime.today()
topic.save()
return HttpResponseRedirect("/riverflow") # calls the function views
function that list all post in the timeline


When I use the post.html


OutPut I get when I post any tweet with the above FORM and Views func def tweet



csrfmiddlewaretoken=eTqlKTZe9AyMiudycqENAJxoLn9WXjA9&body=hmm+just+check+ing+%21

@aregee Jan. 14, 2013, 11:33 a.m.


It has to do something with the CSRF middleware token right ?

I tried to use @csrf_exempt decorator in my views function,that does
remove  csrfmiddlewaretoken =*& post the following on the timeline
"body=MESSAGEPOSTED "

What am I doing wrong here .?



-------
*Rahul Gaur*
*irc : iamaregee2*
*web: *http://www.rahulgaur.info*
*
*blogs : *aregee.wordpress.com ,  <http://sanencynicalwriter.wordpress.com/>
http://sanencynicalwriter.wordpress.com/
*fb:* http://facebook.com/iamaregee
*github: *https://github.com/aregee

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Workshop: Don't Be Afraid to Commit, Cardiff, UK

2013-05-30 Thread Rahul Ramesh
Hi Daniele,

I think what you're doing is really great. Do you have recorded videos
available online or do you plan to record your next session? It'd be great
for people like me who can't attend the workshop.

Regards,
Rahul


On Fri, May 31, 2013 at 2:10 AM, Daniele Procida  wrote:

> I'm running a Don't Be Afraid to Commit in Cardiff weekend after next,
> under the auspices of the Cardiff Dev Workshop.
>
> It's a workshop/tutorial for Python/Django developers who would like to
> contribute to the projects they use, but need more grounding in some
> of the tools required.
>
> I ran this at the DjangoCon Europe sprints in Warsaw a couple of weeks
> ago, and it seemed to work pretty well there,
>
> See <https://dont-be-afraid-to-commit.readthedocs.org/> for more
> information.
>
> The workshop will take participants through the complete cycle of
> identifying a simple issue in a Django or Python project, writing a patch
> with tests and documentation, and submitting it.
>
> The workshop is aimed at the first-time committer. Very little experience
> is required: <
> https://dont-be-afraid-to-commit.readthedocs.org/en/latest/prerequisites.html
> >
>
> It's free to anyone who'd like to attend, but you need to register because
> places are limited: <http://www.cardiffdevworkshop.com/workshop/>.
>
> Regards,
>
> Daniele
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ImportError when executing "Hello World"

2013-06-11 Thread Rahul Gaur
Hi,
On Jun 12, 2013 6:53 AM,  wrote:
>
> Hi everyone! I'm currently a noob learning Django and Python for the
first time and I have almost no web-development experience so apologies if
this comes across as a stupid question.
>
> I'm trying to get "Hello World" to work and am receiving an import error.
I get the following traceback:
>
> Traceback:
> File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
>   103. resolver_match =
resolver.resolve(request.path_info)
> File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
resolve
>   319. for pattern in self.url_patterns:
> File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
url_patterns
>   347. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
> File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
urlconf_module
>   342. self._urlconf_module = import_module(self.urlconf_name)
> File "C:\Python27\lib\site-packages\django\utils\importlib.py" in
import_module
>   35. __import__(name)
> File "Z:\PU\02 - Summer\kolapy\mysite\mysite\urls.py" in 
>   2. from mysite.views import hello
>
> Exception Type: ImportError at /
> Exception Value: No module named views
>
Try moving  views.py in mysite directory and then give it a try.
Traceback suggest that your views should be in mysite folder.

>
> My project is set up as follows:
>
> mysite/
> manage.py
> views.py
> mysite/
> __init__.py
> settings.py
> urls.py
> wsgi.py
>
>
>
> Here are the contents of manage.py:
>
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
>
> from django.core.management import execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
>
>
>
> Can anyone point me to a solution? I think manage.py is supposed to add
the current directory to the system path so I'm not sure why it's not able
to import the project module. I appreciate whatever help you can offer!
>
> Thanks,
> Alok
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django for non web clients

2013-06-30 Thread Rahul Gaur
Hi,
What about change-tastypie or django-restframework or something similar ?
As a part of my GSoC project [1] , I am implementing a project sharing web
site with social features.
I need RESTful APIs so that the functionality of the site could be
integrated into SugarLabs [2].

I am planing to use Django with one of the above rest frameworks to serve
RESTful APIs  and a web client in backbone.js which will consume the APIs
as well.

[1] - https://github.com/aregee/moksaya
[2] - http://sugarlabs.org
On Jun 30, 2013 12:13 PM, "zweb"  wrote:

>
> I am writing an Python application which will expose REST API. It will be
> client agnostic. In future I will provide a Web client and a mobile client
> and may be a rich desktop client. These clients will connect to application
> using the REST api only.
>
> Should I use Django for this? or is Django for Web based applications only
> as it is web framework. What advantage does Django brings in such a
> architecture.
>
> Would it be much simpler if I use simple python with some python rest  web
> services framework on top of it instead of Django?
>
> I am a big fan of Django but not sure if a Web framework such as django is
> good fit for REST Services based architecture. I not building a
> (monolithic) web application.
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django for non web clients

2013-06-30 Thread Rahul Gaur
Both the above mentioned frameworks offer support for non orm data
resources.
See tastypie's official docs on how to use it with riakdb [1] .

And I have also used django rest framework to relay RESTful APIs for a
django app which uses restful apis from a locally running REST server.

So the data source here wasn't rdbms or non-rel db but json feed from local
web server.
Since this server had a django based web  interface which consumed these
APIs , and we couldn't expose this directly to web as it expose lots of
level and raw data.

Whereas the django based web app offered limited functionality that we
would like to offer clients with  api as well.
Rolling out authenticated public facing restful APIs with django made more
sense .

Using these frameworks I am under the impression  that I could develop
product faster as compared to rolling out my own APIs  and authorization
and authentication is less complex as already there are very good existing
django apps that ease the job (dry) :-)

Just my thoughts :-)

[1] -
http://django-tastypie.readthedocs.org/en/latest/non_orm_data_sources.html
On Jun 30, 2013 7:36 PM, "zweb"  wrote:

> Thanks Rahul,
>
> I thought about that.
>
> I do not need Django's ORM as I do not use relational db and I do not need
> Django's Templates as I use rest api. So I am not sure what value does
> django add in my case?
>
>
>
> On Sunday, June 30, 2013 12:24:28 AM UTC-7, Rahul Gaur wrote:
>>
>> Hi,
>> What about change-tastypie or django-restframework or something similar ?
>> As a part of my GSoC project [1] , I am implementing a project sharing
>> web site with social features.
>> I need RESTful APIs so that the functionality of the site could be
>> integrated into SugarLabs [2].
>>
>> I am planing to use Django with one of the above rest frameworks to serve
>> RESTful APIs  and a web client in backbone.js which will consume the APIs
>> as well.
>>
>> [1] - https://github.com/aregee/**moksaya<https://github.com/aregee/moksaya>
>> [2] - http://sugarlabs.org
>> On Jun 30, 2013 12:13 PM, "zweb"  wrote:
>>
>>>
>>> I am writing an Python application which will expose REST API. It will
>>> be client agnostic. In future I will provide a Web client and a mobile
>>> client and may be a rich desktop client. These clients will connect to
>>> application using the REST api only.
>>>
>>> Should I use Django for this? or is Django for Web based applications
>>> only as it is web framework. What advantage does Django brings in such a
>>> architecture.
>>>
>>> Would it be much simpler if I use simple python with some python rest
>>> web services framework on top of it instead of Django?
>>>
>>> I am a big fan of Django but not sure if a Web framework such as django
>>> is good fit for REST Services based architecture. I not building a
>>> (monolithic) web application.
>>>
>>> --
>>> 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...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>  --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Friendship model

2013-08-09 Thread Rahul Gaur
On Fri, Aug 9, 2013 at 9:38 AM, Andy McKay  wrote:

> On Thu, Aug 8, 2013 at 12:41 PM, Robin Lery  wrote:
>
>> How do i create a Friendship model? Please guide me.
>>
>
> You would need to provide more detail to get much help. The tutorial
> covers how to make models:
>
> https://docs.djangoproject.com/en/dev/intro/tutorial01/
>
>
>



I have implemented Follower and Following model for my project.
Take a look a the this follower/followee relationship :

class Follow(models.Model):
> """ Model to represent Following relationships """
> follower = models.ForeignKey(User, related_name='following')
> followee = models.ForeignKey(User, related_name='followers')
> created = models.DateTimeField(default=timezone.now)
>
> class Meta:
> verbose_name = _('Following Relationship')
> verbose_name_plural = _('Following Relationships')
> unique_together = ('follower', 'followee')
>
> def __unicode__(self):
> return "User %s follows %s" % (self.follower, self.followee)
>
> def save(self, *args, **kwargs):
> # Ensure users can't be friends with themselves
> if self.follower == self.followee:
> raise ValidationError("Users cannot follow themselves.")
> super(Follow, self).save(*args, **kwargs)
>


If you hook this model to admin.py , you can add or remove followers to
particular user.
I use Tastypie to do these Operations [1].
Friendship would be represented with a similar model , but since Friendship
is bilateral (ie: you would need a way to add a model manager).
What I mean to say , the Social Relation Model like above will hold your
relations.
Apart from this you would need a way to send friend request , and when user
approves to request then only this model will be saved.
I think following code will be helpful for you [2] .



[1] -
https://github.com/aregee/moksaya/blob/master/profiles/api.py#L177-L197

[2] -
https://github.com/revsys/django-friendship/blob/master/friendship/models.py#L125-L296





-- 
---
Rahul Gaur
irc : iamaregee2
Web: http://www.rahulgaur.info
Github: https://github.com/aregee

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANNOUNCE] Security releases issued -- vulnerability in the wild

2013-09-15 Thread Rahul Gaur
Hi ,
 I am using django==1.4.8 for my project , these new fixes are available
with pip  yet or we need to install the latest build manually ?

Regards,
Rahul


On Sun, Sep 15, 2013 at 12:18 PM, James Bennett wrote:

> Earlier today a message posted to the django-developers mailing list
> publicly disclosed what was later determined to be an exploitable security
> issue in Django.
>
> As such, we have short-circuited our normal one-week process and moved to
> immediately issuing new releases to remedy the problem.
>
> Full details are available from the blog:
>
> https://www.djangoproject.com/weblog/2013/sep/15/security/
>
> All users of Django are urged to upgrade immediately.
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---
Rahul Gaur
irc : iamaregee2
Web: http://www.rahulgaur.info
Github: https://github.com/aregee

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


change the displayed name of the app in the Django admin?

2011-04-20 Thread rahul jain
Can you change the displayed name of the app in the Django admin?

for ex: Select "app_name" to change

Thanks.

Rahul

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



hidden rows common elements also visible on list filters

2011-05-04 Thread rahul jain
All,

Hidden rows elements also visible on list filters ?

ex:

I have a list filter on one of the columns ,

list filter for that column displays all the distinct values, but the
problem is that few rows i have disabled.
But list filter still displays those rows as well.

How to fix this ?

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Hidden rows elements also visible on list filters

2011-05-04 Thread rahul jain
All,

How to fix this ? Hidden rows elements also visible on list filters.

ex:

I have a list filter on one of the columns ,

list filter for that column displays all the distinct values, but the
problem is that few rows i have disabled.
But list filter still displays those rows as well.

How to fix this ?

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem in Configuring the database

2011-05-06 Thread rahul raj
On Fri, May 6, 2011 at 1:45 PM, r_bloodlife  wrote:

> Hello,
> I'm a beginner trying to build an application..
> please help in correcting these errors..
> I'm Confused, whether to use "MySql" or "Sqllite3"
>
>
> "rahul@linux-cgdq:~/myproject/prj> ls -l
> total 36
> -rw-r--r-- 1 rahul users  148 2011-05-04 23:36 current_datetime.py
> -rw-r--r-- 1 rahul users0 2011-05-04 22:52 __init__.py
> -rw-r--r-- 1 rahul users  131 2011-05-04 22:53 __init__.pyc
> -rw-r--r-- 1 rahul users  503 2011-05-04 22:52 manage.py
> -rw-r--r-- 1 rahul users 5040 2011-05-06 13:33 settings.py
> -rw-r--r-- 1 rahul users 2798 2011-05-04 23:29 settings.pyc
> -rw-r--r-- 1 rahul users  555 2011-05-04 23:35 urls.py
> -rw-r--r-- 1 rahul users  278 2011-05-04 22:53 urls.pyc
> -rw-r--r-- 1 rahul users  209 2011-05-04 23:31 views.py
> rahul@linux-cgdq:~/myproject/prj> python manage.py runserver
> Validating models...
>
> Unhandled exception in thread started by  Command.inner_run of
>  object at 0x82e790c>>
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.6/site-packages/django/core/management/
> commands/runserver.py", line 88, in inner_run
>self.validate(display_num_errors=True)
>  File "/usr/local/lib/python2.6/site-packages/django/core/management/
> base.py", line 249, in validate
>num_errors = get_validation_errors(s, app)
>  File "/usr/local/lib/python2.6/site-packages/django/core/management/
> validation.py", line 103, in get_validation_errors
>connection.validation.validate_field(e, opts, f)
>  File "/usr/local/lib/python2.6/site-packages/django/db/backends/
> mysql/validation.py", line 14, in validate_field
>db_version = self.connection.get_server_version()
>  File "/usr/local/lib/python2.6/site-packages/django/db/backends/
> mysql/base.py", line 338, in get_server_version
>self.cursor()
>  File "/usr/local/lib/python2.6/site-packages/django/db/backends/
> __init__.py", line 252, in cursor
>cursor = util.CursorWrapper(self._cursor(), self)
>  File "/usr/local/lib/python2.6/site-packages/django/db/backends/
> mysql/base.py", line 322, in _cursor
>self.connection = Database.connect(**kwargs)
>  File "/usr/lib/python2.6/site-packages/MySQLdb/__init__.py", line
> 71, in Connect
>return Connection(*args, **kwargs)
>  File "/usr/lib/python2.6/site-packages/MySQLdb/connections.py", line
> 170, in __init__
>super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (2002, "Can't connect to local
> MySQL server through socket '/var/run/mysql/mysql.sock' (2)")
>
> "
>
> -


I've Installed MySql whenever i try to start, it gives me this
"_mysql_exceptions.OperationalError: (2002, "Can't connect to local
MySQL server through socket '/var/run/mysql/mysql.sock' (2)")"

i tried everything as mentioned in the django documentation, their's more
instruction on how to setup "sqllite3"  than other databases..

one more thing.. i actually haven't installed linux on my drive.. i'm
running on VMWare Workstation.. tried in Ubuntu 10.10 it was the same error
now n OpenSUSE it's still the same.. am i facing the problem b'coz of
this..?

Thank you...

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem in Configuring the database

2011-05-07 Thread rahul raj
On Fri, May 6, 2011 at 11:21 PM, Stuart MacKay <
smac...@flagstonesoftware.com> wrote:

> If you search for the error code 2002 the most likely cause is that the
> MySQL server is not running. However you also mention that you are running
> VMWare - I presume this is where the database server is running. Are you
> trying to connect to the database from another system, i.e. windows ?
>
> I use VirtualBox and the default setup for networking is such that the
> localhost cannot talk to the virtual server without explicitly setting up
> network bridging. So if VMWare is similar this is also a possible cause for
> your problems.
>
> As usual as much information about your setup and what options you have
> tried would make it easier to identify the problem.
>
>
> Regards,
>
> Stuart MacKay
> Lisboa, Portugal
>

Sir Stuart Mackay, Thank you for the reply..
Let me start like this...
"I wanted to develop a forum like application, i run WinXP, b'coz of very
less HDD space.. i couldn't install linux on my machine, so i opted for
VMWare & got OpenSUSE installed.. I downloaded Django and installed as
instructed in documentation,
Every thing worked fine till the step.."python manage.py runserver" after
this i got that "welcome page 'Congrats' page"
After this i wanted to install database.. as mentioned in documentation, i
did install mysql using YaST in OpenSUSE.. when i typed "mysql" in terminal
it showed an error -- " Can't connect to local
MySQL server through socket '/var/run/mysql/mysql.sock' (2)") "

I tried to check the error and correct what had gone wrong..
I Google 'd  though i found info like.. there r different versions of
"MySQL" for python and all... i even reinstalled it.. gave me the same
error... unable to proceed further...
That's when i found this group and mailed my problem...

The Django Documentation gives a clear info of Sqllite 2/3 usage but not
MySQL.. So what would u recommend me to install and work on..?
Can u please explain me the Procedure ?

Thank You..

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Hidden rows elements also visible on list filters

2011-05-25 Thread rahul jain
Yes I am referring to django admin list filter, one on the side.


class Admin(model.Admin):

list_filter = (column1, column2)


so for instance column1 has 6 values (a, b,b,b,c,e). Then list filter shows
a,b, c,e.

like this

By column1

show all
a
b
c
e

Now if i hide some rows based on the logged in user and reduce the number of
queries to  4 values (a,c).
But instead what i see is this same as with no hidden rows ie.

By column1

show all
a
b
c
e

The expected result which I would like to see is this

By column1

show all
a
c

Please let me know how to solve this problem.

Thanks.

RJ








On Wed, May 4, 2011 at 10:06 PM, Andy McKay  wrote:

> > problem is that few rows i have disabled.
> > But list filter still displays those rows as well.
>
> Are you using the built in django admin, or something else?
> By "disabled" what do you mean, a change in the model or something else?
>
> Until you give us a bit more information, we are unlikely to be able to
> help. But here's a bet:
>
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
>
> The example for DecadeBornListFilter shows how you can define a custom
> queryset and perhaps this will allow you to filter out disabled rows.
> --
>  Andy McKay
>  a...@clearwind.ca
>  twitter: @andymckay
>
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



python threads and django views

2011-05-30 Thread rahul jain
All,

I would like to know how to do this?

For example, in my views I have to visit 10,000 websites (make url
connection).   Each of those connections are independent connections.
I would like to hit them as quickly as possible. Then return an
http-response with some results.

I have few questions now

Obviously, I cannot hit these sites sequentially, that will take forever.
Also, I believe its not possible, Django, put response time-out for each of
those view responses!

Creating 10,000 threads also is not a good idea.Therefore, I created queue
based threads.
I created 100 working threads and infinite size queue (i am not sure if this
is a good idea)
But receiving max URL connection error!

How to fix this "max URL connection error" ? In addition, any tips for
correctly implementing threads in django will be very helpful.
Also, how to set the max timeout for http-responses  (django views) ?

Thanks.

Rahul

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



snippet

2011-07-25 Thread rahul jain
Tried this snippet but not working

http://djangosnippets.org/snippets/2306/

Anyone else tried it, I would like to drag and drop rows on django admin.

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



drag and drop rows on django admin

2011-07-25 Thread rahul jain
Tried this snippet but not working

http://djangosnippets.org/snippets/2306/

Anyone else tried it, I would like to drag and drop rows on django admin.

Thanks.

RJ

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: drag and drop rows on django admin

2011-07-30 Thread rahul jain
Makes sense guys. Sorry email I typed from my phone and in the first one the
subject was not appropriate.
So i send the another one with subject that sounds right and more likely
people who know will be reading it!

I also get mad when I see emails with bad subject or less info to solve the
problem. But I did the same :(

Sorry next time, I will be more crystal and clear in my emails. Otherwise, I
will not send.

Thanks for the link though (
https://code.djangoproject.com/wiki/UsingTheMailingList#Donts:).
I was able to derive lot of good info out of it.

Thanks for your help and time.

Rahul



On Tue, Jul 26, 2011 at 11:30 PM, Derek  wrote:

> On Jul 26, 11:03 am, Tom Evans  wrote:
> > On Tue, Jul 26, 2011 at 6:32 AM, rahul jain 
> wrote:
> > > Tried this snippet but not working
> >
> > >http://djangosnippets.org/snippets/2306/
> >
> > > Anyone else tried it, I would like to drag and drop rows on django
> admin.
> >
> > > Thanks.
> >
> > > RJ
> >
> > 1) Resending the same message with a different subject within such a
> > short space of time is considered rude. People are busy, and will help
> > you as and when they can, be patient. If you can't be patient, people
> > probably won't help you.
> >
> > 2) "Tried  but it doesn't work" is useless. What did you try? Where
> > did you put the snippet? What happened? What did you expect to happen?
> > What were the exact error messages (if any)?
> >
> > 3) The comments for that snippet clearly says that it is for grapelli.
> > Grapelli is not django admin, it is a replacement for django admin.
> > It's not clear from your post whether you are even using grapelli.
>
> Tom is being very polite here... he could just have pointed you to:
> https://code.djangoproject.com/wiki/UsingTheMailingList#Donts:
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Foreign key Real world use case Q

2010-12-26 Thread rahul jain
Foriegn Key Use case

Class Item():
  desc = models.StringFrield()

Class Menu():
   type = models.StringField(default = "Italian")   ///cuisine type
   item_list = models.ForiegnKey(Item)

So for each cuisine I have some list of items

for ex:

menu type 1 for ex  have 5  items (item 1, item2, item 3, item4, item5)

Creating items is easy

item = Item()
item.desc = "item1"
item.save()

item = Item()
item.desc = "item 2"
item.save()

so on..

Now I have to create just a single menu item

menu = Menu()
menu.type ="Italian"
menu.item_list = ???   ///i am not sure what should be this , should
it be assigned to any one of them

Then how to retreieve the list of items for a menu ex: here Italian

Thanks.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



how to view the uploaded files

2010-12-29 Thread rahul jain
How to view the uploaded files on admin ?

Thanks.

--RJ

-- 
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 this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   >