Re: Project together

2023-12-01 Thread Aubdur rob Anik
I'm interested. Add me please.
Phone(WhatsApp): +8801685946475

On Friday, 1 December 2023 at 00:30:44 UTC+6 Talha Malik wrote:

> I'm interested, add me too +923098109886 <+92%20309%208109886>
>
> On Mon, 27 Nov 2023, 9:20 pm Aminu Auwal,  wrote:
>
>> I am interested add me +2438062282242
>>
>> On Mon, Nov 27, 2023 at 4:10 PM okot emmanuel  
>> wrote:
>>
>>> add me +256779815657 <+256%20779%20815657>
>>>
>>>
>>>
>>> On Mon, Nov 27, 2023 at 12:48 AM usman ashir  
>>> wrote:
>>>
 yes pls send us the group link. or pls 2348166997172.add my contact 

 On Sun, Nov 26, 2023, 9:38 PM Jay Senkow  wrote:

> interested.
>
> Sent from my iPhone
>
> On Nov 26, 2023, at 2:46 PM, ekong, emmanuel  
> wrote:
>
> 
> I am interested
>
> Phone ( WhatsApp): +234-8071-505-514
>
> On Thu, 23 Nov 2023 at 7:13 PM, Youssef Bachraoui <
> bachraou...@gmail.com> wrote:
>
>> Hi developer i search to make a group on WhatsApp to begin a project 
>> together anyone interested about 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d5244e76-6bd3-4bde-bf31-a72720bee1acn%40googlegroups.com
>>  
>> 
>> .
>>
>
> *Disclaimer*
> This e-mail is intended solely for the named recipient. The 
> information contained in this message is strictly confidential. 
>
>- If you are not the named recipient, you are hereby notified that 
>any use, dissemination or reproduction of this document and or its 
> content 
>is prohibited and may be deemed unlawful.
>- If you are not the named recipient of this e-mail, please notify 
>the sender by a return e-mail and delete all copies of it from your 
>computer and mail.
>
> Any views expressed in this e-mail are those of the individual sender, 
> except where the sender specifically states them to be those of Landmark 
> University , to whom no liability shall be 
> attached whatsoever.
>
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAAP9wczbDL6n7qW5WARHwGsR8hbVgwV0K%3DdTGJoBqE3aQc4TWA%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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/ACC804A9-5EF3-4D3A-B11A-6AE171113174%40gmail.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/CAHNdQhwinzLUgaUvQNfYOnxbXhtk4shxcSn5zz00Kceiz7Zb%2Bw%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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAHoGtOznPiHRbXdKqJiGQEUgF0i613_%2Bd3ejk%3Dx17EaOXmM%3DUA%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 

Re: Project together

2023-11-24 Thread Aubdur rob Anik
Please Add me, i am interest

On Friday, 24 November 2023 at 20:26:22 UTC+6 anupam sharma wrote:

> I am interested. Please let us know the details.
>
> On Fri, 24 Nov, 2023, 11:48 am Ogunlade Stephen Olayide, <
> ogunlade...@gmail.com> wrote:
>
>> What is the project Stack?
>>
>> On Thu, Nov 23, 2023 at 7:14 PM Youssef Bachraoui  
>> wrote:
>>
>>> Hi developer i search to make a group on WhatsApp to begin a project 
>>> together anyone interested about 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/d5244e76-6bd3-4bde-bf31-a72720bee1acn%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/CANyXpori%2B9nGkES8W%3D7ETgu7GX%2BQrjMW13i_LAW%3D8wSCkyu9ug%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/8dac8cd7-c0d9-454c-a48d-9c82cec83a15n%40googlegroups.com.


Re: Class Base View Foreign key

2021-02-27 Thread Rob Wilkinson
This is what my code looks like and it now works :

see where it says "example of setting pk..." below:

def dyn_menu_new(request):

from .models import menu as menuX

from .models import buttons

if request.method == 'POST':

if request.user.is_superuser:

   super_user = "superuser"

else:

   super_user = ""

form =
dyn_menuForm(request.POST,name=request.user.username,super_user=super_user)


if form.is_valid():

menu_id  = request.POST.get('menu_id', '')

menu_id  = menu_id.replace(" ", "")

menu_title   = request.POST.get('menu_title', '')

menu_notes   = request.POST.get('menu_notes', '')

menu_fb  = request.POST.get('menu_fb', '')

menu_link= request.POST.get('menu_link', '')

menu_align   = request.POST.get('menu_align', '')

menu_order   = request.POST.get('menu_order', '')

menu_status  = request.POST.get('menu_status', '')

menu_admin   = request.POST.get('menu_admin', '')

menu_image   = request.POST.get('menu_image', '')

#

# example of setting pk :
https://groups.google.com/g/django-users/c/PcSDKZhPVmc

#

buttons_pk = request.POST.get('menu_dropdown')

menu_dropdown = buttons.objects.get(pk=buttons_pk)

#

menu_new_window  = request.POST.get('menu_new_window', '')

menu_scope  = request.POST.get('menu_scope', '')

current_user = request.user

menu_user  = current_user


p = menuX(menu_id=menu_id, menu_title=menu_title,
menu_notes=menu_notes, menu_fb=menu_fb, menu_link=menu_link,
menu_align=menu_align, menu_order=menu_order, menu_status=menu_status,
menu_admin=menu_admin, menu_image=menu_image, menu_dropdown=menu_dropdown,
menu_new_window=menu_new_window,menu_scope=menu_scope,menu_user=menu_user)

try:

   p.save()

except:


   messages.error(request, "Menu ID is not unique. Please
specify a different Menu ID.")

   return render(request, 'dyn_menu.html', {'form': form})

return redirect("/theme/dyn_menu_list")

On Sat, Feb 27, 2021 at 10:40 AM sebasti...@gmail.com <
sebastian.ju...@gmail.com> wrote:

> Hey,
>
> thanks for you response. Before i save i want to make is_valid() and there
> came this exception.
>
> Regards
>
> wilkycon...@gmail.com schrieb am Samstag, 27. Februar 2021 um 16:36:35
> UTC+1:
>
>> I had similar issues, I found this helpful:
>>
>> https://groups.google.com/g/django-users/c/PcSDKZhPVmc
>>
>>
>>
>> On Sat, Feb 27, 2021 at 9:19 AM Ryan Nowakowski 
>> wrote:
>>
>>> I think choices is causing the problem. Try limit_choices_to instead:
>>>
>>>
>>> https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
>>>
>>> On February 27, 2021 8:06:26 AM CST, "sebasti...@gmail.com" <
>>> sebasti...@gmail.com> wrote:

 Hello,

 I have a CBV with Createview. Now i have a Foreign Key from Box to Tabs
 model. When i submit request then i get error:* Cannot assign "1":
 "Box.tabs_link" must be a "Tabs" instance*. This happens on
 form.is_valid

 I understand this error but i don't know how can i fix this.

 *Models.py*:
 class Box(models.Model):
 id = models.AutoField(primary_key=True)
 name = models.CharField(max_length=200, default="", blank=False,
 null=False) #Überschrift der Box
 tabs_link = models.ForeignKey(Tabs, on_delete=models.CASCADE,
 null=False,blank=False,choices=[
 (c.id, c.name) for c in
 Tabs.objects.all()]
)

 column =
 models.PositiveIntegerField(choices=column_choices,blank=False,
 null=False,default=0) #linke oder rechte Seite
 position = models.PositiveIntegerField(default=1,blank=False,
 null=False) #position auf der linken/rechten Seite
 modul = models.PositiveIntegerField(choices=Modul_Auswahl,
 default=0)

 class Meta:
 ordering = ["position","column"]
 def __str__(self):
 return self.name

 *Views.py:*
 class BoxCreateView(CreateView):
 model = Box
 template_name = 'marketing/boxcreate.html'
 form_class = Boxform
 success_url = reverse_lazy('boxlist')

 def post(self, request, *args, **kwargs):
 formbox = Boxform(self.request.POST)
 if (*formbox.is_valid()*):
pass

 *Forms.py*
 class Boxform(forms.ModelForm):
 class Meta:
 model = Box
 exclude = ('',)

 labels = {
 'tabs_link': 'Tabulator',
 'column': 

Re: Class Base View Foreign key

2021-02-27 Thread Rob Wilkinson
I had similar issues, I found this helpful:

https://groups.google.com/g/django-users/c/PcSDKZhPVmc



On Sat, Feb 27, 2021 at 9:19 AM Ryan Nowakowski  wrote:

> I think choices is causing the problem. Try limit_choices_to instead:
>
>
> https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
>
> On February 27, 2021 8:06:26 AM CST, "sebasti...@gmail.com" <
> sebastian.ju...@gmail.com> wrote:
>>
>> Hello,
>>
>> I have a CBV with Createview. Now i have a Foreign Key from Box to Tabs
>> model. When i submit request then i get error:* Cannot assign "1":
>> "Box.tabs_link" must be a "Tabs" instance*. This happens on form.is_valid
>>
>> I understand this error but i don't know how can i fix this.
>>
>> *Models.py*:
>> class Box(models.Model):
>> id = models.AutoField(primary_key=True)
>> name = models.CharField(max_length=200, default="", blank=False,
>> null=False) #Überschrift der Box
>> tabs_link = models.ForeignKey(Tabs, on_delete=models.CASCADE,
>> null=False,blank=False,choices=[
>> (c.id, c.name) for c in
>> Tabs.objects.all()]
>>)
>>
>> column =
>> models.PositiveIntegerField(choices=column_choices,blank=False,
>> null=False,default=0) #linke oder rechte Seite
>> position = models.PositiveIntegerField(default=1,blank=False,
>> null=False) #position auf der linken/rechten Seite
>> modul = models.PositiveIntegerField(choices=Modul_Auswahl,
>> default=0)
>>
>> class Meta:
>> ordering = ["position","column"]
>> def __str__(self):
>> return self.name
>>
>> *Views.py:*
>> class BoxCreateView(CreateView):
>> model = Box
>> template_name = 'marketing/boxcreate.html'
>> form_class = Boxform
>> success_url = reverse_lazy('boxlist')
>>
>> def post(self, request, *args, **kwargs):
>> formbox = Boxform(self.request.POST)
>> if (*formbox.is_valid()*):
>>pass
>>
>> *Forms.py*
>> class Boxform(forms.ModelForm):
>> class Meta:
>> model = Box
>> exclude = ('',)
>>
>> labels = {
>> 'tabs_link': 'Tabulator',
>> 'column': 'Spalte',
>> }
>> widgets = {
>> 'name': textinputfeld,
>> 'position': integerfeld,
>> 'column': integerfeld,
>> 'modul': selectfield,
>> 'tabs_link': selectfield,
>> }
>>
>> Regards
>>
>>
>> --
> 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/C48208D2-7C9F-4F99-B664-20269F331FD2%40fattuba.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/CAAdSEeZyYYogUjz20ssChfx-fZUuDpUNZ4P-NPjn2SSE%2B8PkjQ%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
DEBUG=Yes in settings.py shows what you need even in Apache

Don’t run like that in prod!


On Fri, Feb 12, 2021 at 10:36 AM Ognjen B.  wrote:

> Hi everyone,
> I was wondering can anyone point me to a document describing how to setup
> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
> when using Django with Apache and mod_wsgi? Or if it's not possible please
> let me know so I don't waste any more time.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%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/CAAdSEeYk4R9xSRuMfnB%2B1PfY46gmJoyeGgG8CNz6WvL-skKo%2BA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
Sorry meant DEBUG=True   :)

On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson 
wrote:

>
> DEBUG=Yes in settings.py shows what you need even in Apache
>
> Don’t run like that in prod!
>
>
> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
> wrote:
>
>> Hi everyone,
>> I was wondering can anyone point me to a document describing how to setup
>> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
>> when using Django with Apache and mod_wsgi? Or if it's not possible please
>> let me know so I don't waste any more time.
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com.


Re:

2021-01-19 Thread Rob Wilkinson
Check out my new Django site, wrk in progress..

https://MrRobby.ca

I can send you my code if it helps

Rob



On Tue, Jan 19, 2021 at 8:39 AM Christ Ikonga 
wrote:

> hi guys i have a question about django form.. how do i use a form i
> created myself to allow users to register on my site?
>
> --
> 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/CADT9t_rr9uEHAxFjJKOhwNdfUXYBCHCK-wa8JeuLrNJk7ZeZhg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADT9t_rr9uEHAxFjJKOhwNdfUXYBCHCK-wa8JeuLrNJk7ZeZhg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAdSEebcDZcQYjiFY6CAVZODNDu%3D7eve12vuJYqR87hTf6hoSA%40mail.gmail.com.


Re: Django Uploaded images not displayed in production

2020-06-21 Thread Rob Riedlinger
Check out this video  https://youtu.be/kBwhtEIXGII  Denis talks about why 
this happens

On Sunday, June 21, 2020 at 7:15:43 PM UTC+2, Anton Nyagolov wrote:
>
> Thanks I will check out the group too for future reference and etc. Those 
> images are uploaded to a database and are part of a model. I iterate 
> through all the object and for each object I print some information 
> including the images, therefore I cannot specify only one specific image. I 
> use admin so I can add my (new future) projects and only by admin they 
> should be able to display automatically on my website with all the 
> information and structure required. 
> Do you sugest changing the value of the imageField 
> (upload_to="static//my_desired_path) ? 
>

-- 
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/33d4c599-135d-45d9-abbc-978e404e4f87o%40googlegroups.com.


Call for Comments from those who use mailing address models in Django

2020-04-09 Thread Rob
Do you use postal addresses (place locations) in one or more of your Django 
projects?

Have you used or considered using the open source package *django-address 
<https://github.com/furious-luke/django-address>*?

Are you an experienced Django package maintainer willing to mentor another 
maintainer? 

Hi, I'm one of the new maintainers of the project with not only a lovely 
namespace, but important function for many Django applications.

We're working to get this project updated and build on the author's past 
work.

To help kick things off, we're looking for community feedback.

If you deal with addresses regularly and especially if you have 
rolled-your-own address model architecture, we want to hear from you!

   - Here is an issue for offering comments on storing addresses 
   <https://github.com/furious-luke/django-address/issues/98> in Django 
   applications.
   - If you are an experienced maintainer of open source Django / Python 
   projects and would be willing to help advise / provide mentorship to a new 
   maintainer, please email me: r...@perchlive.com.

Thanks and in parting: I was going to make a postal address joke...but I 
just don't have the right delivery.

Rob

-- 
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/d8b11078-27aa-4f33-bbd2-f8b601f44d61%40googlegroups.com.


Re: Question about makemigrations

2019-06-21 Thread Rob W
"Migrate is basically the old syncdb but it takes into account all the 
migrations made by makemigrations. You should run the command -migrate- after 
adding a new app under the INSTALLED APPS section in the settings.py file in 
order to synchronize the database state with your current set of models.”



> On Jun 21, 2019, at 7:49 AM, Martin Kong  wrote:
> 
> Hello 
> 
> I make python manage.py migrate instead,but that should be the next step tho
> 
> Regards 
> Martin
> 
> On Fri, 21 Jun 2019 at 7:45 PM, Sebastian Jung  > wrote:
> Hello,
> 
> Do you make python3 manage.py migrate after makemigrations?
> 
> Regards
> 
> Martin Kong mailto:cok...@gmail.com>> schrieb am Fr., 21. 
> Juni 2019, 13:25:
> Hello 
> I am new to django, and i am following the tutorial provide in github, from 
> the tutorial.
> The tutorial I am following is 
> https://github.com/django/django/blob/master/docs/intro/tutorial02.txt 
> 
> 
> and  start from 227, it shows the following instructions:
> 
> 
> .. console::
> 
> $ python manage.py makemigrations polls
> 
> You should see something similar to the following:
> 
> .. code-block:: text
> 
> Migrations for 'polls':
>   polls/migrations/0001_initial.py:
> - Create model Choice
> - Create model Question
> - Add field question to choice
> 
> However, after following the steps 
> I'm missing the last sentence (Add field question to choice) .
> 
> The below is what i had written in model.py, did i make something wrong?
> 
> Thanks
> from django.db import models
> 
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
> 
> class Choice(models.Model):
> question = models.ForeignKey(Question, on_delete=models.CASCADE)
> choice_text =  models.CharField(max_length=200)
> votes = models.IntegerField(default=0)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 https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CADEd1fars051JXymX0sbktNqKYak%2Bejv9uc2fGxxxbJe2Cnp1w%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 https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAKGT9mw6VfP_Ftrsz8iAGtXQ3mDXfeOgOxz7MfuYvejTNko8Gw%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 https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CADEd1fZCnF4B%3DqNB14jqzW16pZ8BqFfMqr4PJBuy_BiwxTpxgA%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 

Djano rest api

2019-06-12 Thread Rob W
Hi all,

I need to see a django rest api, with proper endpoint design - REST-ish by 
using paths, HTTP methods, response codes, JSONs, errors returned in JSON,

Anyone have this already completed that I can take a look at?

-- 
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/DE361A10-F522-421D-94EC-56473F1D01FA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get object id from database?

2019-05-25 Thread Rob Gmail
Look at the new Boston.com he did a tutorial on exactly this issue

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 25, 2019, at 7:25 PM, Yoo  wrote:
> 
> Maybe try album__id (two underscores)? Or try album_title as defined in the 
> Album model. I also advise not to expose your primary key in the URL. If the 
> above did not work, check Django  documentation: 
> https://docs.djangoproject.com/en/2.2/topics/http/urls/
> 
>> On Saturday, May 25, 2019 at 2:46:58 PM UTC-4, Anchal Agarwal wrote:
>> I am currently working on a django project in which there is a music app. 
>> The models of this app contains Albums and Songs. I want to return the http 
>> response when the django receives a url as /music/712 , here 712 is the 
>> object id.
>> Please help me out in resolving the issue.Thanks in advance.
>> 
>> Here are my files. Here album_id will be the id of the object.
>> models.py
>> from django.db import models
>> 
>> class Album(models.Model):
>> artist = models.CharField(max_length=250)
>> album_title = models.CharField(max_length=500)
>> genre=models.CharField(max_length=100)
>> album_logo = models.CharField(max_length=1000)
>> 
>> def __str__(self):
>> return self.album_title 
>> 
>> class Song(models.Model):
>> album= models.ForeignKey(Album, on_delete=models.CASCADE)
>> file_type= models.CharField(max_length=10)
>> song_title = models.CharField(max_length=250)
>> 
>> views.py
>> from django.shortcuts import render
>> from django.http import HttpResponse
>> 
>> def homepage(request):
>> return HttpResponse("You are looking music!!")
>> 
>> def detail(request, album_id):
>> return HttpResponse("Details for Album id:"+ str(album_id)+ "")
>> 
>> 
>> urls.py
>>  
>> from django.urls import path
>> from . import views
>> 
>> app_name="music"
>> 
>> urlpatterns=[
>> #/music/
>> path('',views.homepage,name='homepage'),
>> 
>> # /music/712
>> path('[0-9]+/',views.detail,name='detail'),
>> ]
> 
> -- 
> 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/848dc27b-9d4c-42a1-a691-c74ac4112e41%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/01D40376-A294-48D1-AD09-47C6A3E25C6B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

2019-05-16 Thread Rob W
First, you should not share your password to your server to anyone….thats very 
dangerous.  Now anyone can log in to your server with nefarious intentions.  
Be more careful.

But it sounds like something on the server is blocking your connection.  

> On May 16, 2019, at 8:57 AM, omar ahmed  wrote:
> 
> hii ..
> i try to publish my first project on python anywhere but it still not working 
> and this is my error :
> could not connect to server: Connection refused Is the server running on host 
> "localhost" (::1) and accepting TCP/IP connections on port 5432? could not 
> connect to server: Connection refused Is the server running on host 
> "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could 
> not connect to server: Connection refused Is the server running on host 
> "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
> 
> and this is my db settings  :
> 
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'arena',
> 'USER': 'arenadbuser',
> 'PASSWORD': 'mlo9**@la',
> 'HOST': 'localhost',
> 'PORT': '',
> }
> }
> 
> -- 
> 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/93204eb8-f5e3-43bf-98ff-b79478bce544%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/04731D2F-C4EA-4716-969E-71994AF2EB11%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems with mysql client

2019-05-12 Thread Rob W
I did, but believe it or not, that install fails too.


> On May 11, 2019, at 12:12 PM, Jorge Gimeno  wrote:
> 
> Rob,
> 
> On the off chance you haven't seen it, I found a Stack Overflow question on 
> this:  
> https://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-found
>  
> <https://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-found>.
>  Unfortunately, I don't know Mac OS all that well to offer more help than 
> that.
> 
> -Jorge
> 
> On Sat, May 11, 2019 at 9:04 AM Rob Gmail  <mailto:randmwhee...@gmail.com>> wrote:
> Mac OS 
> 
> Rob 
> 203-671-6514
> Sent from my mobile device, please excuse the typos. 
> 
> On May 11, 2019, at 11:42 AM, Jorge Gimeno  <mailto:jlgimen...@gmail.com>> wrote:
> 
>> 
>> 
>> On Sat, May 11, 2019 at 8:16 AM Rob W > <mailto:randmwhee...@gmail.com>> wrote:
>> for my django project, we are using mysql.
>> 
>> no matter how i try to install it, python-mysqldb, or just pip install 
>> mysqlclient, it fails.
>> 
>> i've installed mysqlconnector, i've tried everything. 
>> 
>> any suggestions ?
>> 
>> 
>> Collecting mysqlclient
>> 
>>   Downloading 
>> https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
>>  
>> <https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz>
>>  (85kB)
>> 
>>  || 92kB 1.3MB/s 
>> 
>> ERROR: Complete output from command python setup.py egg_info:
>> 
>> ERROR: /bin/sh: mysql_config: command not found
>> 
>> Traceback (most recent call last):
>> 
>>   File "", line 1, in 
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup.py", line 
>> 16, in 
>> 
>> metadata, options = get_config()
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
>> line 51, in get_config
>> 
>> libs = mysql_config("libs")
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
>> line 29, in mysql_config
>> 
>> raise EnvironmentError("%s not found" % (_mysql_config_path,))
>> 
>> OSError: mysql_config not found
>> 
>> 
>> 
>> ERROR: Command "python setup.py egg_info" failed with error code 1 in 
>> /private/tmp/pip-install-suhqq3eh/mysqlclient/
>> 
>> 
>> -- 
>> 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 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/31f86e65-7e0a-49c7-b574-1670fba1ca18%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/31f86e65-7e0a-49c7-b574-1670fba1ca18%40googlegroups.com?utm_medium=email_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
>> 
>> Rob,
>> 
>> What operating system are you using?
>> 
>> -Jorge 
>> 
>> -- 
>> 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 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CANfN%3DK-vw16fWxhZYa3f8VP6t6cCi5BA%2BoNtjmof99CQWNKb-Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/m

Re: problems with mysql client

2019-05-11 Thread Rob Gmail
Mac OS 

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 11, 2019, at 11:42 AM, Jorge Gimeno  wrote:
> 
> 
> 
>> On Sat, May 11, 2019 at 8:16 AM Rob W  wrote:
>> for my django project, we are using mysql.
>> 
>> no matter how i try to install it, python-mysqldb, or just pip install 
>> mysqlclient, it fails.
>> 
>> i've installed mysqlconnector, i've tried everything. 
>> 
>> any suggestions ?
>> 
>> 
>> Collecting mysqlclient
>> 
>>   Downloading 
>> https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
>>  (85kB)
>> 
>>  || 92kB 1.3MB/s 
>> 
>> ERROR: Complete output from command python setup.py egg_info:
>> 
>> ERROR: /bin/sh: mysql_config: command not found
>> 
>> Traceback (most recent call last):
>> 
>>   File "", line 1, in 
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup.py", line 
>> 16, in 
>> 
>> metadata, options = get_config()
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
>> line 51, in get_config
>> 
>> libs = mysql_config("libs")
>> 
>>   File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
>> line 29, in mysql_config
>> 
>> raise EnvironmentError("%s not found" % (_mysql_config_path,))
>> 
>> OSError: mysql_config not found
>> 
>> 
>> 
>> ERROR: Command "python setup.py egg_info" failed with error code 1 in 
>> /private/tmp/pip-install-suhqq3eh/mysqlclient/
>> 
>> -- 
>> 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/31f86e65-7e0a-49c7-b574-1670fba1ca18%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> Rob,
> 
> What operating system are you using?
> 
> -Jorge 
> -- 
> 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/CANfN%3DK-vw16fWxhZYa3f8VP6t6cCi5BA%2BoNtjmof99CQWNKb-Q%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E5694676-28BF-4FEB-92B8-0B5A86300438%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


problems with mysql client

2019-05-11 Thread Rob W
for my django project, we are using mysql.

no matter how i try to install it, python-mysqldb, or just pip install 
mysqlclient, it fails.

i've installed mysqlconnector, i've tried everything. 

any suggestions ?


Collecting mysqlclient

  Downloading 
https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
 
(85kB)

 || 92kB 1.3MB/s 

ERROR: Complete output from command python setup.py egg_info:

ERROR: /bin/sh: mysql_config: command not found

Traceback (most recent call last):

  File "", line 1, in 

  File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup.py", line 
16, in 

metadata, options = get_config()

  File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
line 51, in get_config

libs = mysql_config("libs")

  File "/private/tmp/pip-install-suhqq3eh/mysqlclient/setup_posix.py", 
line 29, in mysql_config

raise EnvironmentError("%s not found" % (_mysql_config_path,))

OSError: mysql_config not found



ERROR: Command "python setup.py egg_info" failed with error code 1 in 
/private/tmp/pip-install-suhqq3eh/mysqlclient/

-- 
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/31f86e65-7e0a-49c7-b574-1670fba1ca18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


reporting

2019-05-09 Thread Rob W
whats the best web reporting tool to use that easy and will easily 
integrate with django ?

-- 
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/3ed0186f-a05b-4bff-8fcd-349b7ba762e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help with project

2019-05-08 Thread Rob W
There are a few of us in a group slack who are trying to build a working 
production django ap for reporting. 
We are looking for someone who really knows Django to guide us through this 
project.

We are all really hoping that someone will be kind enough to guide us and 
help us build this app.

it's simple, we are connecting to a remote mysql db, which i also setup in 
Azure for sync purposes.

so we are creating a login capability, reset, forgot password, etc.

then on the dashboard we simply want to generate reporting from this remote 
db.

I am hopeful someone will help us.


-- 
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/c33feee5-4001-4bf1-b8e8-0f0c9c9517c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it Possible to run django locally without internet connection

2019-05-07 Thread Rob Gmail
Yes you can.  I do it for an IOT device that we have using Django/python, many 
times it does not have an Internet connection but runs fine. 

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 7, 2019, at 11:38 AM, Idris Adegbite  wrote:
> 
> Good day guys, Please can i run django on laptop without internet connection.
>  if yes, Please kindly help me out with the procedures.
> 
> I am having issues connecting my  phone and laptop and i dont want that to 
> slow down my learning.
> Any help would be 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 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/809870ae-92a1-4881-96ae-838d9342ee0b%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/A015232A-FE14-4BA8-9C45-70E4C6CD6F23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django project

2019-05-06 Thread Rob W
https://drive.google.com/file/d/1rxXhfNVYq8mapSeaEapuLLsfPc4eaNDR/view?usp=sharing

> On May 6, 2019, at 10:41 AM, Pushkar Bhuse  wrote:
> 
> Please send me the details too.
> 
> On Mon, 6 May 2019 at 8:05 PM, fazal rehman  <mailto:fazalrehman...@gmail.com>> wrote:
> Send me the details..
> 
> On Mon 6 May, 2019, 8:04 PM Rob W,  <mailto:randmwhee...@gmail.com>> wrote:
> Yes, I’m a beginner too, but need to get it completed.  The first piece 
> should not be too difficult.
> 
> 
> 
>> On May 6, 2019, at 10:32 AM, fazal rehman > <mailto:fazalrehman...@gmail.com>> wrote:
>> 
>> Is it for beginners ?
>> 
>> On Mon 6 May, 2019, 8:01 PM , > <mailto:randmwhee...@gmail.com>> wrote:
>> I am looking for 2 people to work with me on a django project.
>> 
>> if you are interested, email me.
>> 
>> randmwhee...@gmail.com <mailto:randmwhee...@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 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a86f0b6a-069b-49ec-98d1-7a9e74efbb24%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a86f0b6a-069b-49ec-98d1-7a9e74efbb24%40googlegroups.com?utm_medium=email_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <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 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAG9Y3D8ekKsrZZ7x1gZ-zWCLJ56Uo1GHaPoiqRKsim-d5xhXcQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAG9Y3D8ekKsrZZ7x1gZ-zWCLJ56Uo1GHaPoiqRKsim-d5xhXcQ%40mail.gmail.com?utm_medium=email_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <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 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com 
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/B908B907-A71A-4EC5-8910-39778B9118B9%40gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/B908B907-A71A-4EC5-8910-39778B9118B9%40gmail.com?utm_medium=email_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <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 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com 
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAG9Y3D8N%2BExowW%3D6U6Wur75rTx-vEbGpKLF9%2BqPvt%2BNNNehs1Q%40mail.gmail.com
>  
> <https://g

Re: django project

2019-05-06 Thread Rob W
Yes, I’m a beginner too, but need to get it completed.  The first piece should 
not be too difficult.



> On May 6, 2019, at 10:32 AM, fazal rehman  wrote:
> 
> Is it for beginners ?
> 
> On Mon 6 May, 2019, 8:01 PM ,  > wrote:
> I am looking for 2 people to work with me on a django project.
> 
> if you are interested, email me.
> 
> randmwhee...@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 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/a86f0b6a-069b-49ec-98d1-7a9e74efbb24%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/CAG9Y3D8ekKsrZZ7x1gZ-zWCLJ56Uo1GHaPoiqRKsim-d5xhXcQ%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B908B907-A71A-4EC5-8910-39778B9118B9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Projects to work on

2019-05-05 Thread Rob Gmail
Go ahead and email me if you could you’ll find my email in the group

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 5, 2019, at 2:51 PM, Emmanuel klutse  wrote:
> 
> Hello Rob, 
> Let me know what role I can play. Thx 
> 
> Emmanuel Klutse 
> Sent from my iPhone
> 
>> On 5 May 2019, at 5:54 PM, Rob Gmail  wrote:
>> 
>> Maybe the three of us could work on the same project?
>> 
>> Rob 
>> 203-671-6514
>> Sent from my mobile device, please excuse the typos. 
>> 
>>> On May 5, 2019, at 1:52 PM, Emmanuel klutse  wrote:
>>> 
>>> Hello team, 
>>> I also started two months ago. Working on a really problem will be of great 
>>> help to me....
>>> Can I work with you when you get a project. 
>>> 
>>> Sent from my iPhone
>>> 
>>>> On 5 May 2019, at 5:40 PM, Rob Gmail  wrote:
>>>> 
>>>> I have a reports project that you might be interested in working on
>>>> 
>>>> Rob 
>>>> 203-671-6514
>>>> Sent from my mobile device, please excuse the typos. 
>>>> 
>>>>> On May 5, 2019, at 12:56 PM, Jamiu Olashile Salimon 
>>>>>  wrote:
>>>>> 
>>>>> Hello guys,
>>>>> 
>>>>> I've been learning Django for about 6 months now. So far, it's been 
>>>>> great. Currently, I've been looking for a project to work on and its been 
>>>>> difficult for me to decide. One that will challenge me to know more about 
>>>>> Django.
>>>>> 
>>>>> I will much appreciate any project suggestions.
>>>>> 
>>>>> Regards.
>>>>> -- 
>>>>> 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/be3a7115-02ed-4134-950a-c9c9fdb7212a%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/B6494E1D-2ABF-4C60-8DBF-9BBB08A9FD76%40gmail.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/378455E8-2FAE-4D67-8CCB-42ABC4218269%40gmail.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/9726000D-C26F-4382-A6E8-B22B5B09A322%40gmail.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,

Re: Projects to work on

2019-05-05 Thread Rob Gmail
Maybe the three of us could work on the same project?

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 5, 2019, at 1:52 PM, Emmanuel klutse  wrote:
> 
> Hello team, 
> I also started two months ago. Working on a really problem will be of great 
> help to me
> Can I work with you when you get a project. 
> 
> Sent from my iPhone
> 
>> On 5 May 2019, at 5:40 PM, Rob Gmail  wrote:
>> 
>> I have a reports project that you might be interested in working on
>> 
>> Rob 
>> 203-671-6514
>> Sent from my mobile device, please excuse the typos. 
>> 
>>> On May 5, 2019, at 12:56 PM, Jamiu Olashile Salimon 
>>>  wrote:
>>> 
>>> Hello guys,
>>> 
>>> I've been learning Django for about 6 months now. So far, it's been great. 
>>> Currently, I've been looking for a project to work on and its been 
>>> difficult for me to decide. One that will challenge me to know more about 
>>> Django.
>>> 
>>> I will much appreciate any project suggestions.
>>> 
>>> Regards.
>>> -- 
>>> 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/be3a7115-02ed-4134-950a-c9c9fdb7212a%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/B6494E1D-2ABF-4C60-8DBF-9BBB08A9FD76%40gmail.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/378455E8-2FAE-4D67-8CCB-42ABC4218269%40gmail.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/9726000D-C26F-4382-A6E8-B22B5B09A322%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Projects to work on

2019-05-05 Thread Rob Gmail
Yes but let’s talk about it privately via our own emails


Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 5, 2019, at 1:43 PM, salimon jamiu olashile  
> wrote:
> 
> Can you give me more details on it? To understand what you’re talking about.
> 
>> On Sun, 5 May 2019 at 6:41 PM, Rob Gmail  wrote:
>> I have a reports project that you might be interested in working on
>> 
>> Rob 
>> 203-671-6514
>> Sent from my mobile device, please excuse the typos. 
>> 
>>> On May 5, 2019, at 12:56 PM, Jamiu Olashile Salimon 
>>>  wrote:
>>> 
>>> Hello guys,
>>> 
>>> I've been learning Django for about 6 months now. So far, it's been great. 
>>> Currently, I've been looking for a project to work on and its been 
>>> difficult for me to decide. One that will challenge me to know more about 
>>> Django.
>>> 
>>> I will much appreciate any project suggestions.
>>> 
>>> Regards.
>>> -- 
>>> 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/be3a7115-02ed-4134-950a-c9c9fdb7212a%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/B6494E1D-2ABF-4C60-8DBF-9BBB08A9FD76%40gmail.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/CAFhdOCNWOL_p8jwnBVjOZP9CDooi%3Dw_NDQXBtubdoHQW6QDzzA%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B6F34B12-04FE-4304-87AA-BF744344936B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Projects to work on

2019-05-05 Thread Rob Gmail
I have a reports project that you might be interested in working on

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On May 5, 2019, at 12:56 PM, Jamiu Olashile Salimon 
>  wrote:
> 
> Hello guys,
> 
> I've been learning Django for about 6 months now. So far, it's been great. 
> Currently, I've been looking for a project to work on and its been difficult 
> for me to decide. One that will challenge me to know more about Django.
> 
> I will much appreciate any project suggestions.
> 
> Regards.
> -- 
> 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/be3a7115-02ed-4134-950a-c9c9fdb7212a%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/B6494E1D-2ABF-4C60-8DBF-9BBB08A9FD76%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with URLS.PY

2019-05-03 Thread Rob W
Sure.

Here is my urls.py

from django.conf.urls import url
from django.contrib import admin
from django.urls import path

from vr_reporting_app.views import HomeView
from vr_reporting_app.views import Local
from vr_reporting_app.views import User
from vr_reporting_app.views import School


urlpatterns = [
path('', HomeView.as_view(), name='home'),
path('User/', User.as_view(), name='user'),
path('Local/', Local.as_view(), name='local'),
path('School/', School.as_view(), name='school'),   
   
path('admin/', admin.site.urls),
]

Here is my view.py

from django.shortcuts import render
from django.views.generic.base import TemplateView

class HomeView(TemplateView):
template_name = 'dashboard.html'

class Local(TemplateView):
template_name = 'local.html'

class User(TemplateView):
template_name = 'user.html'

class School(TemplateView):
template_name = ‘schoolreporting.html'

Also had to add {% load staticfiles %} to my html pages
And added a tag to each css reference.



> On May 3, 2019, at 2:23 PM, anchal agarwal  wrote:
> 
> I am also facing the same issue ,can you tell me how you resolved this issue?
> On 03-May-2019 9:57 pm,  > wrote:
> >
> > I resolved this.
> >
> >
> > On Thursday, May 2, 2019 at 5:21:59 PM UTC-4, randmw...@gmail.com 
> >  wrote:
> >>
> >> new to django. so i have an app that displays an html page. i also have a 
> >> menu on that page that will load up other html pages.
> >> however, when i add the path to urls.py and then the class def in views, 
> >> it fails. i know it's something simple, what am i missing. 
> >>
> >> As I said, the dashboard.html works, i just want another menu option to 
> >> load the other html file. i have commented this out as it causes my app to 
> >> break.
> >>
> >>
> >>
> >> urls.py
> >>
> >> from django.conf.urls import url
> >> from django.contrib import admin
> >> from django.urls import path
> >>
> >> from vr_reporting_app.views import HomeView
> >> from vr_reporting_app.views import Map
> >>
> >> urlpatterns = [
> >> path('', HomeView.as_view(), name='home'),#points to the view in 
> >> views.py 
> >> #path('map/', Map.as_view(), name='map'),  
> >> 
> >> path('admin/', admin.site.urls),
> >> ]
> >>
> >>
> >> views.py
> >>
> >> from django.shortcuts import render
> >> from django.views.generic.base import TemplateView
> >>
> >> class HomeView(TemplateView):
> >> template_name = 'dashboard.html'
> >>
> >> class Map(TemplateView):
> >> template_name = 'map.html'
> >
> > -- 
> > 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/1e5029d2-a431-4c60-95ec-5ffedb11c124%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/CAMT%3DisXmbb6S1S6jjkowmgPfKjCYtF%2BPyYca9kOA5ZAdyi23zg%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: help with URLS.PY

2019-05-03 Thread Rob W
It does not, I changed the name, stil the same error



> On May 2, 2019, at 8:23 PM, Abishek Goda  wrote:
> 
> 
> Hi,
> 
>> 
>> As I said, the dashboard.html works, i just want another menu option to load 
>> the other html file. i have commented this out as it causes my app to break.
> So the issue is with the map url. Can you try to use a different name? 
>> 
>> #path('map/', Map.as_view(), name='map'),   
> path(‘map/‘, Map.as_view(), name=‘map-link’),
> 
> Or something like that?
> 
> Probably silly, but map is also a builtin. Maybe it conflicts?
> 
> Abishek
> 
> -- 
> 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/06C0F9E2-7E76-4571-8338-4BEFFB816100%40gmail.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/9161767E-FDA3-4329-87D3-B2D0C43F8222%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to create the django_migrations table (ORA-00907: missing right parenthesis)

2019-04-27 Thread Rob W
Can you send a copy of your models.py or a copy/paste of the class that shows 
the error?



> On Apr 27, 2019, at 4:41 PM, tossouwisdom  wrote:
> 
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
> django_migrations table (ORA-00907: missing right parenthesis)
> 
> Le samedi 27 avril 2019 19:56:34 UTC, tossouwisdom a écrit :
> Django 2.2.2
> Cx_oracle 7.2
> base Oracle 11g
> 
> When I run the django migrate commande, i have error 
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
> django_migrations table (ORA-00907: missing right parenthesis)
>   Operations to perform:
>   Apply all migrations: admin, auth, contenttypes, sessions
> Running migrations:
> Traceback (most recent call last):
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 82, in _execute
> return self.cursor.execute(sql)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\oracle\base.py", 
> line 510, in execute
> return self.cursor.execute(query, self._param_generator(params))
> cx_Oracle.DatabaseError: ORA-00907: missing right parenthesis
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\recorder.py", 
> line 67, in ensure_schema
> editor.create_model(self.Migration)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\base\schema.py", 
> line 307, in create_model
> self.execute(sql, params or None)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\base\schema.py", 
> line 137, in execute
> cursor.execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 99, in execute
> return super().execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 67, in execute
> return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 76, in _execute_with_wrappers
> return executor(sql, params, many, context)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 84, in _execute
> return self.cursor.execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\utils.py", line 89, in 
> __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 82, in _execute
> return self.cursor.execute(sql)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\oracle\base.py", 
> line 510, in execute
> return self.cursor.execute(query, self._param_generator(params))
> django.db.utils.DatabaseError: ORA-00907: missing right parenthesis
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File "C:\Python37-32\lib\site-packages\django\core\management\__init__.py", 
> line 381, in execute_from_command_line
> utility.execute()
>   File "C:\Python37-32\lib\site-packages\django\core\management\__init__.py", 
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 323, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 364, in execute
> output = self.handle(*args, **options)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 83, in wrapped
> res = handle_func(*args, **kwargs)
>   File 
> "C:\Python37-32\lib\site-packages\django\core\management\commands\migrate.py",
>  line 234, in handle
> fake_initial=fake_initial,
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\executor.py", 
> line 91, in migrate
> self.recorder.ensure_schema()
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\recorder.py", 
> line 69, in ensure_schema
> raise MigrationSchemaMissing("Unable to create the django_migrations 
> table (%s)" % exc)
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
> django_migrations table (ORA-00907: missing right parenthesis)
> 
> -- 
> 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 

Re: problems with url and views - new to django

2019-04-23 Thread Rob Gmail
Yes I did

Rob 
203-671-6514
Sent from my mobile device, please excuse the typos. 

> On Apr 23, 2019, at 11:05 AM, Victor H. Velasquez Rizo 
>  wrote:
> 
> But. Did you get it to work?
> 
>> On Mon, Apr 22, 2019, 11:38 AM Robert Wahoo  wrote:
>> Actually, I found why I got that last message, was a typo on my part.
>> 
>>  
>> 
>> On to the next problem…Thank you.
>> 
>>  
>> 
>> From: "django-users@googlegroups.com"  on 
>> behalf of "Victor H. Velasquez Rizo" 
>> Reply-To: "django-users@googlegroups.com" 
>> Date: Sunday, April 21, 2019 at 9:02 PM
>> To: "django-users@googlegroups.com" 
>> Subject: Re: problems with url and views - new to django
>> 
>>  
>> 
>> Hello Rob.
>> 
>> With the url "hello/", your trying to call the "hello" function on your 
>> view.py.
>> 
>> First, you need to import "hello" to be able to use it. from  from  
>> lct_app.views import hello
>> 
>> Second, call the function. path('hello/', hello),
>> 
>>  
>> 
>> urls.py
>> 
>> from django.contrib import admin
>> 
>> from django.urls import path
>> 
>> from  lct_app.views import hello
>> 
>>  
>> 
>> urlpatterns = [
>> 
>> path('admin/', admin.site.urls),
>> 
>> path('hello/', hello),
>> 
>> ]
>> 
>>  
>> 
>> views.py
>> 
>>  
>> 
>> from django.shortcuts import render
>> 
>>  
>> 
>> def hello(request):
>> 
>>return render(request, "lct_app/templates/hello.html", {})
>> 
>>  
>> 
>> On Sun, Apr 21, 2019 at 5:07 PM Rob W  wrote:
>> 
>> setting up a new project.
>> 
>> all good, loaded up the project on localhost.
>> 
>>  
>> 
>> however, when creating a view then setting the url, it doesn't work.
>> 
>>  
>> 
>>  
>> 
>> urls.py
>> 
>>  
>> 
>> from django.contrib import admin
>> 
>> from django.urls import path
>> 
>>  
>> 
>> urlpatterns = [
>> 
>> path('admin/', admin.site.urls),
>> 
>> path('hello/', lct_app.site.urls),
>> 
>>
>> 
>>  
>> 
>> views.py
>> 
>>  
>> 
>> from django.shortcuts import render
>> 
>>  
>> 
>> def hello(request):
>> 
>>return render(request, "lct_app/templates/hello.html", {})
>> 
>>  
>> 
>> i comment out the path in urls.py, django comes back. what am i missing?
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>> -- 
>> 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/4872beca-597c-4689-a12e-9e888c5266ca%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>> 
>> 
>> 
>>  
>> 
>> --
>> 
>> 
>> 
>> 
>> Atte...,.
>> Vìctor Hugo Velàsquez Rizo
>> Cali - Colombia
>> 
>> -- 
>> 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/CAFCXTzga%3DFAMdPFwhfp3yMEtyZkA7rzmjhB29rAG160ALuP3Og%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 https://groups.google.com/group/django-users.
>

problems with url and views - new to django

2019-04-21 Thread Rob W
setting up a new project.
all good, loaded up the project on localhost.

however, when creating a view then setting the url, it doesn't work.


*urls.py*

from django.contrib import admin
from django.urls import path

urlpatterns = [
path('admin/', admin.site.urls),
path('hello/', lct_app.site.urls),
   

*views.py*

from django.shortcuts import render

def hello(request):
   return render(request, "lct_app/templates/hello.html", {})

i comment out the path in urls.py, django comes back. what am i missing?



-- 
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/4872beca-597c-4689-a12e-9e888c5266ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to properly use MySQL Generated Fields in Django

2019-04-15 Thread Rob Schneider
Thanks!

I’ll give this a try.

I did have “alpha” as a function in the model, but found I could not easily 
include that in queries as easily as a field in the db. so into the db it went. 
 I’ll try this, and see if I can get the data out as wanted.

thanks!
—rms

> On 15 Apr 2019, at 17:08, Matthew Pava  wrote:
> 
> I wouldn’t save alpha in the database. I would use a property on the model or 
> annotate the field to the object manager.
>  
> Property:
> class Guest(models.Model):
>@property
>def alpha(self):
>   return self.lname[0] if self.lname else ''
>  
> Or on the object manager:
> class GuestManager(models.Manager):
>def get_queryset(self):
>   return 
> super().get_queryset().annotate(alpha=Left('lname', 1))
>  
> class Guest(models.Model):
>objects = GuestManager()
>  
> F

-- 
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/1A969B54-DDDE-47D1-BD34-58AC234D2965%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Smiley in url triggers 500 error

2019-02-22 Thread Rob
Ok solution was simple. I had to add this in settings.py in the database 
section:
’OPTIONS’: {’charset’: ’utf8mb4’},

-- 
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/f5f30028-e375-4fc7-929a-2c341c1f9c6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Smiley in url triggers 500 error

2019-02-21 Thread Rob
Somebody linked our site with a smiley in the url. The url looks like this:
myurl/nummer-333邏/
This results in a 500 error.

Because this page does not exist I expected a 404 error. The 500 error 
shows:
(1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and 
(utf8_general_ci,COERCIBLE) for operation '='")

Because latin1 doesn't support smileys I converted my database and tables 
to utf8mb4_unicode_ci (I saw several site advising against using 
utf8_unicode_ci with mysql)

Then I got this error:
(1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and 
(utf8_general_ci,COERCIBLE) for operation '='")

So the database conversion worked (no other encoding problems with the 
site) but still the error. I changed my my.cnf to:
[mysqld]
local-infile=0
innodb_file_per_table
bind-address=127.0.0.1
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci

[client]
socket=/usr/local/mysql/data/mysql.sock
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

But still the same error. Anybody an idea?

More info:
Database: mysql  Ver 15.1 Distrib 5.5.46-MariaDB, for Linux (x86_64) using 
readline 5.1
Django: 1.11.4
Python: 3.4.2

-- 
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/85f12e69-2446-460a-8e60-3ace96ebc3d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: model permission assignment via groups requires further config at model level?

2018-04-30 Thread Rob B
Thanks George - I understand now.  I never thought it would only apply to
the admin interface but should have.  Kind regards,

Rob


On Sun, Apr 29, 2018, 10:05 PM George Lubaretsi, <glubare...@gmail.com>
wrote:

> Django permissions are only enforced in Admin interface by default. You
> have to enforce them in your views by using `has_perm` method of `user`
> instance - `user.has_perm('.')`
>
> Here's the documentation for permissions -
> https://docs.djangoproject.com/en/dev/topics/auth/default/#permissions-and-authorization
>
> Also, take a look at this blog post for some alternatives to built-in
> permissions system -
> https://www.vinta.com.br/blog/2016/controlling-access-a-django-permission-apps-comparison/
>
> On Monday, April 30, 2018 at 5:04:04 AM UTC+4, rsbaxter wrote:
>>
>> I'm trying to confirm if this is correct: I create a group with no
>> permissions in it, and assign this group to a user.  This user is not
>> "staff status" nor is the user "superuser status" - they are only active.
>> The user is not a member of any other groups - just the one with no
>> permissions.  Upon login, this user is still able to add, update and delete
>> all models in the app.  I think I'm misunderstanding the group
>> functionality - is it correct that permissions assigned via groups are not
>> automatically enforced by django and that further configuration is required
>> to enforce the permissions assigned via the group(s) assigned to the user?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To 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/2c0bd344-cc7b-4691-9a73-4bd39ff7c538%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2c0bd344-cc7b-4691-9a73-4bd39ff7c538%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/CALFpZ6P%2BMS8zgMBmWypKKpFXo1zatsJvYJ4g%2B2ES3gzhE0o96g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get Foreign Key Objects programmatically?

2018-02-27 Thread Rob Schneider
Still a mystery to me.


--rms


> On 28 Feb 2018, at 03:22, Malik Rumi  wrote:
> 
> Did you ever find an answer? If so, do you mind sharing it? Thanks.
> 
>> On Sunday, October 29, 2017 at 9:33:10 AM UTC-7, rmschne wrote:
>> I'm using Django as front end to a MySQL database. User interface is a 
>> terminal program, not a web site.
>> 
>> I've written a very simple generic function to edit the fields of one record 
>> of a Django "object".  It works fine for editing editable fields. User 
>> specifies which field, then is shown the current value, raw_input() for the 
>> new value, then save() the record.
>> 
>> For fields that connect to Foreign Keys, what I want to do is present to 
>> user a simple list of Foreign Key records, from which the user will pick the 
>> relevant ID.  I know, given a list and the ID, how to then edit the record 
>> by doing a Django get(id=ID) on the Foreign Key table.  What I'm having 
>> trouble doing is figuring how
>> 
>> 1. Identify into a variable the name of the Foreign Key table/object
>> 2. Then with that variable do a call to the relevant Foreign Key table, e.g. 
>> ForeignKeyTable.objects.all()
>> 
>> See code below for <===WHAT I DO NOT KNOW HOW TO DO IN CODE Below.  I think 
>> I need some Django function that gives me the foreign key table in some 
>> useable generic form.
>> 
>> Hope all this makes sense. 
>> 
>> --rms
>> 
>> def EditDjangoObjectData(djangoobject,show=False,editonerecord=False):
>> """
>> EditDjangoObjectData()
>> djangoojbect=a django object, e.g. a record in a table
>> """
>> print "\nToDo Note: This routine not yet working on fields with 
>> foreign keys!"
>> changelist=[]
>> ok=True
>> while ok:
>> change=None
>> fields = [(f.name, f.editable) for f in 
>> djangoobject._meta.get_fields()]
>> if show:
>> print "\nfields:\n",fields
>> print "django object:\n",djangoobject
>> s="\nEditable Fields ('enter' to return): \n"
>> fieldlist=[]
>> for i in fields:
>> if i[1]:   # only for 'editable' fields
>> if i[0].lower() <> "id":
>> s=s+i[0]+", "
>> fieldlist.append(i[0])
>> s=s+"DELETE or '?'"
>> fieldok=False
>> while not fieldok:
>> fieldtochange=raw_input("Enter field name to change:\n"+s+": ")
>> if not fieldtochange:
>> return None
>> elif fieldtochange.upper()=="DELETE":
>> ans=raw_input("...Confirm DELETE by typing 'DELETE': ")
>> try:
>> if ans=="DELETE":
>> rtn=djangoobject.delete()
>> print "Deleted. ",rtn
>> return rtn
>> except:
>> print "***DELETE Failed.",sys.exc_info()[0]
>> ans=raw_input("Press 'Enter' to continue ... ")
>> elif fieldtochange=="?":
>> PrintObjectDetails(djangoobject)
>> elif fieldtochange in fieldlist:
>> fieldok=True
>> else:
>> print "\nError. ",fieldtochange,"is not in list. Try 
>> again."
>> print "Current Value of Field to 
>> Change:",fieldtochange,"is:",getattr(djangoobject, fieldtochange)
>> **
>> ** In here add some code to show a list of the foreign key records for user 
>> to select, e.g. ID, Description, 
>> **for r in ForeignKey.objects.all():   <== WHAT I DO NOT KNOW HOW TO DO IN 
>> CODE.
>> **print i.id, i.description
>> **ID=raw_input("Enter ID:)
>> **foreignkeyobject=ForeignKey.objects.get(id=ID)<== WHAT I DO NOT KNOW 
>> HOW TO DO IN CODE.
>> ** ... then put that object into the relevant field 
>> newvalue=raw_input("Enter New Value: ")
>> change="changed ["+fieldtochange+"]"
>> print "\nTo Save   :",djangoobject
>> print "The Change:",change,"to",newvalue
>> if not newvalue:
>> return None
>> elif newvalue.lower()=="none":
>> newvalue=None
>> elif newvalue.lower()=="true":
>> newvalue==True
>> elif newvalue.lower()=="false":
>> newvalue=False
>> setattr(djangoobject, fieldtochange, newvalue)
>> try:
>> djangoobject.save()
>> print ": Success. Saved:",change,"to",newvalue
>> print ": New Object:",djangoobject
>> changelist.append(change)
>> print "ChangeList:",changelist
>> except:
>> print "***Save Failed.",sys.exc_info()[0]
>> ans=raw_input("Press 'Enter' to continue ... ")
>> if editonerecord:
>> ok=False
>> return changelist
>> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django users" group.
> To unsubscribe from this topic, visit 
> 

Django formset security and injecting PKs in formset hidden id fields

2016-05-03 Thread Rob Ladd


I've noticed something troubling in Django formsets:

Each formset.form has a hidden field with the id of the model being edited. 

All one would need to do is change this id and submit, and the default 
formset clean() or save() methods don't bat an eye.


I would think that it wouldn't be too complicated to keep track of which 
objects were in the original formset queryset, and compare them on save. 

Given all the other convenient security methods we have, I wonder why 
Django doesn't do this already?

-- 
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/f2a0ed48-fd23-4f4c-b13d-c11828ef5a55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django formset hidden id field

2016-05-03 Thread Rob Ladd
Carl Meyer said:

"Whatever queryset you pass to the model formset limits the 
available rows for editing. The end user can edit the PK to refer to any 
item in that queryset, but not any item in the table. "

That's not true, based on my observation. 
As long as the PK refers to any object of that type, it can be edited by 
monkeying with the hidden id field.
I think that's a pretty big gotcha, since we have conveniences like 
permission_required decorator, {% csrf_token %}, etc.

On Wednesday, May 27, 2015 at 9:47:08 AM UTC-4, Cheng Guo wrote:
>
> Hello,
>
> I have a formset and when I render it, Django would include this line in 
> the HTML:
>
> 
>
> I am curious what is the purpose of having an id field here. 
>
> I mean in what situation would you use it. I did look through Django's 
> documentation 
> on formset 
> but 
> cannot find much documentation on this.
> One answer I got is that this id field is the value of the primary key of 
> the model bound to this form. It is there so that when the formset updates, 
> people can use it to retrieve the corresponding record from the database.
>
> Is the above explaination correct?
>
> If this explaination is correct, then my next question is, wouldn't it be 
> dangerous to expose the primary key like that? I can make a post call to 
> your server with a modified pk which can mess up your database.
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe307db9-12fb-4b05-a049-7e83c5ac8d80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone use Django on bluehost? "Cant find fcgi module" error on line 9 .

2016-04-09 Thread Rob Groves
I am using Django on bluehost.  I suspect that the issue you are seeing is 
that Django1.9 has stopped supporting fcgi.  I found that out when I tried 
to upgrade from 1.8 a while back.  I think you can probably copy over the 
fcgi module from the Django 1.8 release, but I haven't tried that.  I just 
stayed at 1.8, since it is still under support.  I figured I'd deal with it 
later when I have to move to 1.9.

On Thursday, April 7, 2016 at 11:28:53 AM UTC-4, django...@gmail.com wrote:
>
> We are using django on bluehost. Installed python, flup, django, and using 
> a postgres server. Every time I try and run fcgi it gives an error that the 
> module does not exist. Verified with bluehost that it is on our server. Put 
> it in the htaccess file Help anyone
>

-- 
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/eb86f5a0-d5cb-4873-93d7-1b97f860143e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django error report not being sent through email

2015-09-20 Thread Rob Groves
I'm not sure if it is a typo... but your have:

*  EMAIL_HOST = 'stmp.comp.nus.edu.sg '*Should 
that be:
*  EMAIL_HOST = 'smtp.comp.nus.edu.sg '*

On Saturday, September 19, 2015 at 7:49:56 AM UTC-4, Xin Ji wrote:
>
> I'm using apache + django + mod_wsgi to serve my app.
> My apache version is 2.4.7 and my django version is 1.8.4
>
> My django settings are:
>  * DEBUG=False*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *  ADMINS = [  ('username','user...@comp.nus.edu.sg '),  
> ]  MANAGERS = [  ('username','user...@comp.nus.edu.sg '),  
> ]  MIDDLEWARE_CLASSES = (  ...  
> 'django.middleware.common.BrokenLinkEmailsMiddleware',  )  EMAIL_HOST = 
> 'stmp.comp.nus.edu.sg '  EMAIL_PORT = 25  
> EMAIL_HOST_USER = 'username'  EMAIL_HOST_PASSWORD = 'password'*
>
> When I ran the server, I got this error on the website(This page uses the 
> django 500.html template.):
> Server Error *(500)* 
>
> There's been an error. It's been reported to the site administrators via 
> email and should be fixed shortly. Thanks for your patience.
>
> But I *didn't receive* any email about the error report.
>
> What's wrong with my configurations?
>

-- 
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/60dcfb20-779d-4e33-8994-8b1b3578fbc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Binding model data to a formset without POST

2015-01-23 Thread Rob Groves
Thanks for the reply Collin, and thanks for the warning about this being 
more complicated than it seemed at first.  I later discovered that I needed 
to set the hidden fields that contain the foreign and instance keys as 
well.  For completeness, the below code is working for me given the fact 
that I only have simple fields.

# helper functions
def bind_formset(formset):
"""
Bind initial data to a formset
"""
if formset.is_bound:
# do nothing if the formset is already bound
return formset

bindData={}
# the formset.get_default_prefix() and form.add_prefix() methods add in 
the 
# dict keys that uniquely identify the various form fields with the 
individual 
# instance data

# add formset management form data
bindData[formset.get_default_prefix()+"-TOTAL_FORMS"]=str(formset.
management_form['TOTAL_FORMS'].value())
bindData[formset.get_default_prefix()+"-INITIAL_FORMS"]=str(formset.
management_form['INITIAL_FORMS'].value())
bindData[formset.get_default_prefix()+"-MIN_NUM_FORMS"]=str(formset.
management_form['MIN_NUM_FORMS'].value())
bindData[formset.get_default_prefix()+"-MAX_NUM_FORMS"]=str(formset.
management_form['MAX_NUM_FORMS'].value())
for form in formset:
if form.instance:
# field data, get these values from the instance
for fieldName,fieldValue in form.fields.iteritems():
try:
bindData[form.add_prefix(fieldName)]=getattr(form.
instance,
 fieldName)
except AttributeError:
# this is an added field (i.e. DELETE), not derived 
from the
# model, do nothing with it, since we are only binding 
instance
# data to the form
pass
# hidden field data, get these from the field initial values set
# when the form was created
for field in form.hidden_fields():
bindData[form.add_prefix(field.name)]=field.field.initial
# create a new bound formset by passing in the bindData dict, this looks
# to the formset constructor like a request.POST dict 
newFormset=formset.__class__(bindData,instance=formset.instance,
 error_class=formset.error_class)
return newFormset



On Thursday, January 22, 2015 at 8:36:08 PM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> Interesting. I've never heard of someone wanting to show validation errors 
> on the initial data when the page first loads.
>
> I have however wanted to manually bind data to a form before. Last time I 
> checked it's not super trivial, because you could for instance have a 
> SplitDateTimeWidget which actually expects _two_ keys in the bound data.
>
> If you're just doing basic fields, that should work. If you're doing 
> anything more complicated, it might make sense to run the validation more 
> by hand. If you could call field.clean() on the less raw data you could 
> skip widgets and prefixes all together.
>
> Collin
>
> On Tuesday, January 20, 2015 at 8:06:06 AM UTC-5, Rob Groves wrote:
>>
>> Hi All,
>> I am new to Django and am enjoying it very much.  Excellent 
>> documentation, tutorials, and general environment to work in.  Good job 
>> Django developers!
>>
>> I have a question on binding data to a ModelFormset.  I have looked 
>> extensively and not seen this particular issue covered before.
>>
>> I have a ModelFormset that I send to a template for custom rendering so I 
>> can present the fields in a controlled tabular format.  The ultimate goal 
>> is to use CSS to create a red bounding box around any fields with 
>> validation errors and to set the "title" attribute of those input fields so 
>> that the user can see what errors were generated  by hovering over the red 
>> bounded field.  This presents a nice clean interface when there are 
>> errors.  It all works great, with one annoyance if the model data starts 
>> out with values that will generate validation errors (i.e. missing required 
>> data).  
>>
>> I initially call the view with a GET, which creates the forms and 
>> populates the form fields.  Since the data is not bound to forms at this 
>> point, I can't validate and set the errors.  In order to validate the 
>> fields and set the table error borders, I have to submit the form using 
>> POST to bind the data, validate the form and generate the errors which 
>> ultimately set an error_class for styling the table.  This means that I 
>> have to "save" the from from my form page to get the table style I want.
>>
>> What I really want is 

Binding model data to a formset without POST

2015-01-20 Thread Rob Groves
Hi All,
I am new to Django and am enjoying it very much.  Excellent documentation, 
tutorials, and general environment to work in.  Good job Django developers!

I have a question on binding data to a ModelFormset.  I have looked 
extensively and not seen this particular issue covered before.

I have a ModelFormset that I send to a template for custom rendering so I 
can present the fields in a controlled tabular format.  The ultimate goal 
is to use CSS to create a red bounding box around any fields with 
validation errors and to set the "title" attribute of those input fields so 
that the user can see what errors were generated  by hovering over the red 
bounded field.  This presents a nice clean interface when there are 
errors.  It all works great, with one annoyance if the model data starts 
out with values that will generate validation errors (i.e. missing required 
data).  

I initially call the view with a GET, which creates the forms and populates 
the form fields.  Since the data is not bound to forms at this point, I 
can't validate and set the errors.  In order to validate the fields and set 
the table error borders, I have to submit the form using POST to bind the 
data, validate the form and generate the errors which ultimately set an 
error_class for styling the table.  This means that I have to "save" the 
from from my form page to get the table style I want.

What I really want is to instantiate a ModelFormset, setting the instance, 
but then to bind the data present in the instance and set errors by sending 
is_valid() to the formset before rendering (i.e. on initial page rendering 
with the GET, so no POST data).  It seemed to me that there should simply 
be a bind_instance() function for all ModelFormsets that contain an 
instance.  I looked and didn't find that.  Eventually, I just decided to 
bind the data myself manually using the following helper function:

# helper functions
def bind_formset(formset):
bindData={}
# add management form data
bindData[formset.get_default_prefix()+"-TOTAL_FORMS"]=str(formset.
management_form['TOTAL_FORMS'].value())
bindData[formset.get_default_prefix()+"-INITIAL_FORMS"]=str(formset.
management_form['INITIAL_FORMS'].value())
bindData[formset.get_default_prefix()+"-MIN_NUM_FORMS"]=str(formset.
management_form['MIN_NUM_FORMS'].value())
bindData[formset.get_default_prefix()+"-MAX_NUM_FORMS"]=str(formset.
management_form['MAX_NUM_FORMS'].value())
for form in formset:
if form.instance:
for fieldName,fieldValue in form.fields.iteritems():
try:
bindData[form.add_prefix(fieldName)]=getattr(form.
instance,fieldName)
except:
# this is an added field, not derived from the model
pass
newFormset=formset.__class__(bindData,instance=formset.instance,
  queryset=formset.queryset, error_class=
formset.error_class)
return newFormset

This works!  My question... Is this a reasonable approach?  Or did I just 
miss the obvious way of doing this?

Thanks for any help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To 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/ad0edd7f-b8ea-42c1-9d2f-4ef836bba703%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: Django website redesign launched

2014-12-17 Thread Rob


On Wednesday, December 17, 2014 8:39:21 AM UTC-5, Daniele Procida wrote:
>
>
> We'd hate you to be "that guy" too. However, so far you are "that guy", 
> since merely announcing that you have identified numerous accessibility 
> issues is useless. 
>

Ok.  Tell the designer to google "chrome accessibility tester 
extension" and install the first match.

It will then flag the places where the Web Content Accessibility Guidelines 
are not being followed; http://www.w3.org/TR/WCAG/#visual-audio-contrast

The repository is  >.
>  
> It's all open. If you're able to suggest or make improvements, you know 
> what to do if you want to stop being "that guy". 
>

I'm not a designer.  I can't make good suggestions on how to improve 
things, since I would most definitely make it worse.
 

-- 
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/279b3513-5c92-4ec6-a878-932e6be58f79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: Django website redesign launched

2014-12-17 Thread Rob
On Tuesday, December 16, 2014 5:58:00 PM UTC-5, Christian Schmitt wrote:
>
> Somehow I hate it. The website is the worst website I've seen since a long 
> time.
> The contrast is really aweful.
> The issue Tracker got unusable due to the colors that aren't focused on 
> readability.
>

Clearly.  My audit extension flags 47 contrast problems on the home page 
alone.  The site is not very accessible contrast wise.

Doesn't look like a designer or a graphic guy had his hands on that.
>

It clearly had a designer,  but they don't grok usability.

I hate to be "that guy" but this is not really an improvement other than it 
works on mobile now ...

-- 
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/4491aa9f-9b06-4295-9411-57b9879271b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django setup with elsatic beanstalk

2014-07-11 Thread Rob
  gmail.com> writes:

> 
> 
> I'm having a similar problem - I don't see errors from the 
EB console - but django is not loaded I 
still get the standard AWS EB page.I have tried editing settings.py 
and app.config according to this 
tutorial:http://docs.aws.amazon.com/elasticbeanstalk
/latest/dg/create_deploy_Python_django.htmla
nd have tried many variations. If anyone has 
gotten this working from a windows machine - I would 
appreciate the help.ThxOn Monday, October 8, 
2012 7:22:51 PM UTC+2, shlomi oberman wrote:
> I'm trying without succes to setup a simple 
application using django with elastic beanstalk from my 
windows machine.Does anyone have any 
expreience with this? I am currently getting the following 
error from the EB console: "Your 
WSGIPath refers to a file that does not exist."
> 
> 
> 
> 
> 


Did you ever solve this problem? I'm experiencing the same thing. 
I know the thread is a little old now. 

-- 
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/loom.20140712T012206-551%40post.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial to deploy (with install instructions) = django+gunicorn+nginx

2014-05-23 Thread Rob Skidmore
Glad I could help.


On Fri, May 23, 2014 at 3:49 PM, Jonathan Querubina
<john.chro...@gmail.com>wrote:

> I have tryied a lot of them, and this one was the salvation
>
>
> http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
>
> Thanks Rob!
>
> On May 23, 2014, at 12:17 PM, carlos <crocha09...@gmail.com> wrote:
>
> Hi, Digital Ocean have many tutorial
> begginner :
> https://www.digitalocean.com/community/articles/how-to-deploy-a-local-django-app-to-a-vps
> advanced:
> https://www.digitalocean.com/community/articles/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn
>
> Cheers
>
>
> On Fri, May 23, 2014 at 8:04 AM, Rob Skidmore <robskidmor...@gmail.com>wrote:
>
>> Found this after a digging for a bit. Might help.
>>
>>
>> http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
>>
>>
>> On Friday, May 23, 2014 4:36:23 AM UTC-6, Jonathan Querubina wrote:
>>
>>> Hi guys, i am on my first deploy and loosing my hair over this.
>>>
>>> Could anyone send me a tutorial on how to make this deploy?
>>>
>>> I am on DigitalOcean, but their tutorial doesnt work, even if i use all
>>> the same configuration, virtualenv names and so on…
>>>
>>> Thanks guys!
>>>
>>>
>> --
>> 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/050612a2-c67b-4835-8a04-7bcd269b831d%40googlegroups.com<https://groups.google.com/d/msgid/django-users/050612a2-c67b-4835-8a04-7bcd269b831d%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM-7rO2fS-de9uxjg2rbQ2JqmCBuUmyzG8pmZ%3D5sw4uX%2BxGReQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAM-7rO2fS-de9uxjg2rbQ2JqmCBuUmyzG8pmZ%3D5sw4uX%2BxGReQ%40mail.gmail.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 a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/AAmQ0pOmPIw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/27FD68FB-B805-47C8-A793-5C8548E7C297%40gmail.com<https://groups.google.com/d/msgid/django-users/27FD68FB-B805-47C8-A793-5C8548E7C297%40gmail.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOXgxfght4tjRy81kR2TmvMYyrPmA9dC2%3DyUwfdgugL5ut%3Dr5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial to deploy (with install instructions) = django+gunicorn+nginx

2014-05-23 Thread Rob Skidmore
Found this after a digging for a bit. Might help.

http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

On Friday, May 23, 2014 4:36:23 AM UTC-6, Jonathan Querubina wrote:
>
> Hi guys, i am on my first deploy and loosing my hair over this. 
>
> Could anyone send me a tutorial on how to make this deploy? 
>
> I am on DigitalOcean, but their tutorial doesnt work, even if i use all 
> the same configuration, virtualenv names and so on… 
>
> Thanks guys! 
>
>

-- 
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/050612a2-c67b-4835-8a04-7bcd269b831d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I start with this project with django

2014-03-14 Thread Rob L
Hi, 

I hope this is a right place to ask, not very sure where to post on 
internet.
It's about planning a django project, maybe a similar django package has 
been already there, if it's true, I hope someone can tell me which it is.

The feature list of the project I am wishing to do is:

   - Let users upload some images(a folder contains image files)
   - Backend generates static htmls to present those images, basically as 
   a gallery, via an generated url
   - User can select from default themes(templates)
  - The template I am talking about here is not django template, they 
  are a bunch of xhtml, css and js files can be choose from default or 
  uploaded by user. 
   - User can upload and use their customized templates
  - I made a local Python program that can work for the purpose 
  here: https://github.com/viewplatgh/pgal, maybe can help you understand 
the 
  feature I am trying to implement on the django project
   - The workflow is quite similar to http://codepen.io, but what user 
   inputs are images, optionally templates, css and js files, rather than html 
   file itself. The htmls are generated by django app, and create a short url 
   for people who uploaded/built their resources to view the gallery.

I know this app don't have to be implemented by using django. I 
choose django because Python is the language I'm familiar with and it's the 
framework I have a little experience with, but to implement such a site I 
have so many questions and don't know where to start. I don't expect an 
exact answer to this post, but just hope to collect more helpful 
information, resources and ideas from experienced programmers to help me 
kick my project off...

Here is some questions in my mind currently:

   - Would django allow me to write a bunch of files at backend? 
   - Unlike php, django's urls don't map to server's folders. But I need 
   that feature to let user view the generated statics. How do I work through 
   this. Should I generate django templates?
   - How to prevent user from uploading malicious stuff to backend...

Any suggestions, ideas would be appreciated. Thanks! 

Thanks
Rob L

-- 
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/10a15408-3025-4e97-8276-f2ca8a17fbb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with deploying django using mod wsgi

2013-08-12 Thread Rob Ladd
It may be looking in html because it isn't getting the definition from the 
view method or class, so it's going with the default.
Try importing everything in views:
from webapp import views *

On Saturday, August 10, 2013 3:46:19 AM UTC-4, WongoBongo wrote:
>
> Is your form (on page /mice/search_mice/) submitting to
>
> /mice/search
>
> or
>
> /search
>
> Check your form element in the html document. Is it pointing to the right 
> URL?
>
> Maybe check your WSGIScriptAlias setting. Maybe verify your DocumentRoot 
> setting.
>
> You might also want to check the request and response using a tool like 
> HttpFox
>
> K
>
>
>
> On Thursday, August 8, 2013 6:10:34 AM UTC-7, sah wrote:
>>
>> I have this error in the error_log file :
>>
>>  [error] [client 10.10.8.41] File does not exist: /var/www/html/search, 
>> referer: http://tarinformatics03/mice/search_mice/
>>
>> search is one of my view function why is it looking for it in the html 
>> directory ??
>>
>

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




How to update a form in formwizard

2013-03-07 Thread Rob
I have a problem with formwizard. In step 3 of the wizard I use a filtered 
query which depends on choices from step 1 and 2. My wizard works fine when 
moving forward, but when a user presses previous, or changes the choices of 
step 1 and 2, things go wrong (validation error or filters won't work).

Here is my forms.py:
class BoekForm3(forms.Form):
Activiteit = forms.ModelChoiceField(queryset=Activiteit.objects.all(), 
empty_label="(Nothing)")

If I use queryset Activiteit.objects.none() in forms.py the correct fields 
in step3 of the wizard show up right, but the step3 always give a 
validation error.

If I use queryset Activiteit.object.all() in forms.py the correct 
(filtered) fields show up in step3 when going forward, and the form 
validates. However when a user presses previous in step4 the filter is 
gone, and all choices are available.

I think that the fields are updated moving to step3, but the form isn't. I 
have included my views.py below.

class BoekingWizard(SessionWizardView):
def get_template_names(self):
return [TEMPLATES[self.steps.current]]

def get_context_data(self, form, **kwargs):
plaatjes = Activiteitsgroepen.objects.all()
context = super(BoekingWizard, self).get_context_data(form=form, 
**kwargs)
if self.steps.current == 'step1':
context.update({'plaatjes': plaatjes})
return context

def get_form(self, step=None, data=None, files=None):
form = super(BoekingWizard, self).get_form(step, data, files)
if step == 'step3':
x = self.get_cleaned_data_for_step('step1') or {}
filter1 = x['Type_activiteit'].Groep
y = self.get_cleaned_data_for_step('step2') or {}
if y['Aantal_personen'] < 76:
filter2 = 'kleinere groepen'
elif y['Aantal_personen'] > 76:
filter2 = 'grotere groepen'
else:
filter2 = 'geen selectie'
reeks = ['1','2','3']
if y['Dagdeel'] in reeks:
filter3 = 'Dagdeel'
elif y['Dagdeel'] == '4':
filter3 = 'Hele dag'
elif y['Dagdeel'] == '5':
filter3 = 'Middag + Avond'
elif y['Dagdeel'] == '6':
filter3 = 'Dag + Avond'
form.fields['Activiteit'].queryset = 
Activiteit.objects.filter(Soort__Groep = filter1).filter(Grootte__Naam = 
filter2).filter(Dag__Omschrijving = filter3)
return form

I asked a similar question a few days back, but now it is much clearer to 
me were the problem must be, so I did a rephrase of my question.

Any help would be highly appreciated.

Rob

-- 
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: get_form in formwizard gives validation error

2013-03-07 Thread Rob
I am a bit further now. When I use the default widget in forms.py the 
validation error disappears. BoekForm3 becomes:
Activiteit = forms.ModelChoiceField(queryset=Activiteit.objects.all(), 
empty_label="(Nothing)")

I ran into another issue however (below is my complete view):
I use get_form to make a custom query. When I go forward in the wizard it 
runs as it should, all filters are applied. However when I use the previous 
step button, the filters won't work, and the user can select all options.

def get_form(self, step=None, data=None, files=None):
form = super(BoekingWizard, self).get_form(step, data, files)
if step == 'step3':
x = self.get_cleaned_data_for_step('step1') or {}
filter1 = x['Type_activiteit'].Groep
y = self.get_cleaned_data_for_step('step2') or {}
if y['Aantal_personen'] < 76:
filter2 = 'kleinere groepen'
elif y['Aantal_personen'] > 76:
filter2 = 'grotere groepen'
else:
filter2 = 'geen selectie'
reeks = ['1','2','3']
if y['Dagdeel'] in reeks:
filter3 = 'Dagdeel'
elif y['Dagdeel'] == '4':
filter3 = 'Hele dag'
elif y['Dagdeel'] == '5':
filter3 = 'Middag + Avond'
elif y['Dagdeel'] == '6':
filter3 = 'Dag + Avond'
form.fields['Activiteit'].queryset = 
Activiteit.objects.filter(Soort__Groep = filter1).filter(Grootte__Naam = 
filter2).filter(Dag__Omschrijving = filter3)
return form


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




get_form in formwizard gives validation error

2013-03-05 Thread Rob
In a formwizard I want to use a custom query, based on previous choices. 
The form renders well, but when the step is submitted I get an "Select a 
valid choice. That choice is not one of the available choices." error

Here is the get_form part in my views.py (simplified):

def get_form(self, step=None, data=None, files=None):
form = super(BoekingWizard, self).get_form(step, data, files)
if step == 'step3':
form.fields['Activiteit'].queryset = Activiteit.objects.all()
   return form

Here is the part from my forms.py:

class BoekForm3(forms.Form):
Activiteit = forms.ModelChoiceField(queryset=Activiteit.objects.none(), 
widget=forms.RadioSelect, empty_label=None)

Anybody an idea about this?

Rob

-- 
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: Q about wizard.form.forms

2013-02-24 Thread Rob Slotboom
Babatunde wrote:

It is satisfied when the step contains a formset



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




Q about wizard.form.forms

2013-02-22 Thread Rob Slotboom
Hi,

Django’s documentation shows a sample form wizard template.
In that template there is a conditional tag: {% if wizard.form.forms %}{% 
else %}
I can’t figure out when this condition will ever by met.

Does sombody have a clue?

Cheers and happy coding,

Rob

  

-- 
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: Custum save on Foreignkey in Admin

2013-02-04 Thread Rob van Dam | Camping het Wieskamp

Hi Pankaj,

I tested the code at it works perfectly. Thanks again!

I have one question out of curiosity (I don't need this for this 
project). When a ticketitem is deleted, def save_formset is called, but 
no instance is made, hence an error message "instance referenced before 
assignment"


What is the correct way to deal with this?

I don't need this for my current project, so if you don't answer it, it 
is no problem at all.


Regards,

Rob

On 04-02-13 18:50, Pankaj Singh wrote:

Yes, save_formset() has only those instances whose fields were changed.

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Mon, Feb 4, 2013 at 10:46 PM, Rob van Dam <r...@wieskamp.nl> wrote:

Hi Pankaj,

Thank you so much You have saved my day :-) I will be able to test it
tomorrow, and I will let you know if it worked.

I tested all my previous attempts saving an existing item in Admin. But when
nothing is changed in the admin form, def save_formset is not called......

Regards,

Rob



On 04-02-13 17:26, Pankaj Singh wrote:

Hey Rob,

I tested following code and it works.

 models.py

from django.db import models

# Create your models here.

class Ticket(models.Model):
  ticketnumber = models.IntegerField()
  total_amount = models.DecimalField(max_digits=7, decimal_places=2,
blank=True)

  def update_total_amount(self):
  total = 0
  for ti in self.ticketitem_set.all():
  total += ti.price * ti.amount
  self.total_amount = total
  self.save()

class TicketItem(models.Model):
  name = models.CharField(max_length=30)
  ticket = models.ForeignKey(Ticket)
  price = models.DecimalField(max_digits=7, decimal_places=2)
  amount = models.IntegerField()


 admin.py
from django.contrib import admin
from tickets.models import Ticket, TicketItem


class TicketItemInline(admin.TabularInline):
  model = TicketItem

class TicketAdmin(admin.ModelAdmin):
  inlines = [TicketItemInline,]

  def save_formset(self, request, form, formset, change):
  instances = formset.save(commit=False)
  for instance in instances:
  instance.save()
  formset.save_m2m()
  instance.ticket.update_total_amount()


admin.site.register(Ticket, TicketAdmin)


I hope it helps.

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Mon, Feb 4, 2013 at 9:01 PM, Rob van Dam | Camping het Wieskamp
<r...@wieskamp.nl> wrote:

Hi Pankaj,

I have tried many things today, but unfortunately I cannot get anything
working :-( Can you give me a bit more information on this issue? Any
hint
would be highly appreciated!

I cannot get anything saved in the database. For testing I made this
setup
(added ordernumber to the Tickets model):


class TicketAdmin(admin.ModelAdmin):
  def save_formset(self, request, form, formset, change):
  instances = formset.save(commit=False)
  for instance in instances:
  instance.ordernumber = 100
  instance.save()
  formset.save_m2m()

I expected the value 100 to be saved in the database....but nothing
works.

Rob




On 02-02-13 21:04, Pankaj Singh wrote:



http://stackoverflow.com/questions/8294889/override-save-on-django-inlinemodeladmin

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sun, Feb 3, 2013 at 1:34 AM, Pankaj Singh <ps.j...@gmail.com> wrote:

Hey Rob,

You can override save_formset() method of ModelAdmin for this. Create
a method update_total_amount(self) in your Ticket Model.

class TicketAdmin(admin.ModelAdmin):
   def save_formset(self, request, form, formset, change):
   instances = formset.save(commit=False)
   for instance in instances:
   instance.user = request.user
   instance.save()
   formset.save_m2m()

   ## call update_total_amount()
   instance.update_total_amount()

Useful Links -
1.

https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset
2.

https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sat, Feb 2, 2013 at 8:29 PM, Rob <r...@wieskamp.nl> wrote:

I have two models:

class Tickets(models.Model):
  ticketnumber = models.IntegerField()
  total_amount = models.DecimalField()

class TicketItems(models.Model):
  name = models.Charfield(max_length=30)
  ticket = models.ForeignKey(Tickets)
  price = models.DecimalField()
  amount = models.IntergerField()

I have an inline Adminpage were users can add TicketItems. How do I
update
the total_amount of model Tickets from all TicketItems on save (price
*
amount)?

Django 1.4

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

Re: Custum save on Foreignkey in Admin

2013-02-04 Thread Rob van Dam

Hi Pankaj,

Thank you so much You have saved my day :-) I will be able to test 
it tomorrow, and I will let you know if it worked.


I tested all my previous attempts saving an existing item in Admin. But 
when nothing is changed in the admin form, def save_formset is not 
called..


Regards,

Rob


On 04-02-13 17:26, Pankaj Singh wrote:

Hey Rob,

I tested following code and it works.

 models.py

from django.db import models

# Create your models here.

class Ticket(models.Model):
 ticketnumber = models.IntegerField()
 total_amount = models.DecimalField(max_digits=7, decimal_places=2,
blank=True)

 def update_total_amount(self):
 total = 0
 for ti in self.ticketitem_set.all():
 total += ti.price * ti.amount
 self.total_amount = total
 self.save()

class TicketItem(models.Model):
 name = models.CharField(max_length=30)
 ticket = models.ForeignKey(Ticket)
 price = models.DecimalField(max_digits=7, decimal_places=2)
 amount = models.IntegerField()


 admin.py
from django.contrib import admin
from tickets.models import Ticket, TicketItem


class TicketItemInline(admin.TabularInline):
 model = TicketItem

class TicketAdmin(admin.ModelAdmin):
 inlines = [TicketItemInline,]

 def save_formset(self, request, form, formset, change):
 instances = formset.save(commit=False)
 for instance in instances:
 instance.save()
 formset.save_m2m()
 instance.ticket.update_total_amount()


admin.site.register(Ticket, TicketAdmin)


I hope it helps.

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Mon, Feb 4, 2013 at 9:01 PM, Rob van Dam | Camping het Wieskamp
<r...@wieskamp.nl> wrote:

Hi Pankaj,

I have tried many things today, but unfortunately I cannot get anything
working :-( Can you give me a bit more information on this issue? Any hint
would be highly appreciated!

I cannot get anything saved in the database. For testing I made this setup
(added ordernumber to the Tickets model):


class TicketAdmin(admin.ModelAdmin):
 def save_formset(self, request, form, formset, change):
 instances = formset.save(commit=False)
 for instance in instances:
 instance.ordernumber = 100
 instance.save()
 formset.save_m2m()

I expected the value 100 to be saved in the databasebut nothing works.

Rob




On 02-02-13 21:04, Pankaj Singh wrote:


http://stackoverflow.com/questions/8294889/override-save-on-django-inlinemodeladmin

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sun, Feb 3, 2013 at 1:34 AM, Pankaj Singh <ps.j...@gmail.com> wrote:

Hey Rob,

You can override save_formset() method of ModelAdmin for this. Create
a method update_total_amount(self) in your Ticket Model.

class TicketAdmin(admin.ModelAdmin):
  def save_formset(self, request, form, formset, change):
  instances = formset.save(commit=False)
  for instance in instances:
  instance.user = request.user
  instance.save()
  formset.save_m2m()

  ## call update_total_amount()
  instance.update_total_amount()

Useful Links -
1.
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset
2.
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sat, Feb 2, 2013 at 8:29 PM, Rob <r...@wieskamp.nl> wrote:

   I have two models:

class Tickets(models.Model):
 ticketnumber = models.IntegerField()
 total_amount = models.DecimalField()

class TicketItems(models.Model):
 name = models.Charfield(max_length=30)
 ticket = models.ForeignKey(Tickets)
 price = models.DecimalField()
 amount = models.IntergerField()

I have an inline Adminpage were users can add TicketItems. How do I
update
the total_amount of model Tickets from all TicketItems on save (price *
amount)?

Django 1.4

--
You received this message because you are subscribed to the Google
Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an
email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups &quo

Re: Custum save on Foreignkey in Admin

2013-02-04 Thread Rob van Dam | Camping het Wieskamp

Hi Pankaj,

I have tried many things today, but unfortunately I cannot get anything 
working :-( Can you give me a bit more information on this issue? Any 
hint would be highly appreciated!


I cannot get anything saved in the database. For testing I made this 
setup (added ordernumber to the Tickets model):


class TicketAdmin(admin.ModelAdmin):
def save_formset(self, request, form, formset, change):
instances = formset.save(commit=False)
for instance in instances:
instance.ordernumber = 100
instance.save()
formset.save_m2m()

I expected the value 100 to be saved in the databasebut nothing works.

Rob



On 02-02-13 21:04, Pankaj Singh wrote:

http://stackoverflow.com/questions/8294889/override-save-on-django-inlinemodeladmin

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sun, Feb 3, 2013 at 1:34 AM, Pankaj Singh <ps.j...@gmail.com> wrote:

Hey Rob,

You can override save_formset() method of ModelAdmin for this. Create
a method update_total_amount(self) in your Ticket Model.

class TicketAdmin(admin.ModelAdmin):
 def save_formset(self, request, form, formset, change):
 instances = formset.save(commit=False)
 for instance in instances:
 instance.user = request.user
 instance.save()
 formset.save_m2m()

 ## call update_total_amount()
 instance.update_total_amount()

Useful Links -
1. 
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset
2. 
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset

Sincerely,
Pankaj Singh
http://about.me/psjinx


On Sat, Feb 2, 2013 at 8:29 PM, Rob <r...@wieskamp.nl> wrote:

  I have two models:

class Tickets(models.Model):
ticketnumber = models.IntegerField()
total_amount = models.DecimalField()

class TicketItems(models.Model):
name = models.Charfield(max_length=30)
ticket = models.ForeignKey(Tickets)
price = models.DecimalField()
amount = models.IntergerField()

I have an inline Adminpage were users can add TicketItems. How do I update
the total_amount of model Tickets from all TicketItems on save (price *
amount)?

Django 1.4

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Custum save on Foreignkey in Admin

2013-02-02 Thread Rob
Thank you for the reply!

I was working on a custom save in models.py, never thought about working on 
the formset in admin.py

Rob

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




Custum save on Foreignkey in Admin

2013-02-02 Thread Rob
 I have two models:

class Tickets(models.Model):
   ticketnumber = models.IntegerField()
   total_amount = models.DecimalField()

class TicketItems(models.Model):
   name = models.Charfield(max_length=30)
   ticket = models.ForeignKey(Tickets)
   price = models.DecimalField()
   amount = models.IntergerField()

I have an inline Adminpage were users can add TicketItems. How do I update 
the total_amount of model Tickets from all TicketItems on save (price * 
amount)?

Django 1.4

-- 
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: Button with save and custom action in Admin

2012-12-10 Thread Rob
I found a snippet which does everything I want (in case anybody runs into 
the same problem):
http://djangosnippets.org/snippets/2005/

-- 
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/-/2PnTxMJubekJ.
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.



Button with save and custom action in Admin

2012-12-10 Thread Rob
In Django 1.4 I am working on a small mailing app, and in the admin change 
page I would like to add a button called "send mailing". When the user 
presses the button the model should be saved first, en then redirected to a 
custom page to view and confirm the mailing before send.

I saw lots of snippets, custom actions etc. etc. but I cannot get it 
working. 

I have add a custom change_form.html in /templates/admin/myapp and 
succesfully added a button. But how do I "tell" Django to do the two 
actions?

When I add name="_save" to the button the model is saved after pressing the 
custom button, but now I need a redirect to a custom page using the currect 
model.

-- 
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/-/_31scvnqkRsJ.
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: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-24 Thread Rob
Sometimes the browser cache is making trouble too. Especially with Firefox 
I occasionally have this kind of problems. Clear the browser cache, or test 
with a different browser mostly helps.

-- 
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/-/igIQbm0y6yoJ.
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: Validation error with formwizard and formset

2012-07-21 Thread Rob
The validation error i got was due to a custom view i wrote, and had 
nothing todo my my template etc etc. I switched back to the default example 
view provided by the Django site, and everything works.

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



Validation error with formwizard and formset

2012-07-21 Thread Rob
I have a basic formwizard example from the Django 1.4 documentation:
https://docs.djangoproject.com/en/1.4/ref/contrib/formtools/form-wizard/

When I replace the forms with a modelform and a formset i keep getting 
validation errors: 
(ManagementForm data is missing or has been tampered with)

The documentation says:
WizardView supports 
*ModelForms*and 
*ModelFormSets*.
 
Additionally to 
initial_dict,
 
the as_view() method takes an instance_dict argument that should contain 
instances of ModelForm and ModelFormSet. Similarly to 
initial_dict,
 
these dictionary key values should be equal to the step number in the form 
list.

Could anybody provide me with an example? Does the validation error have 
something to do with the instance_dict?

Let say i have these forms:
class Address(models.Model):
street = models.CharField(max_length=20)

class AddressForm(ModelForm):
class Meta:
model = Address

class OrderForm(forms.Form):
Order = forms.ModelChoiceField(queryset=Article.objects.all())

OrderFormset = modelformset_factory(Order)

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



Redirect form after post, and download pdf

2012-06-07 Thread Rob
This is probably very easy, but i cannot get this working (Django
1.2).

I want to generate a pdf based on the values of a form, and redirect
the form to a thanks page.

Generating the pdf is no problem, but first generate the pdf to
download, and after that redirect the form the the thanks page doesn't
work at all (because the view "stops" after the return).

Any idea?

Rob

-- 
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: filter cache output

2011-07-15 Thread Rob
On Jul 15, 8:57 pm, Nan  wrote:
> Well, you can use one of the methods from [2] to force the queryset to
> evaluate before caching it.  But you'll still run a new query in order
> to filter, unless you aftually filter the data in your Python code.

Very clear, thanks!

-- 
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: filter cache output

2011-07-15 Thread Rob
On Jul 15, 8:34 pm, Nan  wrote:
> Querysets are evaluated lazily.[1][2]  You may have better success
> using template fragment caching[3] to cache the menu output.
>

Thanks for the reply.

I read the part about the "lazy" querysets and therefore I suspected
the database not to be hit. This also doesn't count for querysets from
a cache. Perhaps I should turn of caching for the menu (are only a few
items)

Unfortunately template caching is no option for me, because the menu
items depend on a session.

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



filter cache output

2011-07-15 Thread Rob
I have setup caching with memcached for my site. This works well
except from this part of my view. My idea was to store all menu items
in the cache, and apply a filter later on to decide if they belong to
the left or top menu.


menu = cache.get(menu_cache_key)
if menu:
menu_left = menu.filter(menu_left = True)
menu_top = menu.filter(menu_top = True)

I thought that apply the .filter() on the menu would not cause a query
on the database, but it does. So the menu is retrieved from the cache,
and after that the menu items are retrieved from the database (which
makes the caching useless). I found out about this because changes in
the menu are applied immediately on the webpage.

Is this normal behaviour, and should I make multiple entries into the
cache for the left- and topmenu, or is there a way to get this
working?

Rob

-- 
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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Rob
Well that worked but I'm not happy about it.  I have the following:

from logging.handlers import SysLogHandler

...

'syslog':{
'level':'DEBUG',
'class': 'logging.handlers.SysLogHandler',
'formatter': 'verbose',
'facility': SysLogHandler.LOG_LOCAL2,
},

If I specify 'class' as SysLogHandler instead of
'logging.handlers.SysLogHandler' I get an error:

ValueError: Unable to configure handler 'syslog': class SysLogHandler
has no attribute 'split'

If I just import logging and use
logging.handlers.SysLogHandler.LOG_LOCAL2 I get another error:

AttributeError: 'module' object has no attribute 'handlers'

Very bizarre behaviour all around but I'm up and running.  Thanks for
everybody's help!

On Jun 3, 11:14 am, Piotr Zalewa <zal...@gmail.com> wrote:
> In Add-ons Builder I've got something like this in log_settings.py
>
> https://github.com/mozilla/FlightDeck/blob/master/log_settings.py
>
>      'handlers': {
>          'syslog': {
>              '()': logging.handlers.SysLogHandler,
>              'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,
>              'formatter': 'prod',
>          },
>      }
>
> It depends on the commonware, but I guess it's nothing there regarding
> logging to the SysLoghttps://github.com/jsocol/commonware/
>
> Good luck
> zalun
>
> On 06/03/11 16:02, Rob wrote:
>
>
>
> > Thanks, but this doesn't help at all.  I have no problem getting the
> > RotatingFileHandler working, it is documented albeit poorly, but the
> > SysLogHandler isn't documented at all and doesn't work the same way.
>
> > The SysLogHandler actually has to connect to syslogd and log to a
> > syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
> > those
> > options?
>
> > Rob.
>
> > On Jun 1, 12:41 pm, Shawn Milochik<sh...@milochik.com>  wrote:
> >> This should help out. It's for a file, not SysLogHandler, but the idea
> >> is the same.
>
> >> Just take any arguments you would normally pass to the handler if you
> >> were creating it programmatically and add them as keys to the dictionary:
>
> >>           'log_file': {
> >>               'level': 'DEBUG',
> >>               'class': 'logging.handlers.RotatingFileHandler',
> >>               'filename': '/tmp/myfilename.log',
> >>               'formatter': 'verbose',
> >>               'backupCount': 50,
> >>               'maxBytes': 2 ** 20,
> >>           },
>
> >> As demonstrated here, filename, backupCount, and maxBytes (used by the
> >> RotatingFileHandler but not in Django's default logging dict) were just
> >> added and given values. Do the same for SysLogHandler parameters and it
> >> should work.
>
> >> I had the same difficulty you were having in figuring this out; we
> >> should update the documentation to mention this. I'll open a ticket.
>
> >> Shawn

-- 
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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Rob
Thanks, but this doesn't help at all.  I have no problem getting the
RotatingFileHandler working, it is documented albeit poorly, but the
SysLogHandler isn't documented at all and doesn't work the same way.

The SysLogHandler actually has to connect to syslogd and log to a
syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
those
options?

Rob.

On Jun 1, 12:41 pm, Shawn Milochik <sh...@milochik.com> wrote:
> This should help out. It's for a file, not SysLogHandler, but the idea
> is the same.
>
> Just take any arguments you would normally pass to the handler if you
> were creating it programmatically and add them as keys to the dictionary:
>
>          'log_file': {
>              'level': 'DEBUG',
>              'class': 'logging.handlers.RotatingFileHandler',
>              'filename': '/tmp/myfilename.log',
>              'formatter': 'verbose',
>              'backupCount': 50,
>              'maxBytes': 2 ** 20,
>          },
>
> As demonstrated here, filename, backupCount, and maxBytes (used by the
> RotatingFileHandler but not in Django's default logging dict) were just
> added and given values. Do the same for SysLogHandler parameters and it
> should work.
>
> I had the same difficulty you were having in figuring this out; we
> should update the documentation to mention this. I'll open a ticket.
>
> Shawn

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Rob
I spent a few seconds looking for the X to close the sign up panel
before
seeing this:

"LOCQL is a social Q service, so we need you to sign in instead of
browse anonymously."

But I *always* browse anonymously first to see if a site is something
I want to use and/or trust with any info about me; if I like it I
will sign up.

I'd like to provide feedback but the first thing you want me to do,
before even looking at the site, is give you my facebook info?
Ummm ... no.  So the only feedback I have is get rid of that "*we're*
social so *you* have to share" attitude.

Rob.

On Jun 2, 3:02 am, maverick <zhihong@gmail.com> wrote:
> We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> and run on GAE has just went live!
>
> I would say development with Django is purely enjoyable experience,
> however the Google Apps Engine does bring us some headache esp. we are
> a location based service, the geo-location related search is a
> challenge for us.
>
> I would like everyone who use Django to give us a try and feedback are
> warmly welcome!

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



Seeking a Django 1.3 and syslog configuration example

2011-06-01 Thread Rob
I'm having no luck finding any information on setting up syslog
logging with Django 1.3 dictionary configuration. The Django documents
don't cover syslog and the python documentation is less than clear and
doesn’t cover dictionary config at all. I've started with the
following but I'm stuck on how to configure the SysLogHandler.

LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %
(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'syslog':{
'level':'DEBUG',
'class':'logging.handlers.SysLogHandler',
'formatter': 'verbose'
},

},
'loggers': {
'django': {
'handlers':['syslog'],
'propagate': True,
'level':'INFO',
},
'myapp': {
'handlers': ['syslog'],
'propagate': True,
'level': 'DEBUG',
},
},
}

-- 
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: Example uses of Celery

2011-05-24 Thread Rob
I use celery for the following:

1. Expensive tasks that you don't want the user waiting on.  For
example: sending messages;
   we have triggers for SMS, Email and iPhone APN messages.  I don't
want the request/response
   waiting around while I do all of that.
2. Tasks that could fail and need to be retried.  For example:
updating settings on
   the backend, you don't need complicated retry logic.
3. Replacement for cron.  The biggest issue with cron is that it is
single server.
   Once I switched to celery I don't care which processing server
launches the task.

On May 23, 9:49 pm, br  wrote:
> I understand a lot of production systems use celery and/or cron to
> automate task queues and/or scheduling.  I am just getting involved in
> a startup and will be the go-to guy for tech stuff and am interested
> in what types of tasks people use Celery (or a celery-like platform)
> for so that when similar types of things come up in my company, I'll
> think of it first.    I've read through the manuals a bit, but its
> mostly technical and implementations.  I'd like some examples to
> analogize to and then I can apply the code  when stuff comes up.    I
> realize Celery isn't a django-specific tool, but it seems to go hand
> and hand a lot of times and we are building our platform in django.
>
> Thanks,
>
> br

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



HTML size confusion.

2011-03-04 Thread Rob
Hi there,

In my ModelForm I have a fields like this:

argument= models.CharField (max_length=50, blank=True)
media   = models.CharField (max_length=50, choices =
getChoices ('media'))

For the 'media' field, the max_length results in a HTML select such
as:


  -
  monkey.png
  shu-eumura-lcd.mpg


The problem here is that the max_length attribute has been passed to
the  size, which results in a very large select control. If
max_length specifies the database storage size, why is it also used as
the size attribute to ?  (Or rather: what am I doing wrong
here?)

I'm using django 1.2.1.

Cheers!

Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django cache created in one function not available to another?

2011-01-29 Thread Rob Hudson
This sounds similar to this bug :
http://code.djangoproject.com/ticket/15149

On Jan 28, 8:02 am, Lance Vick  wrote:
> So I have a function that sets cache (and successfully outputs it):
>
> def push_cache:
>     cache.set('foo_cache', 'FUBAR!!!')
>     foodata = cache.get('foo_cache')
>     print(foodata) # this works
>
> However when I try to access that cache from within a view and
> directly output it it returns None:
>
> def fetch_cache(request):
>     cache_data = cache.get('foo_cache')
>     return HttpResponse(cache_data) #this does not work.
>
> Am i misunderstanding something fundamental in how cache works?
>
> I am using the memcached backend in django 1.2.3

-- 
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: File Uploads Form Field "title" Questions

2011-01-27 Thread Rob McQueen
I think this is trivial considering that the example does not use
request.POST['title'] They must of just forgot to use the title field in the
view?

One practical example could be to use the title as the filename which you
intend to store in your filesystem. You can do this by changing the filename
of the file object to the "title" string you stored in the request. This
would be done in a view method.

-Rob

On Thu, Jan 27, 2011 at 10:53 AM, hank23 <hversem...@stchas.edu> wrote:

> I'm trying to code and implement a file upload screen. I've looked at
> the documentation at:
>
> http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/
>
> and the document shows a simple upload form called UploadFileForm
> which is shown with two fields coded for it. I'm assuming that the
> field named "file" of type forms.FileField is just the file
> itself(location, name, and data), but if so what's the "title" field
> of type forms.CharField used for and how is it processed? I don't
> think it's mentioned at all in the documentation except for being
> shown to be part of the form. Can someone please explain its use and
> how it should be processed? Thanks.
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Robert McQueen
Massachusetts Institute of Technology
Class of 2012, Course 6.3 - Computer Science

rmcqu...@mit.edu

-- 
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: what am I doing wrong?

2011-01-25 Thread Rob McQueen
Is there a reason why you inherit from forms.Form, but not forms.ModelForm ?
Is it successfully finding ModelForm without the reference to forms?

-Rob

On Tue, Jan 25, 2011 at 12:41 PM, MikeKJ <mike.jo...@paston.co.uk> wrote:

>
> class CertForm(forms.Form):
>agree = forms.BooleanField(required=True, label="I confirm the above and
> agree.")
>cert = forms.BooleanField(required=False, label="I require a
> certificate")
>
> class UserAccountForm(ModelForm):
>class Meta:
>model = UserAccount
>
> class VideoAccountForm(ModelForm):
>class Meta:
>model = VideoAccount
>
> def certificate(request, id):
>if not request.user.is_authenticated():
>return HttpResponseRedirect('/user/login/')
>person = request.user
>check = UserProfile.objects.get(username=person)
>if check.approved_member and check.gp:
>part_vid = Part.objects.get(pk = id)
>cost = round((part_vid.runtime/60)*10,2)
>if request.POST:
>form = CertForm(request.POST)
>userform = UserAccountForm()
>videoform = VideoAccountForm()
>if form.is_valid():
>//normal form.cleaned_data stuff
>// userform
> data = {'user_id': 'check.id',
>'user_name': 'check.name',
>'user_email': 'check.email',
>'video_id': 'part_vid.id',
>'video_name': 'part_vid.title',
>'video_time': 'part_vid.runtime',
>'video_cost': 'cost'
>   }
>userform.save(data)
>// videodata
>vdata = {'video_id': 'part_vid.id',
> 'video_name': 'part_vid.title',
> 'video_time': 'part_vid.runtime',
> 'video_cost': 'cost',
> 'lecturer_id': 'k',
> 'lecturer_name': 'lecturer_name'
>}
>videoform.save(vdata)
>
>return HttpResponseRedirect(reverse('video.views.play_vid',
> args=(cat_id, this_vid_id,)))
>else:
>form = CertForm(request.POST)
>
> all the stuff in data and vdata is derived from query sets prior to the
> form
>
> Q
> 1 Why am I getting "'UserAccountForm' object has no attribute
> 'cleaned_data'"
> 2 If I use if userform.is_valid() then userform is invalid in any case
> 3 Just save the data given to another model 'Accounts' is all I want it to
> do but it has to be done in here as this is where the agree is done
> --
> View this message in context:
> http://old.nabble.com/what-am-I-doing-wrong--tp30760259p30760259.html
> Sent from the django-users mailing list archive at Nabble.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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Robert McQueen
Massachusetts Institute of Technology
Class of 2012, Course 6.3 - Computer Science

rmcqu...@mit.edu

-- 
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: main categories in menu

2010-12-04 Thread Rob


> It sounds like you have 3 views, and each one can pick from a pool of
> categories.  If this is correct, all you need to do is enter a line
> for each view (main#), and pass the category (page#) as a variable to
> the view, which can then do the lookup.  You will use something like:
>
Thanks for the reply.

The Problem is that I want to fetch a list of categories from the
database, so the amount of categories could vary. I could add them
manually to urls.py but that's not my preferred way.

So if a user enters mydomain.com/main1/page1 --> check if main1 exists
in the database --> render a menu of all pages which are linked to
main1 --> show page1

Rob

> r'^main1/\w+/$'
>
> which will pass all characters matching the regex (here, alphanumeric
> chars) to the view you specify as a positional arg.  You can also pass
> them as a kwarg.  Read here:  
> http://docs.djangoproject.com/en/dev/topics/http/urls/
>
>
>
> > Is there a way to do something like: (r'^(.*)/(.*)/$', view), (I know
> > this doesn't work)
>
> To do something like that, instead of wildcarding everything greedily,
> just pass a range of characters and symbols you will not accept
> (whitespace, etc.) by using [^don't_accept_these] in your regex.

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



main categories in menu

2010-12-03 Thread Rob
I want to make main categories on my site like:
/main1/page1
/main2/page2
/main3/page3

I would like to make those categories dynamically with a m2m . In that
case I can assign pages to one or more main categories.

I have a problem now with urls.py As far as I know I can only "catch"
one variable like:
(r'^main1/(.*)/$', view), In this way I have to add every main
category manually to urls.py

Is there a way to do something like: (r'^(.*)/(.*)/$', view), (I know
this doesn't work)

Or should I catch everything from the url and try to split the url in
the view?
(r'^(.*)$', view),

A consideration I have that I will end up having double content (which
is bad for Google). Is it also an option to remember the choice made
in a session, and render the menu on page load (through middleware)?



Rob

-- 
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: inheriting User class

2010-10-24 Thread Rob
Probably most of us are using the separate profile model, as
recommended.

I actually have multiple models associated with users on one project:

User (from auth)
UserInfo (things rarely accessed such as address, emergency contact
info, etc.)
UserProfile (my application specific profile)

I'm going to break UserProfile into EmployeeProfile and StudentProfile
at some point or keep UserProfile add the other two profile types.
Depends on how looking into Django model polymorphism goes :-)

I prefer the separation of profile and login in my case.  Many
students do not want or need logins to the system.




On Oct 24, 6:32 am, Miguel Araujo  wrote:
> ¿no one knows anything about this?
>
> Thanks, regards
> Miguel Araujo
>
> 2010/10/22 Miguel Araujo 
>
>
>
>
>
>
>
> > Hello everyone,
>
> > I'm not very aware about what's the direction Django is taking about the
> > User model and making it swappable. Meanwhile I would like to ask if
> > inheriting the User class is advisable or not. As I have read many places
> > obscure bugs can happen and my code will be in production.
>
> > I'm using now an AUTH_PROFILE_MODULE at the moment, but I don't realy like
> > this approach, as it makes my class hierarchy more complicated.
>
> > Thanks, best regards
> > Miguel Araujo

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



form model def save question

2010-09-06 Thread Rob B (uk)
Been struggling over at 
http://stackoverflow.com/questions/3652585/simple-django-form-model-save-question
to get a solution.

I want the inuse field to update to to True when LocationForm is
saved.  For example there would be a list of locations added by the
admin (London, New York and Paris) all with inuse of False.  The user
would select London and submit the form and the inuse field for London
would become True.

Models and forms:

class Location(models.Model):
place = models.CharField(max_length=100)
inuse = models.BooleanField()
class Meta:
ordering = ('place', 'id')

def __unicode__(self):
return self.place

class LocationForm(ModelForm):
class Meta:
model = Location

class Booking(models.Model):
name = models.CharField(max_length=100, verbose_name="Your
name*:")
place = models.ManyToManyField(Location, blank=True, null=True)

def __unicode__(self):
return self.name

class BookingForm(ModelForm):

class Meta:
model = Booking

def save(self, commit=True):
booking = super(BookingForm, self).save(commit=False)
if commit:
booking.save()
for location in booking.place.all():
location.inuse = True
location.save()


Code saves fine but the location.inuse field is not saved to True.
Any ideas where I'm going wrong?

-- 
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: www.djangoproject.com

2010-07-01 Thread Rob Broadhead

Works fine for me.

On Jul 1, 2010, at 12:40 PM, FC wrote:


I can't access www.djangoproject.com from Buenos Aires, Argentina.
Firefox says: "The connection has timed out"

Is anyone else having problems?

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




Rob Broadhead
robert.broadh...@gmail.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-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: Error in form validation with choices

2010-06-13 Thread Rob
Thanks for starting this thread ... just hit this myself porting to
1.2.1 from 1.1.1 ...

On May 18, 4:38 pm, Jori  wrote:
> Thanks, you're correct. I don't know how I didn't notice but then
> again it worked just fine with 1.1.1.
>
> -Jori

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



Best intranet solution for a small digital agency?

2010-06-07 Thread Rob B (uk)
I work for a small digital agency (10-15 employees).  We design and
build websites (using php and Django).  Are we better off building our
own intranet using django or going for a pre built (free or paid for)
solution?

Key features needed:

 - Project management (basecamp clone)
 - Time reporting
 - Local and external file sharing (dropbox clone)

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



override a form field, to allow usernames with '@'

2010-05-02 Thread Rob
Hi,

I'm trying to allow usernames that have '@' in them, so they can just
be email addresses.  Maybe this is a bad idea.  ...  But putting that
aside for a second... The admin user forms don't validate with '@' in
usernames, so I thought I'd try this, which I copied from an older
post in this group.

from django.contrib.auth.admin import User, UserChangeForm,
UserCreationForm, UserAdmin

class OurUserChangeForm(UserChangeForm):
username = forms.EmailField

class OurUserCreationForm(UserCreationForm):
username = forms.EmailField

admin.site.unregister(User)
UserAdmin.form = OurUserChangeForm
UserAdmin.add_form = OurUserCreationForm
admin.site.register(User, UserAdmin)

But it doesn't work.  The user form is still validating with the
'username' from the superclass, which is a RegexField.  Is this
working as designed?  Are you not allowed to override a field?

thanks,
Rob

-- 
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: OS X install, not in home directory?

2010-04-28 Thread Rob
Doh!  Problem solved...  I had created a ~/.pydistutils.cfg file a
couple weeks ago, for some stupid reason I can't remember.  I forgot
to delete that file.  It's contents were:

[install]
install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/bin

So it was overriding the normal setup.py behavior.

Rob

-- 
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: Getting a Blog included in the Django community aggregator

2010-04-27 Thread Rob
By strange coincidence, I sent an email to Jacob earlier today
requesting that my blog be included in the Django community
aggregator.

I had a suspicion that this type of situation might arise, as I expect
many are doing the same.

My blog address is http://www.robgolding.com/blog and the RSS feed for
Django is http://www.robgolding.com/blog/feed/?tag=django. It would be
really great if my content could be included :).

Thanks,
Rob Golding

On Apr 21, 9:32 am, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:
> On Wed, Apr 21, 2010 at 4:28 PM, Daniel Roseman <dan...@roseman.org.uk> wrote:
> > On Apr 20, 3:36 pm, Russell Keith-Magee <freakboy3...@gmail.com>
> > wrote:
> >> Obviously this isn't an isolated problem - I'll see what I can do
> >> about changing the advice on the community page so that Jacob's inbox
> >> doesn't become a bottleneck.
>
> >> Yours,
> >> Russ Magee %-)
>
> > Without wishing to pile on, I'm in exactly the same situation - a
> > couple of emails to Jacob have gone unanswered. My blog is at
> >http://blog.roseman.org.ukand the RSS feed for the Django tag is at
> >http://blog.roseman.org.uk/feeds/tags/django/
>
> Done. Apologies for the lack of replies.
>
> 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: OS X install, not in home directory?

2010-04-27 Thread Rob

Thanks, but none of those suggestions seem to work.  I'm not going to
worry about this since I've got too many other things to do, (plus I'm
in China and so to read a google group I have to use a proxy/tunnel),
but for the record here's some more info...

I think I'm using the system python...

RobsMac-2 Django-1.1.1 $ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python

--prefix is having no effect, but I'm not sure what to set it to given
the OS X directories...

RobsMac-2 Django-1.1.1 $ sudo python setup.py install --prefix=/
Library/Frameworks/Python.framework/Versions/2.6
running install
...
Removing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
py2.6.egg-info
Writing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
py2.6.egg-info

So it put in my home dir.  Same with --prefix=/Library/Python/2.6.

Using --install-base does produce this error...

RobsMac-2 Django-1.1.1 $ sudo python setup.py install --install-base=/
Library/Python/2.6
running install
error: install-base or install-platbase supplied, but installation
scheme is incomplete

PYTHONPATH is nothing.


Rob


On Apr 26, 11:22 pm, Bill Freeman <ke1g...@gmail.com> wrote:
> Are you running setup using the system python, or a separate one tied
> to your account (such as in a virtual env)?  If the latter then try specifying
> the full path to the system python to run setup.  Also, if you have the
> PYTHONPATH environment variable set, you might try unsetting it while
> running the install.  (You can do this in a subshell and not affect other
> operations.)
>
> Bill
>
>
>
> On Sat, Apr 24, 2010 at 9:36 AM, pjmorse <flashesofpa...@gmail.com> wrote:
> > On Apr 24, 3:03 am, Rob <rob.nikan...@gmail.com> wrote:
> >> Maybe this is more of a general python question, but when I run `sudo
> >> python setup.py install` it insists on putting the django package in ~/
> >> Library/Python/2.6/site-packages.  I want to install it in the system
> >> site-packages, so it get's picked up by apache and mod_wsgi.  For now
> >> I'll hand copy the files, but there must be a way with setup.py.  ?
>
> > Try the --prefix or --install-base options to `setup.py install`.
> > `python setup.py install --help` will run down the options for you; I
> > think --prefix=/Library/Python/2.6/site-packages/ is worth a shot?
>
> > pjm
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



OS X install, not in home directory?

2010-04-24 Thread Rob
Hi,

Maybe this is more of a general python question, but when I run `sudo
python setup.py install` it insists on putting the django package in ~/
Library/Python/2.6/site-packages.  I want to install it in the system
site-packages, so it get's picked up by apache and mod_wsgi.  For now
I'll hand copy the files, but there must be a way with setup.py.  ?

thanks,
Rob

-- 
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: Template translation

2010-04-15 Thread Rob Charlwood
If anyone is curious,

We some mega help from the man in the know (Dan Hilton) I have managed
to write a snippet to handle this functionality.

You can find it here!

http://www.djangosnippets.org/snippets/1985/

On Apr 14, 9:18 am, Rob Charlwood <robcharlw...@googlemail.com> wrote:
> Hello all,
>
> I'm a little stuck working with some template filters in django in a
> multi-lingual site.
> Basically some of our content in an Arabic version is not being
> translated and so we need some of template filters to just output in
> English. However they continue to output in Arabic.
>
> The main template filters I am having problems with is
> 'filesizeformat' and 'date'. Now I totally understand why Django
> inherits this behavoiur and it makes sense to me. However our clients
> are keen to have the filters not translated. So my question is, is
> there a way to force template tags not to translate?
>
> Something like
> {{doc.download|filesizeformat|no_trans}}
>
> If not is there any other way to force certain template tags not to
> translate?
>
> Many thanks in advance.
> Rob

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



Template translation

2010-04-14 Thread Rob Charlwood
Hello all,

I'm a little stuck working with some template filters in django in a
multi-lingual site.
Basically some of our content in an Arabic version is not being
translated and so we need some of template filters to just output in
English. However they continue to output in Arabic.

The main template filters I am having problems with is
'filesizeformat' and 'date'. Now I totally understand why Django
inherits this behavoiur and it makes sense to me. However our clients
are keen to have the filters not translated. So my question is, is
there a way to force template tags not to translate?

Something like
{{doc.download|filesizeformat|no_trans}}

If not is there any other way to force certain template tags not to
translate?

Many thanks in advance.
Rob

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



Count number of objects with no ManyToMany connections

2010-03-06 Thread Rob Carlson
I want to find how many Resources in my dataset have no Widgets associated with 
them.  Resources and Widgets have a ManyToMany relationship:

class Resource(models.Model):
   widgets = models.ManyToManyField(Widget, null=True, blank=True)

I finally settled on the code below, but I was wondering if there was a better 
way to express this:

print "No widgets", 
Resource.objects.exclude(widgets__in=Widget.objects.all()).count()

Thanks!

--
Rob Carlson  r...@vees.net  http://vees.net/

-- 
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: Check if django is getting a page from memcache

2010-02-13 Thread Rob Hudson
You can telnet to memcached and run the `stats` command.  That'll tell
you overall hits and misses (plus other info).  If you're using
Django's page caching middleware, you'll see 2 hits per page because
Django caches both headers and page content.  The page load you should
see 2 misses.  Then all subsequent page loads you should see the hits
counter increase.

-Rob

On Feb 13, 2:41 am, Alessandro Ronchi <alessandro.ron...@soasi.com>
wrote:
> I am not sure django is getting a page from memcached. Is there a way to
> check it?
>
> Thanks in advance,
>
> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> http://hobbygiochi.com
> Hobby & Giochi, l'e-commerce del divertimento

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-debug-toolbar and 404's

2010-02-12 Thread Rob Hudson
Can you test it by disabling the debug toolbar middleware?  I've
duplicated your exact settings as much as I can and it's working for
me.  If disabling the middleware makes the admin appear, then it would
seem something in the toolbar is causing the problem.

And you are right... those settings you refer to are optional.

Thanks,
Rob

On Feb 11, 10:57 pm, Rishabh Manocha <rmano...@gmail.com> wrote:
> Mike,
>
> Thanks for replying. Reading through the django-debug-toolbar docs, those
> settings are all optional, so I just figured I don't need to set them for
> the default debug-toolbar functionality. I'll give it a shot though, just to
> make sure.
>
> Anybody else have any ideas??
>
> --
>
> Best,
>
> R

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-debug-toolbar with runserver not running on localhost

2010-02-05 Thread Rob Hudson
Or use the SHOW_TOOLBAR_CALLBACK to customize when you want the
toolbar displayed... I simply ship with what I consider reasonably
safe defaults.  For example:

# Always show the toolbar

DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK: lambda req: True,
}

# Only show toolbar for super user

def custom_show_toolbar(request):
if request.user.is_superuser:
return True
return False

DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
}


-Rob

On Feb 5, 1:23 am, chefsmart <moran.cors...@gmail.com> wrote:
> If you use dcamer's forkhttp://github.com/dcramer/django-debug-toolbar
>
> you won't have to rely on INTERNAL_IPS and you can simply log in as a
> superuser to use django-debug-toolbar
>
> Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django or CMS.

2010-02-05 Thread Rob B (uk)
The design agency I work for are looking into CMS options.  Being a
Django man myself I'm hoping to convince them to build one using
Django.

Requirements are roughly:

Page control (creation/drafts/published/withdrawn/deletion)
Page revisions
View draft pages on site for testing
In-place editing for simple text updates
Categories
Editable Navigation
Wysiwyg editors
Image upload (mass select)
Tagging (pages, images, clients)
Smart site search
Limiting user publishing rights

I can't seem to find a decent CMS that would fit the criteria.  What
are people's opinions / experiences with CMS'?  What would you
recommend?  Thanks

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



problems getting the development version running on Leopard

2010-01-19 Thread Rob Slotboom
I followed all instructions regarding the intallation of the
development version of Django on Leopard.
I’ve created the symbolic links but I keep getting two error messages:

The first one trying to rum django-admin.py  >>>> command not found
The seccond trying to import django in the python shell   >>>>  No
module named django.core

I can see the symbolic links in finder and the show the content the
should give.

Some time ago I used exactly the same procedure on FreeBSD and all
went fine.

Do I have to something special to get this running on Leopard?

Cheers,

Rob
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-06 Thread Rob
Have you managed to figure this out - I'm having a similar (I believe
the same) issue.

On Jan 5, 6:27 am, Patrick May  wrote:
> Can you make it fail in the development server, with DEBUG turned on?
>
> If so, you can get more helpful error display and/or do pdb.set_trace() and
> poke around.
>
> I'll give that a try, thanks!
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: django-tagging is not multi-db safe

2009-12-26 Thread Rob Hudson
> Django-tagging have a lot of users though. Maybe the pinax-people will
> arrange for a version that is 1.2-safe.

Check out django-taggit: http://github.com/alex/django-taggit

--

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: debug toolbar problem

2009-11-02 Thread Rob Hudson

It's looking like you have DEBUG=False and rely on
request.user.is_superuser to enable the toolbar.  Which mostly works,
except...

The Django Debug Toolbar monkey patches the CursorDebugWrapper class
to collect its data about what SQL queries are being executed:
http://github.com/robhudson/django-debug-toolbar/blob/master/debug_toolbar/panels/sql.py#L130

And this only gets used as a database cursor within Django when
settings.DEBUG=True:
http://code.djangoproject.com/browser/django/trunk/django/db/backends/__init__.py#L82

So when DEBUG=False, it uses a normal cursor which doesn't track SQL
queries.

-Rob

On Nov 2, 5:38 am, "bax...@gretschpages.com" <mail.bax...@gmail.com>
wrote:
> > Are you caching your pages?
>
> Yes, but only for anonymous users
>
> > Are you using Django ORM?
>
> Yes
>
> > Have you added the DebugToolbarMiddleware to your MIDDLEWARE_CLASSES
> > in settings.py?
>
> Yes. In settings:
>
> MIDDLEWARE_CLASSES = (
>     'django.middleware.common.CommonMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>     'django.middleware.doc.XViewMiddleware',
>     'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
>     'django.middleware.cache.CacheMiddleware',
>     'utils.lastseen.LastSeen',
>     'utils.ban_middleware.IPBanMiddleware',
>     'debug_toolbar.middleware.DebugToolbarMiddleware',
> )
>
> 
>
> DEBUG_TOOLBAR_PANELS = (
>             #'debug_toolbar.panels.version.VersionDebugPanel',
>             'debug_toolbar.panels.timer.TimerDebugPanel',
>             #'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
>             'debug_toolbar.panels.headers.HeaderDebugPanel',
>             'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
>             'debug_toolbar.panels.template.TemplateDebugPanel',
>             'debug_toolbar.panels.sql.SQLDebugPanel',
>             'debug_toolbar.panels.signals.SignalDebugPanel',
>             'debug_toolbar.panels.logger.LoggingPanel',
>         )
>
> 
>
> def custom_show_toolbar(request):
>             if request.user.is_superuser:
>                return True # Always show toolbar, for example purposes only.
>             return False
>
> DEBUG_TOOLBAR_CONFIG = {
>             'INTERCEPT_REDIRECTS': False,
>             'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
>            # 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
>             'HIDE_DJANGO_SQL': False,
>         }
>
> INSTALLED_APPS = (
>     ...
>     'debug_toolbar',
> )
>
> I see the bars, and most appear to be working ( like version, for
> example, before I turned it off), but nothing on SQL
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



models.Manager error

2009-09-21 Thread Rob B (uk)

Model: http://dpaste.com/96349/

View:
def game_list(request):
return render_to_response('games/game_list.html',
  { 'object_list':
GameList.objects.published.all().order_by('position')})


Template error:
AttributeError at /games/
'Manager' object has no attribute 'published'

Would seem my view doesn't like my new manager very 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
-~--~~~~--~~--~--~---



  1   2   3   4   5   6   >