HELP needed in a service-worker in a react django project

2023-10-13 Thread Tejas Vaij
Hello there, 
I am working on a project where I want to post a blob recorded from 
RecordRTC to my django server from the service worker but I am not able to 
get whats wrong with it. Can anyone please help me understand what wrong am 
I going.

Here is the link of stackoverflow question of mine:
https://stackoverflow.com/questions/77280149/not-able-to-upload-file-to-django-server-from-service-worker-in-react-js

-- 
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/1b095c71-73c9-485d-ada9-20f395bef0c6n%40googlegroups.com.


Help needed in setting up User Auth JWT system

2022-09-14 Thread K Surya Kumar
Hi Team,
The question is not much detailed but straightforward. I am looking for the 
best way to implement JWT authentication using Django.

I'm currently developing an application. Where I have to authenticate the 
users using a JWT token also one user may create multiple token (Mobile App 
and Web App).

Can you please guide me with any available auth package for Django or the 
best way to implement the same?

-- 
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/be588094-3b25-4494-9f79-7dc37cd49a18n%40googlegroups.com.


Re: Django help needed URGENTLY!!!!

2021-11-30 Thread Kasper Laudrup

On 30/11/2021 02.25, Kay TV wrote:

Hi everyone.


First of all, instead of a generic subject and screaming things like 
urgent. Try to write a more descriptive subject. It will increase the 
chances of someone being willing to help you.


> Can anyone please help. I have a Django project which i want to
> distribute as a Windows executable file. What do I do please?
>

You need to be more specific. It should be simple enough to create a 
self-extracting archive, but I doubt that's what you mean or is it?


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/7948b0f3-18a0-2cfe-b16c-a29ae091238e%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Django help needed URGENTLY!!!!

2021-11-29 Thread Kay TV
Hi everyone. 
Can anyone please help. I have a Django project which i want to distribute 
as a Windows executable file. What do I do please?

-- 
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/59b29dce-df7d-4597-85dd-0753b986a810n%40googlegroups.com.


Re: Async Help Needed

2021-08-12 Thread Andrew Godwin
The example you presented should Just Work - that error generally only occurs 
if you return an un-awaited coroutine, which if you're just returning a 
response, should be impossible.

What version of Python and Django are you running?

Andrew

On Thu, Aug 12, 2021, at 11:03 AM, Steven Mapes wrote:
> Does anyone have some links to good guides on getting asnyc to work with 
> Django? I have a use case where I really need to have a view give an async 
> response but I can't get even the most basic of examples working.
> 
> I've tried the examples from https://testdriven.io/blog/django-async-views/ 
> with a simple view of:
> 
> async def test_view(request):
> return HttpResponse("Hello, async Django!")
> 
> I've installed uvicorn and am running it with  uvicorn 
> my_project.asgi:application --reload
> 
> My sync views work as expected but the async one just returns an error of 
> "*The view sample.views.test_view didn't return an HttpResponse object. It 
> returned an unawaited coroutine instead. You may need to add an 'await' into 
> your view.*"
> 
> 
> 
> 
> -- 
> 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/64f90a01-76fe-4e01-ab3a-a6a0910038c9n%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/378098bf-4754-4d4e-afc0-82eb04873438%40www.fastmail.com.


Async Help Needed

2021-08-12 Thread Steven Mapes
Does anyone have some links to good guides on getting asnyc to work with 
Django? I have a use case where I really need to have a view give an async 
response but I can't get even the most basic of examples working.

I've tried the examples from https://testdriven.io/blog/django-async-views/ 
with a simple view of:

async def test_view(request):
return HttpResponse("Hello, async Django!")

I've installed uvicorn and am running it with  uvicorn 
my_project.asgi:application --reload

My sync views work as expected but the async one just returns an error of "*The 
view sample.views.test_view didn't return an HttpResponse object. It 
returned an unawaited coroutine instead. You may need to add an 'await' 
into your view.*"


-- 
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/64f90a01-76fe-4e01-ab3a-a6a0910038c9n%40googlegroups.com.


Re: Help needed

2021-02-23 Thread Rodrigo Delfino
Such as others have said, you should remove ```auto_now=True```, after 
that, you cant  forget to run ```makemigrantions``` and ```migrate```

Em terça-feira, 23 de fevereiro de 2021 às 03:04:24 UTC-3, 
bhurk...@gmail.com escreveu:

> Hello everyone,
>
> I am trying to select the custom date but 
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me 
>

-- 
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/a7e3f5bd-e65a-4f06-9d82-0183929376can%40googlegroups.com.


Re: Help needed

2021-02-23 Thread FIRDOUS BHAT
Why don't you change field type to Char and save the datetimestamp by your
side?

On Tue, Feb 23, 2021 at 12:21 PM neha bhurke  wrote:

> I have done all these codes but it is saving only the current date .
> Any other method
> *Regard,*
> *Neha Bhurke*
>
> *Precise Industrial Solutions Private Limited*
>
> Mob: +91 7738946067 I O: +91 22 28943214
>
> Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near
> National Park, Borivali (E), Mumbai-400066
>
>
>
> On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab 
> wrote:
>
>> datetime=models.DateTimeField(auto_now=False) ?
>> Or remove "auto_now"
>> datetime=models.DateTimeField()
>>
>> On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:
>>
>>> Hello everyone,
>>>
>>> I am trying to select the custom date but
>>> datetime=models.DateTimeField(auto_now=True)
>>> is only taking current date 
>>> Please help me
>>>
>>> --
>>> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEwf5Q2k2Ah3j_eSmCpjZSkfDEFKDqRySULc8Wb5kOQSwJaTRg%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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFB6YJpvoNNhVhgZe_Te0M4UU%2BSuS2Xdvp52BirasdJhoX-LcA%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread Chelsea Fan
Replace auto_now to auto_add_now


On Tue, 23 Feb 2021, 9:04 am neha bhurke,  wrote:

> Hello everyone,
>
> I am trying to select the custom date but
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me
>
> --
> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJwZndeAx%2BLoEKiVNogcE-M2FV-zjd97Vk2j2j6LaqZDE7xSoQ%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread FIRDOUS BHAT
You definitely have to remove, auto_now=True

On Tue, Feb 23, 2021 at 11:34 AM neha bhurke  wrote:

> Hello everyone,
>
> I am trying to select the custom date but
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me
>
> --
> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAFB6YJqT46%3DfA_fZ%2BLGK7LmVCU3jsdbvZFh5W0BWEx3Oxh0_tg%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread John
I think you are misunderstanding the use of `auto_now=True`. It will 
always set that field to the time when the object was last saved; it's 
not meant to be a form field. See 
https://docs.djangoproject.com/en/3.1/ref/models/fields/#datefield. What 
are you trying to do? Have a date field that is preset to today's date? 
If it's that, then the next paragraph in the docs explains how to set 
`default=`.


John

On 23/02/2021 07:14, neha bhurke wrote:

I have created the form
this is my views.py.
def newdata(request):
 if request.method =="POST":
 MyDataform = Dataform(request.POST)
 if MyDataform.is_valid():
 MyDataform.save()
 results = machinelist.objects.all()
 #result = data.objects.all() return redirect('/', {'data': 
results})
 else:
 MyDataform=Dataform()
 results = machinelist.objects.all()
 result = insert.objects.all()
 return redirect('/',{'data': results},{'record':result})
 else:
 results = machinelist.objects.all()
 result = insert.objects.all()
 return redirect('/', {'data': results},{'record':result})
This is my forms.py
class Dataform(forms.ModelForm):
 class Meta:
 model = insert
 fields ="__all__"
*Regard,*
*Neha Bhurke*
*
*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067 I O: +91 22 28943214

Add: 115, 1^st  Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near 
National Park, Borivali (E), Mumbai-400066





On Tue, Feb 23, 2021 at 12:35 PM Danny > wrote:


Maybe it is not related to the model definition, but rather the
.save() object?

On Tuesday, February 23, 2021 at 1:52:04 PM UTC+7
bhurk...@gmail.com  wrote:

I have done all these codes but it is saving only the
current date .
Any other method
*Regard,*
*Neha Bhurke*
*
*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067  I O: +91 22
28943214 

Add: 115, 1^st  Floor, Hari Om Plaza, Behind Omkareshwar
Mandir, Near National Park, Borivali (E), Mumbai-400066




On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab
 wrote:

datetime=models.DateTimeField(auto_now=False) ?
Or remove "auto_now"
datetime=models.DateTimeField()

On Tue, Feb 23, 2021, 11:34 AM neha bhurke
 wrote:

Hello everyone,

I am trying to select the custom date but
datetime=models.DateTimeField(auto_now=True)
is only taking current date 
Please help me
-- 
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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/c98c61c4-f767-4917-88e2-aed03c91c7can%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 

Re: Help needed

2021-02-22 Thread neha bhurke
I have created the form
this is my views.py.

def newdata(request):
if request.method == "POST":
MyDataform = Dataform(request.POST)
if MyDataform.is_valid():
MyDataform.save()
results = machinelist.objects.all()
#result = data.objects.all()
return redirect('/', {'data': results})
else:
MyDataform=Dataform()
results = machinelist.objects.all()
result = insert.objects.all()
return redirect('/',{'data': results},{'record':result})
else:
results = machinelist.objects.all()
result = insert.objects.all()
return redirect('/', {'data': results},{'record':result})

This is my forms.py

class Dataform(forms.ModelForm):
class Meta:
model = insert
fields = "__all__"

*Regard,*
*Neha Bhurke*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067 I O: +91 22 28943214

Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near
National Park, Borivali (E), Mumbai-400066



On Tue, Feb 23, 2021 at 12:35 PM Danny  wrote:

> Maybe it is not related to the model definition, but rather the .save()
> object?
>
> On Tuesday, February 23, 2021 at 1:52:04 PM UTC+7 bhurk...@gmail.com
> wrote:
>
>> I have done all these codes but it is saving only the current date .
>> Any other method
>> *Regard,*
>> *Neha Bhurke*
>>
>> *Precise Industrial Solutions Private Limited*
>>
>> Mob: +91 7738946067 <+91%2077389%2046067> I O: +91 22 28943214
>> <+91%2022%202894%203214>
>>
>> Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near
>> National Park, Borivali (E), Mumbai-400066
>>
>>
>>
>> On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab  wrote:
>>
>>> datetime=models.DateTimeField(auto_now=False) ?
>>> Or remove "auto_now"
>>> datetime=models.DateTimeField()
>>>
>>> On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:
>>>
 Hello everyone,

 I am trying to select the custom date but
 datetime=models.DateTimeField(auto_now=True)
 is only taking current date 
 Please help me

 --
 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c98c61c4-f767-4917-88e2-aed03c91c7can%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/CAEwf5Q2ZhT%2BSPP%2BQrEy-8VYswxNqSE5FmTX-%2BPR6H_bMXw-bAw%40mail.gmail.com.


Re: Help needed

2021-02-22 Thread Danny
Maybe it is not related to the model definition, but rather the .save() 
object?

On Tuesday, February 23, 2021 at 1:52:04 PM UTC+7 bhurk...@gmail.com wrote:

> I have done all these codes but it is saving only the current date .
> Any other method 
> *Regard,*
> *Neha Bhurke*
>
> *Precise Industrial Solutions Private Limited*
>
> Mob: +91 7738946067 <+91%2077389%2046067> I O: +91 22 28943214 
> <+91%2022%202894%203214>
>
> Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near 
> National Park, Borivali (E), Mumbai-400066
>
>
>
> On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab  wrote:
>
>> datetime=models.DateTimeField(auto_now=False) ?
>> Or remove "auto_now"
>> datetime=models.DateTimeField()
>>
>> On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:
>>
>>> Hello everyone,
>>>
>>> I am trying to select the custom date but 
>>> datetime=models.DateTimeField(auto_now=True)
>>> is only taking current date 
>>> Please help me 
>>>
>>> -- 
>>> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c98c61c4-f767-4917-88e2-aed03c91c7can%40googlegroups.com.


Re: Help needed

2021-02-22 Thread neha bhurke
I have done all these codes but it is saving only the current date .
Any other method
*Regard,*
*Neha Bhurke*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067 I O: +91 22 28943214

Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near
National Park, Borivali (E), Mumbai-400066



On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab  wrote:

> datetime=models.DateTimeField(auto_now=False) ?
> Or remove "auto_now"
> datetime=models.DateTimeField()
>
> On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:
>
>> Hello everyone,
>>
>> I am trying to select the custom date but
>> datetime=models.DateTimeField(auto_now=True)
>> is only taking current date 
>> Please help me
>>
>> --
>> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEwf5Q2k2Ah3j_eSmCpjZSkfDEFKDqRySULc8Wb5kOQSwJaTRg%40mail.gmail.com.


Re: Help needed

2021-02-22 Thread Omkar Parab
datetime=models.DateTimeField(auto_now=False) ?
Or remove "auto_now"
datetime=models.DateTimeField()

On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:

> Hello everyone,
>
> I am trying to select the custom date but
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me
>
> --
> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%40mail.gmail.com.


Help needed

2021-02-22 Thread neha bhurke
Hello everyone,

I am trying to select the custom date but 
datetime=models.DateTimeField(auto_now=True)
is only taking current date 
Please help me 

-- 
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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%40googlegroups.com.


How to Run script on remote server from Django Webserver - Help needed

2020-05-12 Thread Wilson Duarte
Hi,

I prefer developer this solution, using REST API, it is more elegante. 

-- 
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/1ed2041f-121a-438a-b53e-39b9e1b03267%40googlegroups.com.


How to Run script on remote server from Django Webserver - Help needed

2020-05-12 Thread Sharanagouda Biradar
Hello All,

I have started learning Django last one week and able to fairly understand 
basic poll application in tutorial, Now I need any of your help in meeting 
my requirements:

*Requirement below :*

I have a basic (server1) Django development web server and another server 
(server2) which has a python script that will launch local application. 
Assume that the server1 has necessary authentication in place to run the 
script on server2. All I want to do is, click a button on the django 
website which would run the python script sitting on server2. Apart from 
above I need to get status of tests running as part of server2 application, 
along with csv files from Server2 back to server1 (web server).

Can I achieve the above requirement using Django REST APIs? or Django 
Remote submission ? I am really clueless here, any pointers are highly 
appreciated.

-- 
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/7c7b0ddc-9396-4b13-8c96-4933a13d8014%40googlegroups.com.


Re: urgent help needed with my rest

2020-04-24 Thread Andréas Kühne
Hi,

The problem you are having is that the ID you are sending to your
deleteTask angular method is undefined - that's what the log shows. Check
the angular code to see why you are not sending a valid id to the
deleteTask method. This has nothing to do with the rest api - it is
functioning perfectly - the issue is that the rest api can't find the task
with id of "undefined" - and "undefined" is what you get when you use a
javascript variable before it's declared.

Regards,

Andréas


Den fre 24 apr. 2020 kl 18:38 skrev ola neat :

> i'm working on with django rest-api & angular but i'm having issues making
> a delete request to my model
> see below my url, apiView, angular-api-delete-request codes and err msg
>
> --
> 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/CAHLKn7118zWmHs95pq%2BFtPg9QmDjvJ6OkEi4JNtuH22fffLQ1w%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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfoy60rifOZa58ekA3ZxtvCwUB8%2BwLkpRfDYD-NAALuSA%40mail.gmail.com.


urgent help needed with my rest

2020-04-24 Thread ola neat
i'm working on with django rest-api & angular but i'm having issues making
a delete request to my model
see below my url, apiView, angular-api-delete-request codes and err msg

-- 
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/CAHLKn7118zWmHs95pq%2BFtPg9QmDjvJ6OkEi4JNtuH22fffLQ1w%40mail.gmail.com.


Custom error messages not working in Django ModelForm - help needed

2019-08-09 Thread אורי
Django Users,

I want to release Speedy Net and Speedy Match to production in September or
October 2019. I need help with the following issue on GitHub and Stack
Overflow:
https://github.com/speedy-net/speedy-net/issues/3

Any suggestions?

There are other issues on Speedy Net which I also need help:
https://github.com/speedy-net/speedy-net/issues

אורי
u...@speedy.net

-- 
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/CABD5YeEO9VkOxVZiLt5Rq4%3DywkzkkyRFW5wAnYhT6Db4UFfnBQ%40mail.gmail.com.


Re: Help Needed For .Error Solving

2019-03-26 Thread Manas Nikam
Where is the error at response from paytm or at your request for payment
information?

On Tue, Mar 26, 2019, 6:57 AM Mike Dewhirst  wrote:

> On 26/03/2019 4:35 am, Kumar Ashirwad Mishra wrote:
> > I am trying to send a request to paytm gateway checkout api for online
> > transaction so I have created a form that has hidden values for
> > request. So how to solve the csrf_token problem .. Thankyou
>
> You need to include the CSRF token immediately after the form action
>
>  
>  {% csrf_token %}
>
> ... so if that occurs in card2.htm that's where it should be.
>
> hth
>
>
> > --
> > 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 https://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/django-users/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com?utm_medium=email_source=footer
> >.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5f2b5f04-0129-a669-06c8-8c1345293c0d%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF%2BYYc5E4U_8j_vZ_ge6CaLqXhih8QyLjqr7uEpkeWpsZXUXjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Needed For .Error Solving

2019-03-25 Thread Mike Dewhirst

On 26/03/2019 4:35 am, Kumar Ashirwad Mishra wrote:
I am trying to send a request to paytm gateway checkout api for online 
transaction so I have created a form that has hidden values for 
request. So how to solve the csrf_token problem .. Thankyou


You need to include the CSRF token immediately after the form action

    
    {% csrf_token %}

... so if that occurs in card2.htm that's where it should be.

hth



--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f2b5f04-0129-a669-06c8-8c1345293c0d%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Help Needed For .Error Solving

2019-03-25 Thread Kumar Ashirwad Mishra
I am trying to send a request to paytm gateway checkout api for online 
transaction so I have created a form that has hidden values for request. So 
how to solve the csrf_token problem .. Thankyou  

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{% extends 'base.htm' %}
{% load staticfiles %}
   {% block title %}E-DSW | Student | Payment{% endblock title %}
{% block container-fuild %}



{#now we  inherite the card.htm#}
{% include 'card2.htm' %}

{% csrf_token %}
{% for field in form.hidden_fields%}
{% if field.name == "CUST_ID" %}

{% elif field.name == "MOBILE_NO" %}

{% elif field.name == "EMAIL" %}

{% elif field.name == "CHECKSUMHASH" %}

{% elif field.name == "TXN_AMOUNT" %}

{% else %}
{{field}}
{% endif %}
{% endfor %}
  
Pay



If you want to cancel the Trasaction Press the CANCEL button , given below
  
  
  CANCEL



{% endblock container-fuild %}


Re: Help needed - new very first django App

2018-03-01 Thread Jayaram Namburaj
Hi Kasper,

Thanks for your findings.
It is working now as per your suggestion.

Regards
JayaramN

On Wednesday, February 28, 2018 at 11:41:27 PM UTC+5:30, Kasper Laudrup 
wrote:
>
> Hi Jayaram, 
>
> On 2018-02-28 15:45, Jayaram Namburaj wrote: 
> > 
> > When running the url http://127.0.0.1:8000/myapp/exRenderDict/ output 
> > doesn't display the values which is from the for loop. 
>
> You named your list 'MyListArg' not 'mylist' in the dictionary you 
> passed to the render function. 
>
> Try changing this: 
>
> {% for val in mylist %} 
>
> To: 
>
> {% for val in MyListArg %} 
>
> That should hopefully fix it. I haven't tested it though. 
>
> 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db812e3d-6d34-4907-97ee-a4ad98a41fec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed - new very first django App

2018-02-28 Thread Kasper Laudrup

Hi Jayaram,

On 2018-02-28 15:45, Jayaram Namburaj wrote:


When running the url http://127.0.0.1:8000/myapp/exRenderDict/ output 
doesn't display the values which is from the for loop.


You named your list 'MyListArg' not 'mylist' in the dictionary you 
passed to the render function.


Try changing this:

{% for val in mylist %}

To:

{% for val in MyListArg %}

That should hopefully fix it. I haven't tested it though.

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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97649c53-b93c-2c3a-a2e6-95df7cc0b106%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Master-Detail Form help needed

2017-01-16 Thread jon
I have been struggling mightily with Master-Detail forms in Django. I have 
done a number of online tutorials but have yet to find a complete tutorial 
which completely explains models, views, templates, URL patterns related to 
master-detail forms. I use the Oracle toolsets where creating a 
master-detail form is just a matter of feeding the template your master 
table (model) and then selecting your detail table (model). It generates a 
basic form for you with CRUD controls. Similar to how the Django admin tool 
works.  If someone could point me toward a good comprehensive book chapter 
or tutorial, I would be much appreciated. TIA.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6d2-e561-409d-a356-724527431b66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Xiao Bo
Thanks!

在 2016年12月10日星期六 UTC-5下午4:43:47,Avraham Serour写道:
>
> don't use runserver for production ever.
>
> read the django documentation: 
> https://docs.djangoproject.com/en/1.10/howto/deployment/
>
> after that I suggest using nginx with uwsgi
>
> it is also worth reading uwsgi documentation, there are a lot of options 
> you can tweak
>
> nginx also has some options you can tweak
>
>
>
> On Sat, Dec 10, 2016 at 11:38 PM, Xiao Bo  > wrote:
>
>> Yes, I did.
>>
>> 在 2016年12月10日星期六 UTC-5下午3:37:17,Avraham Serour写道:
>>>
>>> are you using manage.py runserver?
>>>
>>>
>>> On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo  wrote:
>>>
 I'm building a Django server for data collection. However, the program 
 seems not capable when the sensing network expands. As time goes on, the 
 program doesn't even enter the code piece and report broken 
 pipe/connection 
 reset by peer/too many open files errors:

 Exception happened during processing of request from ('172.58.139.243', 
 30713)Traceback (most recent call last):
   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
 process_request_thread
   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
   File "/usr/lib/python2.7/dist-packages/django/core/servers/basehttp.py", 
 line 126, in __init__
   File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
   File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
   File "/usr/lib/python2.7/socket.py", line 279, in close
   File "/usr/lib/python2.7/socket.py", line 303, in flush
 error: [Errno 32] Broken pipe
 [08/Dec/2016 17:46:47] "POST /Update_Data/ HTTP/1.1" 500 39484Traceback 
 (most recent call last):
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in 
 finish_response
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
   File "/usr/lib/python2.7/socket.py", line 324, in write
   File "/usr/lib/python2.7/socket.py", line 303, in flush
 error: [Errno 104] Connection reset by peer
 File "/usr/lib/python2.7/random.py", line 810, in randomOSError: [Errno 
 24] Too many open files

 I checked the open files and it seems like the socket files are never 
 closed. The list is full of items like the followings:

 python30404 30522 ubuntu  732u IPv4 2437194784  0t0
 TCP 192.168.100.2:9003->172.58.137.113:18538 (ESTABLISHED)
 python30404 30522 ubuntu  733u IPv4 2437194788  0t0
 TCP 192.168.100.2:9003->172.58.137.113:55661 (ESTABLISHED)
 python30404 30522 ubuntu  734u IPv4 2437194792  0t0
 TCP 192.168.100.2:9003->172.58.137.113:42461 (ESTABLISHED)
 python30404 30522 ubuntu  735u IPv4 2437194793  0t0
 TCP 192.168.100.2:9003->172.58.137.113:40438 (ESTABLISHED)
 python30404 30522 ubuntu  736u IPv4 2437194797  0t0
 TCP 192.168.100.2:9003->172.58.137.113:52998 (ESTABLISHED)

 Any ideas? Let me know if you need any further information.

 -- 
 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 https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/58e4d24e-ca9b-41da-8df7-3e195630b05a%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/95337e92-6d5e-4f26-8e70-d2680c1d2437%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 

Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Avraham Serour
don't use runserver for production ever.

read the django documentation:
https://docs.djangoproject.com/en/1.10/howto/deployment/

after that I suggest using nginx with uwsgi

it is also worth reading uwsgi documentation, there are a lot of options
you can tweak

nginx also has some options you can tweak



On Sat, Dec 10, 2016 at 11:38 PM, Xiao Bo  wrote:

> Yes, I did.
>
> 在 2016年12月10日星期六 UTC-5下午3:37:17,Avraham Serour写道:
>>
>> are you using manage.py runserver?
>>
>>
>> On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo  wrote:
>>
>>> I'm building a Django server for data collection. However, the program
>>> seems not capable when the sensing network expands. As time goes on, the
>>> program doesn't even enter the code piece and report broken pipe/connection
>>> reset by peer/too many open files errors:
>>>
>>> Exception happened during processing of request from ('172.58.139.243', 
>>> 30713)Traceback (most recent call last):
>>>   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
>>> process_request_thread
>>>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>>>   File "/usr/lib/python2.7/dist-packages/django/core/servers/basehttp.py", 
>>> line 126, in __init__
>>>   File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
>>>   File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
>>>   File "/usr/lib/python2.7/socket.py", line 279, in close
>>>   File "/usr/lib/python2.7/socket.py", line 303, in flush
>>> error: [Errno 32] Broken pipe
>>> [08/Dec/2016 17:46:47] "POST /Update_Data/ HTTP/1.1" 500 39484Traceback 
>>> (most recent call last):
>>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
>>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in 
>>> finish_response
>>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
>>>   File "/usr/lib/python2.7/socket.py", line 324, in write
>>>   File "/usr/lib/python2.7/socket.py", line 303, in flush
>>> error: [Errno 104] Connection reset by peer
>>> File "/usr/lib/python2.7/random.py", line 810, in randomOSError: [Errno 24] 
>>> Too many open files
>>>
>>> I checked the open files and it seems like the socket files are never
>>> closed. The list is full of items like the followings:
>>>
>>> python30404 30522 ubuntu  732u IPv4 2437194784  0t0
>>> TCP 192.168.100.2:9003->172.58.137.113:18538 (ESTABLISHED)
>>> python30404 30522 ubuntu  733u IPv4 2437194788  0t0
>>> TCP 192.168.100.2:9003->172.58.137.113:55661 (ESTABLISHED)
>>> python30404 30522 ubuntu  734u IPv4 2437194792  0t0
>>> TCP 192.168.100.2:9003->172.58.137.113:42461 (ESTABLISHED)
>>> python30404 30522 ubuntu  735u IPv4 2437194793  0t0
>>> TCP 192.168.100.2:9003->172.58.137.113:40438 (ESTABLISHED)
>>> python30404 30522 ubuntu  736u IPv4 2437194797  0t0
>>> TCP 192.168.100.2:9003->172.58.137.113:52998 (ESTABLISHED)
>>>
>>> Any ideas? Let me know if you need any further information.
>>>
>>> --
>>> 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/58e4d24e-ca9b-41da-8df7-3e195630b05a%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/95337e92-6d5e-4f26-8e70-d2680c1d2437%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Xiao Bo
Yes, I did.

在 2016年12月10日星期六 UTC-5下午3:37:17,Avraham Serour写道:
>
> are you using manage.py runserver?
>
>
> On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo  
> wrote:
>
>> I'm building a Django server for data collection. However, the program 
>> seems not capable when the sensing network expands. As time goes on, the 
>> program doesn't even enter the code piece and report broken pipe/connection 
>> reset by peer/too many open files errors:
>>
>> Exception happened during processing of request from ('172.58.139.243', 
>> 30713)Traceback (most recent call last):
>>   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
>> process_request_thread
>>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>>   File "/usr/lib/python2.7/dist-packages/django/core/servers/basehttp.py", 
>> line 126, in __init__
>>   File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
>>   File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
>>   File "/usr/lib/python2.7/socket.py", line 279, in close
>>   File "/usr/lib/python2.7/socket.py", line 303, in flush
>> error: [Errno 32] Broken pipe
>> [08/Dec/2016 17:46:47] "POST /Update_Data/ HTTP/1.1" 500 39484Traceback 
>> (most recent call last):
>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
>>   File "/usr/lib/python2.7/socket.py", line 324, in write
>>   File "/usr/lib/python2.7/socket.py", line 303, in flush
>> error: [Errno 104] Connection reset by peer
>> File "/usr/lib/python2.7/random.py", line 810, in randomOSError: [Errno 24] 
>> Too many open files
>>
>> I checked the open files and it seems like the socket files are never 
>> closed. The list is full of items like the followings:
>>
>> python30404 30522 ubuntu  732u IPv4 2437194784  0t0
>> TCP 192.168.100.2:9003->172.58.137.113:18538 (ESTABLISHED)
>> python30404 30522 ubuntu  733u IPv4 2437194788  0t0
>> TCP 192.168.100.2:9003->172.58.137.113:55661 (ESTABLISHED)
>> python30404 30522 ubuntu  734u IPv4 2437194792  0t0
>> TCP 192.168.100.2:9003->172.58.137.113:42461 (ESTABLISHED)
>> python30404 30522 ubuntu  735u IPv4 2437194793  0t0
>> TCP 192.168.100.2:9003->172.58.137.113:40438 (ESTABLISHED)
>> python30404 30522 ubuntu  736u IPv4 2437194797  0t0
>> TCP 192.168.100.2:9003->172.58.137.113:52998 (ESTABLISHED)
>>
>> Any ideas? Let me know if you need any further information.
>>
>> -- 
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/58e4d24e-ca9b-41da-8df7-3e195630b05a%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/95337e92-6d5e-4f26-8e70-d2680c1d2437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Avraham Serour
are you using manage.py runserver?


On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo  wrote:

> I'm building a Django server for data collection. However, the program
> seems not capable when the sensing network expands. As time goes on, the
> program doesn't even enter the code piece and report broken pipe/connection
> reset by peer/too many open files errors:
>
> Exception happened during processing of request from ('172.58.139.243', 
> 30713)Traceback (most recent call last):
>   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
> process_request_thread
>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>   File "/usr/lib/python2.7/dist-packages/django/core/servers/basehttp.py", 
> line 126, in __init__
>   File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
>   File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
>   File "/usr/lib/python2.7/socket.py", line 279, in close
>   File "/usr/lib/python2.7/socket.py", line 303, in flush
> error: [Errno 32] Broken pipe
> [08/Dec/2016 17:46:47] "POST /Update_Data/ HTTP/1.1" 500 39484Traceback (most 
> recent call last):
>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
>   File "/usr/lib/python2.7/socket.py", line 324, in write
>   File "/usr/lib/python2.7/socket.py", line 303, in flush
> error: [Errno 104] Connection reset by peer
> File "/usr/lib/python2.7/random.py", line 810, in randomOSError: [Errno 24] 
> Too many open files
>
> I checked the open files and it seems like the socket files are never
> closed. The list is full of items like the followings:
>
> python30404 30522 ubuntu  732u IPv4 2437194784  0t0
> TCP 192.168.100.2:9003->172.58.137.113:18538 (ESTABLISHED)
> python30404 30522 ubuntu  733u IPv4 2437194788  0t0
> TCP 192.168.100.2:9003->172.58.137.113:55661 (ESTABLISHED)
> python30404 30522 ubuntu  734u IPv4 2437194792  0t0
> TCP 192.168.100.2:9003->172.58.137.113:42461 (ESTABLISHED)
> python30404 30522 ubuntu  735u IPv4 2437194793  0t0
> TCP 192.168.100.2:9003->172.58.137.113:40438 (ESTABLISHED)
> python30404 30522 ubuntu  736u IPv4 2437194797  0t0
> TCP 192.168.100.2:9003->172.58.137.113:52998 (ESTABLISHED)
>
> Any ideas? Let me know if you need any further information.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/58e4d24e-ca9b-41da-8df7-3e195630b05a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6t%2B%2B6%2BQ9kcL1bLOJfAXtsV7ZXwO3jgKqZu6LmhLyn83qGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Help Needed: Django Server For High Frequent Requests

2016-12-09 Thread Xiao Bo


I'm building a Django server for data collection. However, the program 
seems not capable when the sensing network expands. As time goes on, the 
program doesn't even enter the code piece and report broken pipe/connection 
reset by peer/too many open files errors:

Exception happened during processing of request from ('172.58.139.243', 
30713)Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
  File "/usr/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 
126, in __init__
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
  File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
  File "/usr/lib/python2.7/socket.py", line 279, in close
  File "/usr/lib/python2.7/socket.py", line 303, in flush
error: [Errno 32] Broken pipe
[08/Dec/2016 17:46:47] "POST /Update_Data/ HTTP/1.1" 500 39484Traceback (most 
recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
  File "/usr/lib/python2.7/socket.py", line 324, in write
  File "/usr/lib/python2.7/socket.py", line 303, in flush
error: [Errno 104] Connection reset by peer
File "/usr/lib/python2.7/random.py", line 810, in randomOSError: [Errno 24] Too 
many open files

I checked the open files and it seems like the socket files are never 
closed. The list is full of items like the followings:

python30404 30522 ubuntu  732u IPv4 2437194784  0t0TCP 
192.168.100.2:9003->172.58.137.113:18538 (ESTABLISHED)
python30404 30522 ubuntu  733u IPv4 2437194788  0t0TCP 
192.168.100.2:9003->172.58.137.113:55661 (ESTABLISHED)
python30404 30522 ubuntu  734u IPv4 2437194792  0t0TCP 
192.168.100.2:9003->172.58.137.113:42461 (ESTABLISHED)
python30404 30522 ubuntu  735u IPv4 2437194793  0t0TCP 
192.168.100.2:9003->172.58.137.113:40438 (ESTABLISHED)
python30404 30522 ubuntu  736u IPv4 2437194797  0t0TCP 
192.168.100.2:9003->172.58.137.113:52998 (ESTABLISHED)

Any ideas? Let me know if you need any further information.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/58e4d24e-ca9b-41da-8df7-3e195630b05a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Oracle DB, some help needed

2015-09-08 Thread Jani Tiainen
Hi everyone,

I'm currently trying to maintain Oracle backends for Django and found
interesting issue that I would like Oracle users to run in their databases.

(I'm not sure can you run these in XE, you may try but I think these
require full Oracle)

Two SQL clauses that I would like you to run are located in my gist <
https://gist.github.com/jtiai/e3459777debf97458187>

Pay special attention to srsName value returned from queries, then please,
post your results and Oracle version your database is running.

If you don't want to post your results in public, private mail is
acceptable.

Thank you for your co-operation.

-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91of_R2%3DFeMvOceXA4jZPNEV5dpmsWvkAmN9zaO40xC5RkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-07-23 Thread Avraham Serour
I know this is an old thread, but I bumped on it while cleaning my inbox.

In any case if it still relevant I recommend looking at treee.io, the
website is down but you can take a look at the code at github (
https://github.com/treeio/treeio)

On Sat, Jun 6, 2015 at 6:55 PM, Luis Zárate  wrote:

> Some useful links:
>
> 1. CRM system
>>
> https://github.com/kunitoki/nublas
>
>  -> client database
>>
>  -> ticket system (client communication including sending emails from
>> backend)
>>
>
> https://github.com/wyldebeast-wunderliebe/mrwolfe
> https://github.com/rossp/django-helpdesk
>
>  2. Shop
>
>>  -> calender booking system
>>
>
> https://github.com/llazzaro/django-scheduler
>
>  -> PDF billing generation
>>
>
> https://github.com/burke-software/django-report-builder
> https://github.com/hirokiky/django-reportmail
> Create your own report using html with https://github.com/ebar0n/xhtml2pdf
>
>
> 3. email autoresponder system
>>
>
> https://github.com/wreckah/django-mailz
>
> 4. CMS functionality would also help
>>
>
> https://github.com/divio/django-cms
> https://github.com/torchbox/wagtail
> https://github.com/stephenmcd/mezzanine
>
> If you need to create addicional software or library then we (my company)
> could offer you commercial support or we could be your partner.
> Contact me privately (see my email in the email header) and talk me about
> your plans.
>
>
> 2015-06-02 11:23 GMT-06:00 ThomasTheDjangoFan <
> stefan.eichholz.ber...@googlemail.com>:
>
>> Hi guys,
>>
>> I am planning on a bigger django project with a lot of functionality.
>>
>> The thing is that I have NO experience with existing django-apps that
>> might fit and definetly need your help.
>>
>> Can you give me a hint which existing (and stable) django-apps I could
>> use as a foundation for my project?
>>
>> Those are the functions that I would like to implement (ordered by
>> priority)
>>  1. *CRM* system
>>  -> client database
>>  -> ticket system (client communication including sending emails from
>> backend)
>>  2. *Shop*
>>  -> calender booking system
>>  -> PDF billing generation
>>  3. email *autoresponder* system
>>  4. *CMS* functionality would also help
>>
>> I would be really thankful if you could guide me to the right direction.
>> Which way shall I go?
>>
>> Kind regards
>> Thomas
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>  --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAG%2B5VyMLi%3DsdDKcrWjSD2JFog9RvR%2BjJKpX-d1HaHYVifuShuw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tLSfqmEKT9TzA5hukMVNxibifgMd1%2B9vTmqO-uesYZvvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-06-06 Thread Luis Zárate
Some useful links:

1. CRM system
>
https://github.com/kunitoki/nublas

 -> client database
>
 -> ticket system (client communication including sending emails from
> backend)
>

https://github.com/wyldebeast-wunderliebe/mrwolfe
https://github.com/rossp/django-helpdesk

 2. Shop

>  -> calender booking system
>

https://github.com/llazzaro/django-scheduler

 -> PDF billing generation
>

https://github.com/burke-software/django-report-builder
https://github.com/hirokiky/django-reportmail
Create your own report using html with https://github.com/ebar0n/xhtml2pdf

3. email autoresponder system
>

https://github.com/wreckah/django-mailz

4. CMS functionality would also help
>

https://github.com/divio/django-cms
https://github.com/torchbox/wagtail
https://github.com/stephenmcd/mezzanine

If you need to create addicional software or library then we (my company)
could offer you commercial support or we could be your partner.
Contact me privately (see my email in the email header) and talk me about
your plans.


2015-06-02 11:23 GMT-06:00 ThomasTheDjangoFan <
stefan.eichholz.ber...@googlemail.com>:

> Hi guys,
>
> I am planning on a bigger django project with a lot of functionality.
>
> The thing is that I have NO experience with existing django-apps that
> might fit and definetly need your help.
>
> Can you give me a hint which existing (and stable) django-apps I could use
> as a foundation for my project?
>
> Those are the functions that I would like to implement (ordered by
> priority)
>  1. *CRM* system
>  -> client database
>  -> ticket system (client communication including sending emails from
> backend)
>  2. *Shop*
>  -> calender booking system
>  -> PDF billing generation
>  3. email *autoresponder* system
>  4. *CMS* functionality would also help
>
> I would be really thankful if you could guide me to the right direction.
> Which way shall I go?
>
> Kind regards
> Thomas
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyMLi%3DsdDKcrWjSD2JFog9RvR%2BjJKpX-d1HaHYVifuShuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-06-06 Thread Luis Zárate
Did you serch for something like this https://www.*odoo*.com/, It is not
django but it is in python and  released under the AGPL license.

If you want to build your software stack based in django then start
searching in https://www.djangopackages.com/.


1. *CRM* system
 -> client database
 -> ticket system (client communication including sending emails from
backend)


 2. *Shop*
 -> calender booking system
 -> PDF billing generation
https://github.com/burke-software/django-report-builder

 3. email *autoresponder* system
 4. *CMS* functionality would also help


django-oscar is interesting software, take a look at
https://github.com/django-oscar/django-oscar




2015-06-02 11:23 GMT-06:00 ThomasTheDjangoFan <
stefan.eichholz.ber...@googlemail.com>:

> Hi guys,
>
> I am planning on a bigger django project with a lot of functionality.
>
> The thing is that I have NO experience with existing django-apps that
> might fit and definetly need your help.
>
> Can you give me a hint which existing (and stable) django-apps I could use
> as a foundation for my project?
>
> Those are the functions that I would like to implement (ordered by
> priority)
>  1. *CRM* system
>  -> client database
>  -> ticket system (client communication including sending emails from
> backend)
>  2. *Shop*
>  -> calender booking system
>  -> PDF billing generation
>  3. email *autoresponder* system
>  4. *CMS* functionality would also help
>
> I would be really thankful if you could guide me to the right direction.
> Which way shall I go?
>
> Kind regards
> Thomas
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyOurKKtj%3DkJpcf2%2B4VBz4ZCJVocPaAnAk4Z0Zj0OD64Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-06-02 Thread ThomasTheDjangoFan
Hi guys,

I am planning on a bigger django project with a lot of functionality.

The thing is that I have NO experience with existing django-apps that might 
fit and definetly need your help.

Can you give me a hint which existing (and stable) django-apps I could use 
as a foundation for my project?

Those are the functions that I would like to implement (ordered by priority)
 1. *CRM* system
 -> client database
 -> ticket system (client communication including sending emails from 
backend)
 2. *Shop*
 -> calender booking system
 -> PDF billing generation
 3. email *autoresponder* system
 4. *CMS* functionality would also help

I would be really thankful if you could guide me to the right direction.
Which way shall I go?

Kind regards
Thomas

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed in constructing __in query

2014-08-05 Thread Collin Anderson
AlertTable.objects.filter(pendingalertstable__in=inner_qs)

Or I you could even do: 
AlertTable.objects.filter(pendingalertstable__id__gt=0)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6a368750-64ae-404b-937b-9ff9cff32cb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help needed in constructing __in query

2014-08-04 Thread Subodh Nijsure
I have two tables as shown below.

class AlertTable(models.Model):
id = models.AutoField(primary_key=True)
alarm_text = models.CharField(max_length=800,blank=False,null=False)
event_type = models.SmallIntegerField(blank=False,null=False)
created = models.DateTimeField()
class Meta:
ordering = ['-id']
def __unicode__(self):
return str(self.id)

class PendingAlertsTable(models.Model):
id = models.AutoField(primary_key=True)
alerttable = models.ForeignKey(AlertTable)
created = models.DateTimeField()
class Meta:
ordering = ['-id']
def __unicode__(self):
return str(self.id)

Idea is PendingAlertsTable holds reference to alerts that have not
been acknowledged. And AlertTable holds all the alerts.

So I want to construct query such that I can get all entries from
AlertTable that are Pending.

So I constructed query like this:

inner_qs=PendingAlertsTable.objects.all()
all_pending_events = AlertTable.objects.filter(pk__in=inner_qs)

That doesn't give me query set in all_pending_event of expected
entries. What is the correct way to construct the __in query in this
case?

-Subodh

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALr9Q3awheWS7AK%2BBfjGwW%3DkyoeJOTqGfr0gJ01rHbO%3Ds4PnJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: virtualenv help needed

2014-05-28 Thread Lachlan Musicman
Two things:

1. Put your media local to your site - I use
/home/user/www/dj-project/static and
/home/user/www/dj-project/collected_media for project at
/home/user/www/dj-project/

2. The place you are referring to is inside the virtual env's little
jail. You can find that by using the cdsitepackages command when in
the venv. But you shouldn't really put your data in there. The Two
Scoops of Django book has a good example of choices available and then
good reasoning for the style they recommend. It's worth the read.

cheers
L.

On 29 May 2014 12:54, Kelvin Wong  wrote:
> Why are you placing user media in your /usr/local/.../dist-package
> directories? (Debian?)
>
> Wouldn't it make more sense to place them somewhere in /srv or /var?
>
> https://docs.djangoproject.com/en/1.6/howto/static-files/
>
> K
>
> On Wednesday, May 28, 2014 9:40:54 AM UTC-7, Deepak Sharma wrote:
>>
>> A year before I developed an applciation in django==1.4.5 version. Few
>> days before I installed virtualenv with django version 1.4.5. In my
>> application I have to place "media" folder inside
>> /usr/local/lib/[ython2.7/dist-package/django/contrib/admin/media but after
>> installating virtualenv I didn't find any django folder inside dist-package.
>> Can anyone help me out with this, how should I allocate proper path to it?
>>
>> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/82e56ae6-3a52-4776-b307-de269997ac46%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiO7Axg_dGBEjK%3Di_3_HG5n5kkZvcxFFsTT0%2BJ1GAF_usw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: virtualenv help needed

2014-05-28 Thread Kelvin Wong
Why are you placing user media in your /usr/local/.../dist-package 
directories? (Debian?)

Wouldn't it make more sense to place them somewhere in /srv or /var?

https://docs.djangoproject.com/en/1.6/howto/static-files/

K

On Wednesday, May 28, 2014 9:40:54 AM UTC-7, Deepak Sharma wrote:
>
> A year before I developed an applciation in django==1.4.5 version. Few 
> days before I installed virtualenv with django version 1.4.5. In my 
> application I have to place "media" folder inside 
> /usr/local/lib/[ython2.7/dist-package/django/contrib/admin/media but after 
> installating virtualenv I didn't find any django folder inside 
> dist-package. Can anyone help me out with this, how should I allocate 
> proper path to it?
>
> 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82e56ae6-3a52-4776-b307-de269997ac46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: virtualenv help needed

2014-05-28 Thread carlos
Hi, when install virtualenv you need create yours enviroments then you need
install all application you need
example:
$virtualenv django14  #create your enviroments
$source django14/bin/activate  #activate your enviroments
$pip install django==1.4.5  #install all you need application o third party
apps

if need find media of django you
find django14/lib/python2.7/site-packages/django/...

Cheers


On Wed, May 28, 2014 at 10:40 AM, Deepak Sharma wrote:

> A year before I developed an applciation in django==1.4.5 version. Few
> days before I installed virtualenv with django version 1.4.5. In my
> application I have to place "media" folder inside
> /usr/local/lib/[ython2.7/dist-package/django/contrib/admin/media but after
> installating virtualenv I didn't find any django folder inside
> dist-package. Can anyone help me out with this, how should I allocate
> proper path to it?
>
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f7e72e87-c1d0-4065-983d-6e1f1b77ccca%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO1rhGvbkmbN%2BdM1zcNmH50RVeiBpy8zmbbun33sAW%2BtcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


virtualenv help needed

2014-05-28 Thread Deepak Sharma
A year before I developed an applciation in django==1.4.5 version. Few days 
before I installed virtualenv with django version 1.4.5. In my application 
I have to place "media" folder inside 
/usr/local/lib/[ython2.7/dist-package/django/contrib/admin/media but after 
installating virtualenv I didn't find any django folder inside 
dist-package. Can anyone help me out with this, how should I allocate 
proper path to it?

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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f7e72e87-c1d0-4065-983d-6e1f1b77ccca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help needed with Django Slug Url Caveat

2013-07-06 Thread JJ Zolper
Hello fellow Django developers,

I would like to request your assistance on a caveat I ran into when doing 
slugs in the django url's.

First off please let me lay out what I've been building:

Here are the internals of my urls.py:

(r'^artists/register/$', 'madtrak.userprofiles.views.ArtistRegistration'
),

(r'^artists/login/$', 'madtrak.userprofiles.views.ArtistLoginRequest'),

(r'^artists/logout/$', 'madtrak.userprofiles.views.ArtistLogoutRequest'
),

(r'^artists/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 


Here are some relevant views.py functions:


# Artist Profile

def ArtistProfile(request, artistreq):

artist_object = Artist.objects.filter(artisturl = artistreq)

return render_to_response('artistprofile.html', {'Artist': 
artist_object}, context_instance = RequestContext(request))


and


# Artist Registration

def ArtistRegistration(request):

if request.user.is_authenticated():

return HttpResponseRedirect('/artists/profile')

if request.method == 'POST':

form = ArtistRegistrationForm(request.POST)

if form.is_valid():

# If information entered is valid create the user  

# user = User.objects.create_user('john', 
'len...@thebeatles.com', 'johnpassword')

artistusername = form.cleaned_data['artistusername']

artistemail = form.cleaned_data['artistemail']

artistpassword = form.cleaned_data['artistpassword']

artistuser = User.objects.create_user(username=artistusername, 
email=artistemail, password=artistpassword)

# Save new user to the database

artistuser.save()

artist = Artist(artistuser=artistuser, 
artistname=form.cleaned_data['artistname'], 
artistbirthday=form.cleaned_data['artistbirthday'], 
artisturl=form.cleaned_data['artisturl'])

artist.save()

return HttpResponseRedirect('/artists/profile/')

else:

return render_to_response('registerartist.html', {'form': 
form}, context_instance=RequestContext(request))

else:

''' user is not submitting the form, show the blank registration 
form '''

form = ArtistRegistrationForm()

context = {'form': form}

return render_to_response('registerartist.html', context, 
context_instance = RequestContext(request))


So, basically here is the caveat: If a user requests artists/register the 
site goes to hell. Why? well it's because as you might have guessed that 
request also fits the regex expression listed where I url config'd (r
'^artists/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 

and so the url config does not behave as I desired. Or if I requested 
likewise if you put artists/ [artistuser] it collides still with the rest 
of the url configs. So, my quick fix and was:


(r'^artists/register/$', 'madtrak.userprofiles.views.ArtistRegistration'
),

(r'^artists/login/$', 'madtrak.userprofiles.views.ArtistLoginRequest'),

(r'^artists/logout/$', 'madtrak.userprofiles.views.ArtistLogoutRequest'
),

(r'^artists/profile/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 


which thereby says hey if I only see artists/profile/ and then the 
requested artists profile then I behave as desired and return that artists 
public profile. Which makes sure it is obviously not listening at just 
artists/ [anything else]

Yet the thing is I REALLY want to be able to have it is I originally had 
it. I like how clean it is. I strongly desire the situation where I can 
host all the registration, login, logout, and any other systems that I 
desire following the artists/ but also want to be able to also cleanly host 
all artists usernames following the artists/ so that it properly querys the 
db and returns that artists profile.

I was thinking maybe I could hack this out with python regex or something 
of the like but is there a way in django to hack this together?

Thanks so much,

JJ

-- 
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: Little help needed writing models for star-ratings app

2013-04-29 Thread Shawn Milochik
I reiterate: Please read the ORM documentation. That will answer all of
your questions. Once you understand how to do queries in the ORM (and which
queries are easier than others) then you will know how to design your
models so that they'll be easy to work with. As you're reading, make notes
about how you can aggregate and search across tables/models.

-- 
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: Little help needed writing models for star-ratings app

2013-04-29 Thread surya


On Monday, April 29, 2013 10:31:34 PM UTC+5:30, Shawn Milochik wrote:
>
> It looks like you're not looking for a "little help." You're looking for 
> someone to do the work for you. 
>
> You'll get the best help if you try something, get stuck, and explain what 
> you tried and what the error is.
>
> Here is the documentation for using the ORM. This is not a snarky response 
> -- I really hope you do read it and learn how to use Django's ORM, which is 
> what you need to answer your own questions.
>
> https://docs.djangoproject.com/en/1.5/ref/models/querysets/
>
> Read that, try some stuff, then ask specific questions when you have 
> problems. You'll get a lot of great help if you do that.
>

I am not sure but.. my concern is more about "relationships"

How should I be defining Rating model for

counting number of specific ratings it got
user who rated it.. 

probably, to log the user data

user = models.ForeignKey(User) would work

But counting number of specific ratings it got is the issue!!

Say there is a Book X. Its ratings are by default 0, 0
Now, as the users add ratings, its get added up to the default and its 
fine.. 

but how to know who added what ratings? and how many times he changed etc..

would a ManyToMany field with User and Rating would work?

-- 
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: Little help needed writing models for star-ratings app

2013-04-29 Thread Shawn Milochik
It looks like you're not looking for a "little help." You're looking for
someone to do the work for you.

You'll get the best help if you try something, get stuck, and explain what
you tried and what the error is.

Here is the documentation for using the ORM. This is not a snarky response
-- I really hope you do read it and learn how to use Django's ORM, which is
what you need to answer your own questions.

https://docs.djangoproject.com/en/1.5/ref/models/querysets/

Read that, try some stuff, then ask specific questions when you have
problems. You'll get a lot of great help if you do that.

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




Little help needed writing models for star-ratings app

2013-04-29 Thread surya
Here is the story so far

class Rating(models.Model):
positive_rating = models.FloatField(default=0)
negative_rating = models.FloatField(default=0)

class Book(models.Model):
year_pub = models.IntegerField(max_length=4)
category = models.ForeignKey(Category)
rating = models.ForeignKey(Rating)
hash_id = models.CharField(max_length=64, null=True, blank=True)

There are few books. Each will be having 2 types of rating. +ve one and -ve 
one, 
The rating is done using "stars". If +ve rating is done, -ve field will be 
0 vice versa.

votes could be simple stored in this way

o = Book.objects.get(pk=1)
o.rating.positive_rating += 2.5
o.rating.save()

Here comes the actual trouble -->

1. How to count the number of ratings
2. How to know which user has voted
3. How to know whether the user has previously voted or not

Typically, how to attach this MyUser (example) model to the Rating Model?

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




Table2 populated by raw SQL query, help needed

2013-01-17 Thread Andy Woods
Hi,
I need to use a raw SQL query and populate a table2 table with the results.
The query works fine and returns a list of Dicts using this function from 
the helpfile :

def dictfetchall(cursor):
"Returns all rows from a cursor as a dict"
desc = cursor.description
return [
dict(zip([col[0] for col in desc], row))
for row in cursor.fetchall()
]

My issue is that I cannot figure out how to populate a Table2 table with 
this info.  Table2 suggests 
this a way to achieve my goal, but I can't figure it out. 

import django_tables2 as tables
data = [
{"name": "Bradley"},
{"name": "Stevie"},]
class NameTable(tables.Table):
name = tables.Column()
table = NameTable(data)


Your help would be much appreciated.  Thanks.

-- 
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/-/q9Q9X1JtjZwJ.
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: help needed with multiple profile images with UserProfile

2012-02-24 Thread richard
Thanks tom,

that worked and now understand what i was doing wrong.

much appreciated.

On Feb 24, 7:08 am, Tom Evans  wrote:
> On Fri, Feb 24, 2012 at 2:55 PM, richard  wrote:
> > Hi Tom,
>
> > Thanks for your reply. So for clarity i thought i was getting the
> > userprofile to pass into the bound form so that the userprofile_id in
> > the UserProfilePic would get populated/saved. as if i leave the
> > instance as None
> > then i get an error saying that userprofile_id cannot be empty?
>
> Correct. So when you are creating a new UserProfilePic object, you
> will need to populate those fields manually. I know of a couple of
> techniques:
>
> 1) Do it manually:
>
> frm = UserProfilePicForm(request.POST, instance=None)
> if frm.is_valid():
>   instance = frm.save(commit=False)
>   instance.userprofile = user.get_profile()
>   instance.save()
>
> 2) Pass the profile to the form's constructor, override the save
> method and implement the same logic there:
> class UserProfilePicForm(ModelForm):
>   def __init__(self, *args, **kwargs):
>     self.profile = kwargs.pop('profile')
>   def save(self, commit=True, *args, **kwargs):
>     instance = super(UserProfilePicForm, self).save(commit=False,
> *args, **kwargs)
>     instance.userprofile = self.profile
>     if commit:
>       instance.save()
>     return instance
>   class Meta:
>     model = UserProfilePic
>     fields = ('profilepic',)
>
> >also,
> > is a 1 to may relationship here correct for what i want to achieve?
>
> Probably. You don't want multiple profiles linking to the same picture
> do you? IE each picture has exactly one owner.
>
> 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-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: help needed with multiple profile images with UserProfile

2012-02-24 Thread Tom Evans
On Fri, Feb 24, 2012 at 2:55 PM, richard  wrote:
> Hi Tom,
>
> Thanks for your reply. So for clarity i thought i was getting the
> userprofile to pass into the bound form so that the userprofile_id in
> the UserProfilePic would get populated/saved. as if i leave the
> instance as None
> then i get an error saying that userprofile_id cannot be empty?

Correct. So when you are creating a new UserProfilePic object, you
will need to populate those fields manually. I know of a couple of
techniques:

1) Do it manually:

frm = UserProfilePicForm(request.POST, instance=None)
if frm.is_valid():
  instance = frm.save(commit=False)
  instance.userprofile = user.get_profile()
  instance.save()

2) Pass the profile to the form's constructor, override the save
method and implement the same logic there:
class UserProfilePicForm(ModelForm):
  def __init__(self, *args, **kwargs):
self.profile = kwargs.pop('profile')
  def save(self, commit=True, *args, **kwargs):
instance = super(UserProfilePicForm, self).save(commit=False,
*args, **kwargs)
instance.userprofile = self.profile
if commit:
  instance.save()
return instance
  class Meta:
model = UserProfilePic
fields = ('profilepic',)


>also,
> is a 1 to may relationship here correct for what i want to achieve?
>

Probably. You don't want multiple profiles linking to the same picture
do you? IE each picture has exactly one owner.

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-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: help needed with multiple profile images with UserProfile

2012-02-24 Thread richard
Hi Tom,

Thanks for your reply. So for clarity i thought i was getting the
userprofile to pass into the bound form so that the userprofile_id in
the UserProfilePic would get populated/saved. as if i leave the
instance as None
then i get an error saying that userprofile_id cannot be empty? also,
is a 1 to may relationship here correct for what i want to achieve?


On Feb 24, 6:47 am, Tom Evans  wrote:
> On Fri, Feb 24, 2012 at 2:20 PM, richard  wrote:
> > Hi, Am i doing this in the correct way?
> > […]
>
> > any help would be greatly appreciated.
>
> > […]
>
> > from .models import UserProfilePic
> > class UserProfilePicForm(ModelForm):
> >    class Meta:
> >        model = UserProfilePic
> >        fields = ('profilepic',)
>
> > […]
>
> >    form = UserProfilePicForm(instance=u.get_profile())
>
> u.get_profile() returns a UserProfile. Your form definition says that
> this form is for a UserProfilePic model.
>
> 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-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: help needed with multiple profile images with UserProfile

2012-02-24 Thread Tom Evans
On Fri, Feb 24, 2012 at 2:20 PM, richard  wrote:
> Hi, Am i doing this in the correct way?
> […]
>
> any help would be greatly appreciated.
>
> […]
>
> from .models import UserProfilePic
> class UserProfilePicForm(ModelForm):
>    class Meta:
>        model = UserProfilePic
>        fields = ('profilepic',)
>
> […]
>
>    form = UserProfilePicForm(instance=u.get_profile())


u.get_profile() returns a UserProfile. Your form definition says that
this form is for a UserProfilePic model.

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



help needed with multiple profile images with UserProfile

2012-02-24 Thread richard
Hi, Am i doing this in the correct way? I am trying to accomplish a
UserProfile having multiple profile images. IE if a user uploads a
profile photo it gets saved as the default profile pic but if they
upload another pic then that becomes the default pic but i need to
keep records of all the profile pics that user has uploaded so that if
they view there profile pics they can see them all. Is this  1 to many
on UserProfile or a ManyToMany? as when i try a 1 to many i cant seem
to get the code working.

any help would be greatly appreciated.


code below.

MODELS.py
from django.contrib.auth.models import User

class UserProfile(models.Model):
user = models.OneToOneField(User)

class UserProfilePic(models.Model):
userprofile = models.ForeignKey(UserProfile)
profilepic = models.ImageField(upload_to='photos')

FORMS.py
from .models import UserProfilePic
class UserProfilePicForm(ModelForm):
class Meta:
model = UserProfilePic
fields = ('profilepic',)

VIEWS.py
def userprofilepic(request):
c = {}
c.update(csrf(request))

u = User.objects.get(pk=1) #just testing with 1 user
form = UserProfilePicForm(instance=u.get_profile())
if request.method == "POST":
form =
UserProfilePicForm(request.POST,request.FILES,instance=u.get_profile())
if form.is_valid():
form.save()
else:
return HttpResponse('failed')
c['form'] = form
return
render_to_response('photo.html',c,context_instance=RequestContext(request))

SQL OUTPUT thats been run on the view which doesnt seem to update
userprofilepic table

{'time': '0.001', 'sql': u'SELECT "auth_user"."id",
"auth_user"."username", "auth_user"."first_name",
"auth_user"."last_name", "auth_user"."email", "auth_user"."password",
"auth_user"."is_staff", "auth_user"."is_active",
"auth_user"."is_superuser", "auth_user"."last_login",
"auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1
'}{'time': '0.000', 'sql': u'SELECT "mysite_userprofile"."id",
"mysite_userprofile"."user_id" FROM "mysite_userprofile" WHERE
"mysite_userprofile"."user_id" = 1 '}{'time': '0.000', 'sql': u'SELECT
(1) AS "a" FROM "mysite_userprofile" WHERE "mysite_userprofile"."id" =
1 LIMIT 1'}{'time': '0.001', 'sql': u'UPDATE "mysite_userprofile" SET
"user_id" = 1 WHERE "mysite_userprofile"."id" = 1 '}

-- 
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: form select box how to (help needed)

2011-02-16 Thread Chris Matthews
Hi Bobby,

See 
http://adil.2scomplement.com/2008/05/django-add-choices-to-form-fields-on-runtime/

Try something like the following:

# Define your choices
LOCATION_CHOICES = ((1,'location1'),
(2,'location2'),
(3,'location3'),
(4,'location4'),
   )

LOCATION_CHOICES_PUBLIC = ((1,'location1'),
(2,'location2'),
(3,'location3'),
   )

Example 1
-
class ProfileForm(forms.Form):
class Meta:
model = Profile

locations = forms.ChoiceField(required=True)

def __init__(self, *args, **kwargs):
# This is a bit of a hack
if 'user_type' in kwargs and kwargs['user_type'] == 'public':
public = True
# We do not want to pass our kwarg to super
del kwargs['user_type']
else:
public = False

super(ProfileForm, self).__init__(*args, **kwargs)

if 'user_type' in kwargs and kwargs['user_type'] == 'public':
self.fields['locations'].choices = LOCATION_CHOICES_PUBLIC
else:
self.fields['locations'].choices = LOCATION_CHOICES

In your module use
form = ProfileForm(user_type='public')
or
form = ProfileForm()

Example 2
-
class ProfileForm(forms.Form):
class Meta:
model = Profile

# the limited choices are our default
locations = forms.ChoiceField(choices = LOCATION_CHOICES_PUBLIC, 
required=True)

In your module
form = ProfileForm()
if not public:
form.fields['locations'].choices = LOCATION_CHOICES


Example 2 is a bit 'cleaner'/neater I think.

Regards
Chris

-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Bobby Roberts
Sent: 16 February 2011 15:14
To: Django users
Subject: Re: form select box how to (help needed)

i have no idea what this means is there an example anywhere?

On Feb 16, 12:43 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Tue, 2011-02-15 at 19:05 -0800, Bobby Roberts wrote:
> > I can't load it through the "CHOICES" parameter in my forms field...
> > how can I do this?
>
> override __init__ in your form and populate there
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.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: form select box how to (help needed)

2011-02-16 Thread Bobby Roberts
i have no idea what this means is there an example anywhere?

On Feb 16, 12:43 am, Kenneth Gonsalves  wrote:
> On Tue, 2011-02-15 at 19:05 -0800, Bobby Roberts wrote:
> > I can't load it through the "CHOICES" parameter in my forms field...
> > how can I do this?
>
> override __init__ in your form and populate there
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.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.



Re: form select box how to (help needed)

2011-02-15 Thread Kenneth Gonsalves
On Tue, 2011-02-15 at 19:05 -0800, Bobby Roberts wrote:
> I can't load it through the "CHOICES" parameter in my forms field...
> how can I do this? 

override __init__ in your form and populate there
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



form select box how to (help needed)

2011-02-15 Thread Bobby Roberts
I've got several select boxes in a user profile that the we can
manipulate in /admin.  One of these select boxes is called "locations"
and has locations to which you can assign a user.

for explanation, let's say that that the select box is populated like
such:


1,location1
2,location2
3,location3
4,location4

where the numbers are the option values and the text is the option
text.

In this user profile, if they choose ocation1,location2,location3, it
saves to a session variable as "1,2,3" (and of course also saves in
their profile.)

so far so good.


now here's what i need help with.

On the public side of the site, they'll login and do certain things.
i want to have a select box (as previously described), HOWEVER, i only
want it populated with options 1,2 and 3 (the values in their session
variable)... not the 4th location since they haven't been assigned to
that location.


I can't load it through the "CHOICES" parameter in my forms field...
how can I do 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-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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Jason
http://virtualboxes.org/images/debian/

Download a ready to use Debian image here.

Make sure you know how to use VirtualBox.

On Jan 21, 8:08 am, Mike Ramirez  wrote:
> On Friday, January 21, 2011 07:00:51 am Steven Elliott Jr wrote:
>
> > > he is not doing dual boot - he is running linux under windows!
>
> >    Right, which I think is horrible and usually very slow as well; it might
> > be better to install the Linux OS on a separate partition on the computer.
> > I personally hate running anything in a virtual machine. I'd rather
> > triple-boot a system than run in a VM.
>
> I agree when it comes to a gui based environment. When developing with django,
> a gui is really not necessary. You can start the vm and treat it as a remote
> server and log in via ssh and do your work that way. It runs 100% better or
> just run a 'local' terminal for the vm and work that way.  
>
> VM's used this way are great for emulating your production environment (most
> configuration and settings) and on a 3-4gb system you can have 3-4 vm's
> running concurrently for testing using multiple servers (i.e. db, static
> media, and your django install) having a smaller (compared to production) but
> more complex setup that you can find in a lot of situations.
>
> Mike
>
> --
> You have an unusual magnetic personality.  Don't walk too close to
> metal objects which are not fastened down.

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Mike Ramirez
On Friday, January 21, 2011 07:00:51 am Steven Elliott Jr wrote:
> > he is not doing dual boot - he is running linux under windows!
> 
>Right, which I think is horrible and usually very slow as well; it might
> be better to install the Linux OS on a separate partition on the computer.
> I personally hate running anything in a virtual machine. I'd rather
> triple-boot a system than run in a VM.
> 

I agree when it comes to a gui based environment. When developing with django, 
a gui is really not necessary. You can start the vm and treat it as a remote 
server and log in via ssh and do your work that way. It runs 100% better or 
just run a 'local' terminal for the vm and work that way.  

VM's used this way are great for emulating your production environment (most 
configuration and settings) and on a 3-4gb system you can have 3-4 vm's 
running concurrently for testing using multiple servers (i.e. db, static 
media, and your django install) having a smaller (compared to production) but 
more complex setup that you can find in a lot of situations.


Mike

-- 
You have an unusual magnetic personality.  Don't walk too close to
metal objects which are not fastened down.

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Steven Elliott Jr
> 
> 
> While I am sure we can all sympathize with confronting  a technical problem 
> that we don't understand, this OP has the flavor of trolling perhaps.  At any 
> rate this is the wrong list for these pleadings.  I don't even see a question

You're so right; I don't know why I am wasting my time with this question 
already. Check out http://www.debian.org/MailingLists/subscribe if you need 
help with Debian

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Joel Goldstick
On Fri, Jan 21, 2011 at 10:00 AM, Steven Elliott Jr  wrote:

>
> > he is not doing dual boot - he is running linux under windows!
>
>Right, which I think is horrible and usually very slow as well; it might
> be better to
>   install the Linux OS on a separate partition on the computer. I
> personally hate running
>   anything in a virtual machine. I'd rather triple-boot a system than run
> in a VM.
>
>   Best,
>   Steven Elliott
>   steve...@me.com
>
> --
> 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.
>
>
While I am sure we can all sympathize with confronting  a technical problem
that we don't understand, this OP has the flavor of trolling perhaps.  At
any rate this is the wrong list for these pleadings.  I don't even see a
question

-- 
Joel Goldstick

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-21 Thread Steven Elliott Jr

> he is not doing dual boot - he is running linux under windows!
   
   Right, which I think is horrible and usually very slow as well; it might be 
better to 
   install the Linux OS on a separate partition on the computer. I personally 
hate running
   anything in a virtual machine. I'd rather triple-boot a system than run in a 
VM.

   Best,
   Steven Elliott
   steve...@me.com

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Kenneth Gonsalves
On Thu, 2011-01-20 at 18:21 -0500, Steven Elliott Jr wrote:
> Why don't you try partitioning your hard drive instead and doing a
> dual boot installation? 
> 
> 

he is not doing dual boot - he is running linux under windows!
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Russell Keith-Magee
On Fri, Jan 21, 2011 at 7:21 AM, Steven Elliott Jr  wrote:
> Why don't you try partitioning your hard drive instead and doing a dual boot 
> installation?
>
> Also, it's Debian not Derbian.

And, as was pointed out on the last thread on this topic, this isn't a
Linux support group.

At the moment, none of your problems appear to be related to Django --
they are to do with using your chosen operating system. Django's
tutorial isn't going to provide *any* assistance on why your Debian
install won't boot into a virtualbox on Windows.

You'll have a lot more luck getting an answer if you direct your
queries to an appropriate forum, such as a Debian users list.

Yours,
Russ Magee %-)

-- 
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: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Steven Elliott Jr
Why don't you try partitioning your hard drive instead and doing a dual boot 
installation? 

Also, it's Debian not Derbian. 

-Steve 

On Jan 20, 2011, at 4:59 PM, Kimberly  wrote:

> This is now a LINUX-Derbian problem I am experiencing. I open the
> virtualbox and clicked on the Linux-Windows that I wanted, and clicked
> on "start" to run it. Once it run, it is black screen. I already mount
> the Derbian iso to the program, so I am lost for words on what is
> going on. This is a struggle and I am frustrated because I just don't
> know where else to turn or what to do ( yes, read the tutorial and
> doesn't help much).
> 
> -- 
> 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.



Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Kimberly
This is now a LINUX-Derbian problem I am experiencing. I open the
virtualbox and clicked on the Linux-Windows that I wanted, and clicked
on "start" to run it. Once it run, it is black screen. I already mount
the Derbian iso to the program, so I am lost for words on what is
going on. This is a struggle and I am frustrated because I just don't
know where else to turn or what to do ( yes, read the tutorial and
doesn't help much).

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



Revisioning and fullhistory help needed

2010-12-14 Thread Tanis
I have an app that contains an Item model. I want to track changes to
this model so that I can see that on day X item looked like this and
on day Y it looked like that.

Since fullhistory seemed to be the most recently updated module for
this, I decided to go with that. However, it doesn't seem to have
actually done much of anything and I don't really know what
functionality it will give me anyway.

I followed the install instructions line for line, but can see no
changes to the admin interface. The history for an Item looks
identical to as it was before.

What should have changed? How do I view the full history? Will this
actually do what I want it to do?

-- 
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: HELP NEEDED

2010-11-23 Thread Michael Sprayberry
I would definitely go Django for this project and maybe divide out the project 
and get some people to help you seeing as this is your first project. Not only 
do you have to take into account the look up the website, the models for 
employers and freelancers, but you are also going to need to take into acount a 
Link to get these emails sent to the freelancers and also the replys to the 
employers and assumming you don't want to be giving out personal information 
this requires some allisoning. 
 
Good luck to you on this project and if you want help get back to me.
 
Michael Sprayberry

--- On Tue, 11/23/10, Dipo Elegbede <delegb...@dudupay.com> wrote:


From: Dipo Elegbede <delegb...@dudupay.com>
Subject: HELP NEEDED
To: django-users@googlegroups.com
Date: Tuesday, November 23, 2010, 1:26 PM


Hi,
I have done some extensive reading on python.
i want to design a classifieds site for jobs.
The service is meant to send people who register an sms with available jobs 
that fit their criteria/cv.
But the main idea is that people come and register for quick jobs(like 
www.freelancer.com) and put up their 
criteria,age,location,qualificationsand when a company or employer posts a 
job,the people that fall into the category that was specified get sms and email 
alerts as to the availability of the job.
I am taking this as my first project and would appreciate any help.
I am looking in the direction of python, maybe django.
Thanks.

-- 
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Banking Solutions | Transaction Processing | Enterprise Application 
Development

-- 
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: HELP NEEDED

2010-11-23 Thread Huy Ton That
I would recommend selecting an easier first project. Good luck.

On Nov 23, 2010 1:28 PM, "Dipo Elegbede"  wrote:

Hi,
I have done some extensive reading on python.
i want to design a classifieds site for jobs.
The service is meant to send people who register an sms with available jobs
that fit their criteria/cv.
But the main idea is that people come and register for quick jobs(like
www.freelancer.com) and put up their
criteria,age,location,qualificationsand when a company or employer posts
a job,the people that fall into the category that was specified get sms and
email alerts as to the availability of the job.
I am taking this as my first project and would appreciate any help.
I am looking in the direction of python, maybe django.
Thanks.

-- 
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Banking Solutions | Transaction Processing | Enterprise Application
Development

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



HELP NEEDED

2010-11-23 Thread Dipo Elegbede
Hi,
I have done some extensive reading on python.
i want to design a classifieds site for jobs.
The service is meant to send people who register an sms with available jobs
that fit their criteria/cv.
But the main idea is that people come and register for quick jobs(like
www.freelancer.com) and put up their
criteria,age,location,qualificationsand when a company or employer posts
a job,the people that fall into the category that was specified get sms and
email alerts as to the availability of the job.
I am taking this as my first project and would appreciate any help.
I am looking in the direction of python, maybe django.
Thanks.

-- 
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Banking Solutions | Transaction Processing | Enterprise Application
Development

-- 
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: Help needed for XML to xslt conversion

2010-08-13 Thread Boguslaw Faja
Hi,

are you trying to do that using django or this group had been choosed
at random? :-)

I suggest looking for 'xpath'.

hint: /[...@attr="val"]

best regards,

On Fri, Aug 13, 2010 at 8:36 AM, Rahul  wrote:
>
> 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
>
>  hidden="false" create="true" update="true" delete="true">
>      status="approved" category="Operation and Maintenance" releaseId="767">
>   
>     This defines the origin of the last configuration action
> affecting the object.
>   
>   
>     This defines the origin of the last configuration action
> affecting the object..
>   
>   
>   
>   
>      type="optional"/>
>   
>     
>   
>   
>   
>     
>      bidirectional="no"/>
>   
>     
>     
>      dataType="String"/>
>      dataType="String"/>
>   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.
>



-- 
Bogusław Faja
tel. (+48) 691544955

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



RE: Field Subclassing, or setter help needed.

2010-07-03 Thread Sells, Fred
But the input is valid in the legacy system from which it comes; it is
just Not Applicable for the database record into which it would be
inserted, based on other parameters in the db.  These are two totally
separate systems, and we want to use the legacy data in some cases to
keep reports in sync.

-Original Message-
From: django-users@googlegroups.com
[mailto:django-us...@googlegroups.com] On Behalf Of Dennis Kaarsemaker
Sent: Saturday, July 03, 2010 11:04 AM
To: django-users@googlegroups.com
Subject: Re: Field Subclassing, or setter help needed.

On za, 2010-07-03 at 10:07 -0400, Sells, Fred wrote:

> I need to override the setter behavior of all the fields in all my
> models.  They all subclass from the same abstract model.
>
> Specifically if the fields already contains a special character (used
> to indicate "Not Applicable") I don' want to allow it to be changed. 

You're doing it wrong(tm)

Input validation should be done at the point where you handle input,
that is in the forms you use for updating instances.
-- 
Dennis K.

They've gone to plaid!

-- 
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: Field Subclassing, or setter help needed.

2010-07-03 Thread Dennis Kaarsemaker
On za, 2010-07-03 at 10:07 -0400, Sells, Fred wrote:

> I need to override the setter behavior of all the fields in all my
> models.  They all subclass from the same abstract model.
>
> Specifically if the fields already contains a special character (used
> to indicate "Not Applicable") I don' want to allow it to be changed. 

You're doing it wrong™

Input validation should be done at the point where you handle input,
that is in the forms you use for updating instances.
-- 
Dennis K.

They've gone to plaid!

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



Field Subclassing, or setter help needed.

2010-07-03 Thread Sells, Fred
I need to override the setter behavior of all the fields in all my
models.  They all subclass from the same abstract model.

Specifically if the fields already contains a special character (used to
indicate "Not Applicable") I don' want to allow it to be changed.  The
same field will be applicable in some types of records but not in
others.  The updates come from an external backend http query that I use
to get data from a legacy system. That legacy system does not know if a
field is applicable or not.

I've got about 25 tables and a total of 500 fields.  I would like to
build this feature into the abstract model and not have to not have
custome code for each field update..

I would like to override the "setter" method in my abstract model, but
cannot seem to get that to work, tried numerous variants.  I am a Django
newbie, but I've spent a day with the docs, books and google with no
success.

Can someone point me to a snippet or a coherent example/explanation on
how to do this.  I'm using Django 1.2 with Python 2.4.

Thanks,

Fred Sells

-- 
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: Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread Bill Freeman
Well, where are things happening?  Do you make a new request for each
click, or do you want the changes to appear without a browser reload?

If the former, the ability to customize seems to imply a model representing
a choice, with a foreign key on the same model, allowing it to specify of
which choice it is a sub choice, giving you a blah_set queryset.  It can
contain whatever additional info you need, obviously.  Then the buttons
can be submit buttons of the form with the select representing the choice,
with various values, so you know which button, and the view will interpret
the buttons in the context of the selected choice.  That is, look up the
choice which contains info about what to do for each button.

If the latter, that's a bunch of javascript, and yes, you need to manage
the connections somewhere, but you don't want to be doing many DB
queries every time you load the page, so you probably want to cache
the tree, probably in a class variable (in RAM) on startup and whenever
the configuration is changed (via a custom form which you must be staff,
or whatever to view and submit, not part of the admin app).

Or I may still be completely misunderstanding your problem.

Bill

On Wed, Apr 7, 2010 at 2:54 PM, pedjk  wrote:
> Thanks Bill. I'll clarify.
>
> Basically what I want to do is give each option under the choice field
> a function. So once the user has selected an option under the drop
> down box, that would initiate a script which would generate a set of
> links (buttons) at the bottom of the page to take the user to the next
> step.
>
> So if under the drop down menu you choose "Done", that would
> automatically generate two links. One that says "Stop" and one that
> says "Close". What the links do isn't important, it's how to get the
> chosen option to generate the links that I don't know how to do.
>
> Someone mentioned to me to use a state table. I'm not sure what that
> means, but maybe others do.
>
> Now the reason I bring up the admin page is because I also want it to
> be customizable from there. So as an example, if selecting "Done"
> generates a "Stop" and a "Close" button, I might want to change those
> button and or their links at a later time, and I would want to do it
> from the admin page.
>
> Hopefully that clarifies things more and thanks again
>
> --
> 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: Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread pedjk
Thanks Bill. I'll clarify.

Basically what I want to do is give each option under the choice field
a function. So once the user has selected an option under the drop
down box, that would initiate a script which would generate a set of
links (buttons) at the bottom of the page to take the user to the next
step.

So if under the drop down menu you choose "Done", that would
automatically generate two links. One that says "Stop" and one that
says "Close". What the links do isn't important, it's how to get the
chosen option to generate the links that I don't know how to do.

Someone mentioned to me to use a state table. I'm not sure what that
means, but maybe others do.

Now the reason I bring up the admin page is because I also want it to
be customizable from there. So as an example, if selecting "Done"
generates a "Stop" and a "Close" button, I might want to change those
button and or their links at a later time, and I would want to do it
from the admin page.

Hopefully that clarifies things more and thanks again

-- 
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: Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread Bill Freeman
Since it's urgent, I'll give an opinion despite not fully understanding your
description of the problem.

If it's going to be so far removed from what the admin app does by
default, I'd go with a custom view outside of the admin, which you
can customize to your heart's content.

That is, when it's really hard to fit something in an existing box, you
should probably build a different box.

Bill

On Wed, Apr 7, 2010 at 12:35 PM, pedjk  wrote:
> Ok, I'm quite new to Python and Django so this might actually have a
> simple solution.
>
> I'm coding for a form using Django and I have a ModelChoiceField. Now
> what I want to do is make the options for this field customizable. So
> if you choose an option, a set of links would be generated allowing
> you to move to the next step.
>
> All I know is that this should show up on the admin page for Django,
> and it might require a state table or some sort of back coding from
> mysql.
>
> If anyone could help, this is quite urgent.
>
> --
> 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.



Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread pedjk
Ok, I'm quite new to Python and Django so this might actually have a
simple solution.

I'm coding for a form using Django and I have a ModelChoiceField. Now
what I want to do is make the options for this field customizable. So
if you choose an option, a set of links would be generated allowing
you to move to the next step.

All I know is that this should show up on the admin page for Django,
and it might require a state table or some sort of back coding from
mysql.

If anyone could help, this is quite urgent.

-- 
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: help needed in ModelForm __unicode__

2010-03-26 Thread Kenneth Gonsalves
On Friday 26 Mar 2010 3:38:10 pm Emanuel wrote:
> both combo's.
> I want to filter only men or women depending the case. Is it possible? Or 
> should I create another method for independent cases? If it is the
>  solution  how can I use it? I'm not getting there because it is a instance
>  of a class...
> 

one way is to override __init__. Here is a sample:
class Accountaddform(ModelForm):
def __init__(self,head,*args,**kwargs):
super (Accountaddform,self).__init__(*args,**kwargs)
self.head = head
self.fields['head'].queryset=Account.objects.filter(pk=self.head)
class Meta:
model = Account
-- 
regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS
http://certificate.nrcfoss.au-kbc.org.in

-- 
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: help needed in ModelForm __unicode__

2010-03-26 Thread Daniel Roseman
On Mar 26, 10:08 am, Emanuel  wrote:
> Hi!
>
> I Have this model:
> class Person(models.Model):
>     user = models.ForeignKey(User)
>     nr = models.IntegerField(blank=True,)
>     gender = models.CharField(max_length=1, blank=True,
> choices=gender_choices)
>
>     def __unicode__(self):
>         return self.user.get_full_name()
> 
>
> I'm using a modelForm of this form.
>
> I have another model:
> class Couple(models.Model):
>     season = models.ForeignKey(season)
>     man = models.ForeignKey(Person, related_name='man',)
>     woman = models.ForeignKey(Person, related_name='woman',)
> 
>
> And I'm also using a modelForm of this one.
>
> In the template I  have a combobox for the man and for the woman wich shows
> the __unicode__ method of Person model, but it shows both women and men in
> both combo's.
> I want to filter only men or women depending the case. Is it possible? Or
> should I create another method for independent cases? If it is the solution
> how can I use it? I'm not getting there because it is a instance of a class...
>
> Thanks
> Emanuel

Nothing to do with __unicode__. You want limit_choices_to.
http://docs.djangoproject.com/en/1.1/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
--
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.



help needed in ModelForm __unicode__

2010-03-26 Thread Emanuel
Hi!

I Have this model:
class Person(models.Model):
user = models.ForeignKey(User)
nr = models.IntegerField(blank=True,)
gender = models.CharField(max_length=1, blank=True, 
choices=gender_choices)


def __unicode__(self):
return self.user.get_full_name()


I'm using a modelForm of this form.

I have another model:
class Couple(models.Model):
season = models.ForeignKey(season)
man = models.ForeignKey(Person, related_name='man',)
woman = models.ForeignKey(Person, related_name='woman',)


And I'm also using a modelForm of this one.

In the template I  have a combobox for the man and for the woman wich shows 
the __unicode__ method of Person model, but it shows both women and men in 
both combo's.
I want to filter only men or women depending the case. Is it possible? Or 
should I create another method for independent cases? If it is the solution 
how can I use it? I'm not getting there because it is a instance of a class...


Thanks
Emanuel

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



Desperate Help needed. manage.py runserver no longer works.

2009-06-04 Thread CrabbyPete

I am new to django and I am running it on a Windows server. I
installed mod_wsgi with Apache and go it to work, but now when I run
python manage.py runserver. I get the error

Error: Could not import settings 'spot.settings' (Is it on sys.path?
Does it have syntax errors?): No module named settings
Exit code:  1

mysite is call spot. Can anyone tell me why running the django server
no longer works. I am going nuts trying to figure this out, and before
I rip out everything and start over can some please give me some
advise what to look for and what I might have gone wrong. I can only
assume it has something to do with what I did in my spot.wsgi file

import os
import sys

sys.stdout = sys.stderr

from os.path import abspath, dirname, join
from site import addsitedir

PROJECT_ROOT = abspath(join(dirname(__file__), "../"))

sys.path.insert(0, join(PROJECT_ROOT, "apps"))
sys.path.insert(0, abspath(join(dirname(__file__), "../../")))

from django.core.handlers.wsgi import WSGIHandler

os.environ["DJANGO_SETTINGS_MODULE"] = "spot.settings"

application = WSGIHandler()


Thanks in advance
--~--~-~--~~~---~--~~
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: help needed: apache httpd.conf and urls

2009-04-30 Thread zayatzz

Thanks!

Its working just fine now :)

Alan.

On Apr 30, 10:37 pm, Malcolm Tredinnick 
wrote:
> On Thu, 2009-04-30 at 12:27 -0700, zayatzz wrote:
> > Hello
>
> > I have this in my template :
> > 
>
> > settings file is following:
> > MEDIA_ROOT = '/var/www/media/'
> > MEDIA_URL = "http://localhost/media/;
>
> > when i go to the webpage then the stuff that i get from server says
> > 
>
> > Even when i replace {{ MEDIA_URL }} with anything else i still get
> > this in browser:
> > 
>
> > Why?
>
> The MEDIA_URL variable will only be populated in your template if the
> template is passed a RequestContext instance as the context (not just a
> Context, because you want the context processors to be executed) *and*
> is you have the "media" context processor in your
> TEMPLATE_CONTEXT_PROCESSORS list (which it will be by default).
>
> I would suspect you've forgotten to pass a RequestContext to
> render_to_response() or whatever call you're using in your view.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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: help needed: apache httpd.conf and urls

2009-04-30 Thread Malcolm Tredinnick

On Thu, 2009-04-30 at 12:27 -0700, zayatzz wrote:
> Hello
> 
> I have this in my template :
> 
> 
> settings file is following:
> MEDIA_ROOT = '/var/www/media/'
> MEDIA_URL = "http://localhost/media/;
> 
> when i go to the webpage then the stuff that i get from server says
> 
> 
> Even when i replace {{ MEDIA_URL }} with anything else i still get
> this in browser:
> 
> 
> Why?

The MEDIA_URL variable will only be populated in your template if the
template is passed a RequestContext instance as the context (not just a
Context, because you want the context processors to be executed) *and*
is you have the "media" context processor in your
TEMPLATE_CONTEXT_PROCESSORS list (which it will be by default).

I would suspect you've forgotten to pass a RequestContext to
render_to_response() or whatever call you're using in your view.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



help needed: apache httpd.conf and urls

2009-04-30 Thread zayatzz

Hello

I have this in my template :


settings file is following:
MEDIA_ROOT = '/var/www/media/'
MEDIA_URL = "http://localhost/media/;

when i go to the webpage then the stuff that i get from server says


Even when i replace {{ MEDIA_URL }} with anything else i still get
this in browser:


Why?

Just in case you need my httpd.conf:


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mce.settings
PythonOption django.root /mce
PythonDebug On
PythonPath "['/home/projects', '/home/zay2/Django/Django-1.0.2-
final'] + sys.path"

Alias /media/admin "/home/zay2/Django/Django-1.0.2-final/django/
contrib/admin/media"
Alias /media "/var/www/media"

Order allow,deny
Allow from all


SetHandler None


SetHandler None


SetHandler None


There probably is something unnecessary or confusing here, but this is
first time i've installed apache, mod_python, mysql and phpmyadmin so
if you spot room for improvement, let me know.

Alan
--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Florian Strzelecki
Yes you can !

*WSGI :*

Alias /another /path/to/your/phpApplication
WSGIScriptAlias / /path/to/file.wsgi

*MOD_PYTHON :*

Use Location apache directive.
I don't remember what to do for php... sorry, but I know that on this way.


2009/4/5 Dougal Matthews 

> It depends how you mean combine really. You can have them both running on
> the same server, you can have them share the same database (then you can
> still manage it with django)
> Dougal
>
>
> ---
> Dougal Matthews - @d0ugal
> http://www.dougalmatthews.com/
>
>
>
> 2009/4/5 atik 
>
>
>> Ok. Again Thanks. I will do it.
>> Can i combine django application with PHP?
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Dougal Matthews
It depends how you mean combine really. You can have them both running on
the same server, you can have them share the same database (then you can
still manage it with django)
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/5 atik 

>
> Ok. Again Thanks. I will do it.
> Can i combine django application with PHP?
> >
>

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread atik

Ok. Again Thanks. I will do it.
Can i combine django application with PHP?
--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
On Sun, Apr 5, 2009 at 3:35 PM, atik  wrote:

>
> Thanks! That is solved. Another Question.
> I can only run project at development server. How to run on apache?
> >
>
You can run under Apache using either mod_python or mod_wsgi, start by
taking a look at their documentation:
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/
http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread atik

Thanks! That is solved. Another Question.
I can only run project at development server. How to run on apache?
--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
On Sun, Apr 5, 2009 at 3:28 PM, atik  wrote:

>
>
> here is my urls.py file-
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>(r'^polls/$', 'mysite.polls.views.index'),
>(r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
>(r'^polls/(?P\d+)/results/$',
> 'mysite.polls.views.results'),
>(r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
> )
>
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> #urlpatterns = patterns('',
># Example:
># (r'^mysite/', include('mysite.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/(.*)', admin.site.root),
> )
>
> >
>
What you want to do is combine these into one urlpattern:

from django.conf.urls.defaults import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P\d+)/results/$', 'mysite.polls.views.results'),
(r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
(r'^admin/(.*)', admin.site.root),
)

Would be the end result.

Alex


-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread atik


here is my urls.py file-

from django.conf.urls.defaults import *

urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P\d+)/results/$',
'mysite.polls.views.results'),
(r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
)


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

#urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.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/(.*)', admin.site.root),
)

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
On Sun, Apr 5, 2009 at 3:17 PM, atik  wrote:

>
> Hello!
> I am new to django and using version 1.0.1. I have done some basics
> shown on official  target='_blank'>tutorials. I have a question: Every
> thing is quite ok to me except that when i have come through part two
> of the tutorial (a admin site) it gives me admin interface. But after
> finishing part three and four i have only public site. How can i get
> both working?
> >
>
Absolutely.  Without seeing  your code I'd guess the problem is that you
only have the patterns from part 2 in your URLconf.  You need to make sure
you have the URLs from both parts in your URLconf.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Beginner's Help needed

2009-04-05 Thread atik

Hello!
I am new to django and using version 1.0.1. I have done some basics
shown on official tutorials. I have a question: Every
thing is quite ok to me except that when i have come through part two
of the tutorial (a admin site) it gives me admin interface. But after
finishing part three and four i have only public site. How can i get
both working?
--~--~-~--~~~---~--~~
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: Saving Deserialized Objects -- Help Needed

2009-03-09 Thread Malcolm Tredinnick

On Mon, 2009-03-09 at 21:13 -0700, Brian wrote:
> I'm having trouble saving deserialied model objects. My setup is that
> I have two django instances, let's call them A and B. The intial
> request comes into server A which then serializes some objects and
> sends them off to server B for the results of some computation. When
> server B tries to save the objects sent by A it fails.
> 
> I believe the save is failing because the objects already have primary
> keys set from server A's database, but are not contained in server B's
> database. I could be wrong that this is the reason.

So why not test that theory? You have an hypothesis. Now prove or
disprove.

Put in some debugging printing or logging on the B side and see if the
objects have the "pk" value set. If B doesn't set them and that value is
meant to represent something in the database and the database is meant
to set that value (as part of an auto-increment sequence), then that's
your problem. If the "pk" value isn't set, you know it isn't the
problem.

If it is the problem, one solution would be to make the primary key on
the B side (if it needs to match the value on the A side) not be an
auto-incrementing sequence. Just make it an integer so that you can set
it yourself. It will mean having slightly different model definitions on
the A and B side, but that's life in the big city. If you want the
models to be the same, you'll need to remove the pk value before saving
(set it to None).

Regards,
Malcolm


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Saving Deserialized Objects -- Help Needed

2009-03-09 Thread Brian

I'm having trouble saving deserialied model objects. My setup is that
I have two django instances, let's call them A and B. The intial
request comes into server A which then serializes some objects and
sends them off to server B for the results of some computation. When
server B tries to save the objects sent by A it fails.

I believe the save is failing because the objects already have primary
keys set from server A's database, but are not contained in server B's
database. I could be wrong that this is the reason.

Both django instances are operating the same projects with the same
models. I do need the objects saved, since their relationships are
described in their foreign key relationships, that are used for the
computation.

Any assistance would be very appreciated.

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
-~--~~~~--~~--~--~---



formfield_for_foreignkey help needed.

2009-01-18 Thread mweather

This is probably really sinple, but I'm pretty new to Sjango, and I
can't seem to figure it out.

I've used Django before, and came back to it once I saw the recent
commit that added ability to override admin formfields, which looks to
be exactly what I need.

I have a Product model and an AffiliateProduct model with a foreign
key to product. I'm trying to get the admin to only display the
AffiliateProduct's currently selected Product in the foreignkey field
(ideally also showing no options if it's blank). I'm using basically
the same code from the example in the admin docs:

class AffiliateProductAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "product":
kwargs["queryset"] = Product.object.filter(pk=?)
return db_field.formfield(**kwargs)
return super(AffiliateProductAdmin,
self).formfield_for_foreignkey(db_field, request, **kwargs)

Basically, I need to fill in the ?. I'm not familiar enough with
the innards of Django to even guess where to begin.


--~--~-~--~~~---~--~~
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: Post tutorial help needed - generic.create_update.create_object

2008-12-22 Thread Greg Schwimer
OK, that makes sense then. Thank you!

On Mon, Dec 22, 2008 at 5:11 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:

>
> On Mon, 2008-12-22 at 15:32 -0700, Greg Schwimer wrote:
> [...]
>
> >
> > I suspect I've now moved on to a problem in a new area.  The thing I
> > don't quite get is why adding auto_now_add to the pub_date field in
> > the model broke this.   Any ideas?
>
> Because auto_now_add fields are not editable. They are automatically
> given a value at creation time.
>
> Regards,
> Malcolm
>
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >