Re: How to use permissions on a CreateView class?
Thanks guys! The problem was the permission mixins on my class... Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, May 30, 2019 at 8:26 PM Andrew C. wrote: > Sorry. Info ISN’T saved on private browser > > On Thu, May 30, 2019 at 7:25 PM Andrew C. wrote: > >> Try clearing your browser history and info. Should also test in Incognito >> or Private browser so info is saved. I have a suspicion that your browser >> is saving login info and you’re just not realizing this. >> >> On Tue, May 28, 2019 at 5:54 PM Fellipe Henrique >> wrote: >> >>> Hi Jim, >>> >>> Tried that, as you can see on my code, but not working.. when user type >>> the url, still see the template.. >>> >>> Any suggestions? >>> >>> Regards, >>> >>> T.·.F.·.A.·. S+F >>> *Fellipe Henrique P. Soares* >>> >>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>> 's/(.)/chr(ord($1)-2*3)/ge' >>> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >>> <https://fedoraproject.org/wiki/User:Fellipeh>* >>> *Blog: *http:www.fellipeh.eti.br >>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>> *Twitter: @fh_bash* >>> >>> >>> On Tue, May 28, 2019 at 2:36 PM Jim Illback >>> wrote: >>> >>>> I think you can also add to your class (right under your >>>> *template_name*… for example) this statement: >>>> >>>>permission_required = *‘*appname.permission_name' >>>> >>>> This will limit to logged on users (as below), and also to users who >>>> possess this permission. >>>> >>>> Jim >>>> >>>> >>>> On May 28, 2019, at 9:55 AM, Joe Reitman wrote: >>>> >>>> Fellipe, >>>> >>>> Here is an example of decorating class based views from the >>>> documentation >>>> <https://docs.djangoproject.com/en/2.2/topics/class-based-views/intro/#decorating-class-based-views> >>>> : >>>> >>>> from django.contrib.auth.decorators import login_requiredfrom >>>> django.utils.decorators import method_decoratorfrom django.views.generic >>>> import TemplateView >>>> class ProtectedView(TemplateView): >>>> template_name = 'secret.html' >>>> >>>> @method_decorator(login_required) >>>> def dispatch(self, *args, **kwargs): >>>> return super().dispatch(*args, **kwargs) >>>> >>>> >>>> On Tuesday, May 28, 2019 at 6:54:38 AM UTC-5, Fellipe Henrique wrote: >>>>> >>>>> Hello, >>>>> >>>>> I have these class, based on CreateView class... and I only want allow >>>>> user with these permissions to add record... >>>>> >>>>> class ClienteCreateView(ERPbrViewMixin, CreateView): >>>>> template_name = 'cadastro/cliente/form.html' >>>>> permission_required = ('cliente.can_open', 'cliente.can_edit', >>>>> 'cliente.can_add') >>>>> model = Cliente >>>>> form_class = ClienteForm >>>>> >>>>> But, not working... user without these permission, when type the url >>>>> show the form... >>>>> >>>>> Any tips how to do that? >>>>> >>>>> Cheers! >>>>> >>>>> >>>>> T.·.F.·.A.·. S+F >>>>> *Fellipe Henrique P. Soares* >>>>> >>>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>>> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >>>>> <https://fedoraproject.org/wiki/User:Fellipeh>* >>>>> *Blog: *http:www.fellipeh.eti.br <http://www.fellipeh.eti.br/> >>>>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>>>> *Twitter: @fh_bash* >>>>> >>>> >>>
Re: How to use permissions on a CreateView class?
Hi Jim, Tried that, as you can see on my code, but not working.. when user type the url, still see the template.. Any suggestions? Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, May 28, 2019 at 2:36 PM Jim Illback wrote: > I think you can also add to your class (right under your *template_name*… > for example) this statement: > > permission_required = *‘*appname.permission_name' > > This will limit to logged on users (as below), and also to users who possess > this permission. > > Jim > > > On May 28, 2019, at 9:55 AM, Joe Reitman wrote: > > Fellipe, > > Here is an example of decorating class based views from the documentation > <https://docs.djangoproject.com/en/2.2/topics/class-based-views/intro/#decorating-class-based-views> > : > > from django.contrib.auth.decorators import login_requiredfrom > django.utils.decorators import method_decoratorfrom django.views.generic > import TemplateView > class ProtectedView(TemplateView): > template_name = 'secret.html' > > @method_decorator(login_required) > def dispatch(self, *args, **kwargs): > return super().dispatch(*args, **kwargs) > > > On Tuesday, May 28, 2019 at 6:54:38 AM UTC-5, Fellipe Henrique wrote: >> >> Hello, >> >> I have these class, based on CreateView class... and I only want allow >> user with these permissions to add record... >> >> class ClienteCreateView(ERPbrViewMixin, CreateView): >> template_name = 'cadastro/cliente/form.html' >> permission_required = ('cliente.can_open', 'cliente.can_edit', >> 'cliente.can_add') >> model = Cliente >> form_class = ClienteForm >> >> But, not working... user without these permission, when type the url show >> the form... >> >> Any tips how to do that? >> >> Cheers! >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br <http://www.fellipeh.eti.br/> >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> > > -- > 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/060a2c59-bf39-456c-a686-bf6ba104e1f7%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/060a2c59-bf39-456c-a686-bf6ba104e1f7%40googlegroups.com?utm_medium=email&utm_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/B5E64E45-C1C3-455F-AEC7-167852FE17C7%40hotmail.com > <https://groups.google.com/d/msgid/django-users/B5E64E45-C1C3-455F-AEC7-167852FE17C7%40hotmail.com?utm_medium=email&utm_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/CAF1jwZHCR%3Dn2FMcdPdWsAOKG7wQRhqKBb4is58P61dGCi8_Eqg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to use permissions on a CreateView class?
Hello, I have these class, based on CreateView class... and I only want allow user with these permissions to add record... class ClienteCreateView(ERPbrViewMixin, CreateView): template_name = 'cadastro/cliente/form.html' permission_required = ('cliente.can_open', 'cliente.can_edit', 'cliente.can_add') model = Cliente form_class = ClienteForm But, not working... user without these permission, when type the url show the form... Any tips how to do that? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZE6R02FvUqPAywU44z-mEErB17nXOWx9gSV5RijKhPErQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How is the best way to separate costumers on my django site?
Hello, I need to separate my django website, for different costumers... Which is the best option: 1) One database and separate each costumer as a django user 2) different database, one for each costumer? There's no need the costumer has "users"... Any tips or ideas? Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGRNzWNRFEsi4tjgOU1aft%2BpK16FB8_%2Bra2U1TpRrQHqQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: There's any django app for calendar?
Thanks Guys.. I'll take a look... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, Mar 28, 2019 at 3:31 PM Kasper Laudrup wrote: > Hi Fellipe, > > On 28/03/2019 14.45, Fellipe Henrique wrote: > > Hello guys, tried to search on google, but no lucky.. > > > > Anyone knows any django app for calendar, to set appointments, > > hour/day... with frontend? > > > > > I had sort of the same issue a while ago. I wanted a simple booking > system for a website for my familys summer house. > > None of the existing apps that others have kindly linked to really > filled my requirements. To be honest, I can't remember exactly why, but > I think they were either too complex for my needs or where simply > designed for something else. > > In the end I started hacking around with the python calendar module from > the standard library: > > https://docs.python.org/3/library/calendar.html > > Which has a nice HTMLCalendar class which can be used for generating a > calendar. It can be "sort of" customized with CSS classes, but in the > end I ended up copy-pasting the HTMLCalendar code and customizing it for > my needs, primarily because I needed bit more than just custom CSS. > > Feel free to have a look here: > > https://github.com/laudrup/ebbamaala > > Specifically, there's a custom tag for rendering the calendar here: > > > https://github.com/laudrup/ebbamaala/blob/master/website/templatetags/calendar.py > > Of course, you also need the booking model etc. to show and handle new > bookings etc. > > Not sure if this is the right way to do it and I'm far from being and > expert in Django (or Python for that matter), but hope it might be useful. > > If someone else can tell me some better way to do it, I'd be very > interested as well :-) > > Kind regards, > > Kasper Laudrup > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/273e1f23-b8e4-31d8-d519-2d10e3898e6d%40stacktrace.dk > . > 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/CAF1jwZG0%3DKebLiwZRKuDNoYSCetJfvOz_mCO0DkWk%3D3xiciQTA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There's any django app for calendar?
Hello guys, tried to search on google, but no lucky.. Anyone knows any django app for calendar, to set appointments, hour/day... with frontend? Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF9cRAYbjPr04MyC%3DAWx_xhAdZd%2B%3Dem_WiOSkSpJgA9jQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to set "loading" on button without using JS
Hello, I`m using the default processo to get data from user CreateView -> Form -> Template Using AngularJS I can set a "spining" to a Submit button.. but.. how can I set these without using AngularJS.. using the "normal process" Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGb2eOnvQgv-J%3D16nwgwtJd5k5eR7szKm2K09AZQa-wvw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Which free template you use to a ERP frontend?
Hi guys, A company here need to provide some info for users.. they have a Delphi ERP, so we need to create a web frontend for some of infos... Which free template you use? Why? Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGfTyOm1FrpvD-p5TpB6BDcL7Z7w%2BPsVcLZ%3DapgtzLCFA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There's way to change "model_list" result variable name from ListView?
Hi, Normal ListView result a list with "model"_list as name... there's any way to change these name? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEEngEz-v%2BCwyURRQ4FD-JisKo4ZVggVJhsjGrjLZpxNQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There's a complete CRUD app for django, like Admin?
Hello, I have a site here, using django admin, but it's been complicated to maintain.. I ned to add several javascript, import sessions etc.. and Admin was good so far, but now I spent several time to try to modify any admin model screen... So.. I thought, maybe there's a app to do exactly like admin, to give me complete list, create, update, delete and form with auto-create fields.. i try to google about that, but found only admin templates, so, I`m here... asking if anyone know any app like these.. Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEcXC1eF%2B9Y0JOsWZA4K-a9d2qe-msy%3DANS2o09twpHig%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
What's the Better approach to do these?
Hello, I need to build a system.. each user will be a customer.. and each costumer will be products and sales... I do not want to build a system, and create "sub-domais" and for each sub-domains a create a "new" clone of my system... it's hard maintenance.. I think these: each model, I create a FK, and change the Model Manager, to filter all query with User ID... so, show only models to each User.. (thanks for help me here on these) But I found a issue... for each record, django will use ID.. so, for example: User 1 - Product 1 - Product ID: 1 User 1 - Product 2 - Product ID: 2 User 2 - Product 1 - Product ID: 3 User 3 - Product 1 - Product ID: 4 Any idea how to do that better?! Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGV0qWARG4vYP%3DKYNyDyAXsWevQH2Gx6E4AO_KEQN4LvQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to filter *every* query on django?
Thanks Andreas, Using your tip, I installed django-tools app, and now I can get the current user junt using single line... :) One question... these locals variable, change for each connection? example: I have 1 site, and I want to get several models, with FK for each user.. so.. User1 can only see data from him.. that's the reason I need to filter... Works like these? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Sun, Aug 19, 2018 at 5:14 AM Andréas Kühne wrote: > What you can do is add a middleware that sets the current user in a thread > local variable. That way you can then add a custom model manager that reads > that variable. > > Then all of your filters will be set automatically. > > Regards, > > Andréas > > 2018-08-18 17:46 GMT+02:00 Fellipe Henrique : > >> Thanks Jason, >> >> But, can I get current user on model manager? I need to filter with that >> info. >> >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> >> On Sat, Aug 18, 2018 at 9:10 AM Jason wrote: >> >>> make a custom model manager for that model. >>> >>> https://docs.djangoproject.com/en/2.1/topics/db/managers/#custom-managers >>> >>> -- >>> 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/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com?utm_medium=email&utm_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/CAK4qSCfOVv3K_kzbT_F1yaheHbH5sECdOp70nNcMi-3_m%3DtDXw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAK4qSCfOVv3K_kzbT_F1yaheHbH5sECdOp70nNcMi-3_m%3DtDXw%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZGzK-Yd1qQb9FHY_3196bNjr_nsRkpraR5xB%2BwaTMxp%2Bg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to filter *every* query on django?
Thanks Jason, But, can I get current user on model manager? I need to filter with that info. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Sat, Aug 18, 2018 at 9:10 AM Jason wrote: > make a custom model manager for that model. > > https://docs.djangoproject.com/en/2.1/topics/db/managers/#custom-managers > > -- > 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/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to filter *every* query on django?
Hi Bro .`. Thanks for your response, but I need to do that: If I make these: Products.object.all() or Products.objects.count() I need to django, auto include a .filter(created_user=*request*.user) ... today I`m doing exactly you write, but I need to make these filter, one-by-one... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Fri, Aug 17, 2018 at 3:55 PM Ángel Gabriel Morales Acosta < angel.gabriel...@gmail.com> wrote: > Hi Bro.·. > > If I understand you, you can this: > > def any_func(..., *request*): > ... > .filter(created_user=*request*.user) > > more about : https://docs.djangoproject.com/en/2.1/ref/request-response/ > > Cheers Bro.·. > > > *---* > *Ángel Gabriel Morales Acosta* > Email: angel.gabriel...@gmail.com > > > On Fri, Aug 17, 2018 at 1:22 PM Fellipe Henrique > wrote: > >> Hello guys... I have several model with FK with Django User so, I >> need to filter each query using: >> >> .filter(created_user=current)user) >> >> I do it, manually... how can do it, automatically? >> >> >> Thanks >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> -- >> 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/CAF1jwZEtTYiD%3DTvPxuvucMRV%2BeLzCD%3DXMWdMSKt2sV2fbxYeMA%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAF1jwZEtTYiD%3DTvPxuvucMRV%2BeLzCD%3DXMWdMSKt2sV2fbxYeMA%40mail.gmail.com?utm_medium=email&utm_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/CAPF44MAtRpPmNgF%2BpDHbcemRHP30tDtCgp-S0Hoae%3DAdJw_7xQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAPF44MAtRpPmNgF%2BpDHbcemRHP30tDtCgp-S0Hoae%3DAdJw_7xQ%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZEMxO0xcc9umTBBC%2B21_LFuX7av9Kb9p8riQ_KXPnG0Bw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to filter *every* query on django?
Hello guys... I have several model with FK with Django User so, I need to filter each query using: .filter(created_user=current)user) I do it, manually... how can do it, automatically? Thanks T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEtTYiD%3DTvPxuvucMRV%2BeLzCD%3DXMWdMSKt2sV2fbxYeMA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to verify if is new record or update record on django template?
How to verify if is new record or update record on django template? How can i do that? 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/CAF1jwZH40f%3D3ATxVSNx8Ku%3DWiG1MxnN%3D89MLw-5%2B-iNuEu9uQA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to include a Where clause for each query on django?
Hello.. Each model of my app, has a field named user... so, I need to filter any query on that model user=current_user... I already do that, but manually for each model, on a view.. and I like to do that directly on some where when I try to use a query, any record will be filtered. Can I do that? where is the best place to do that? 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/CAF1jwZFc_dSyWQSDXJ-qaRgCvzoPYwK%2BRowd91aGCj8rnEnu1w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Migrate doen't recognize my apps to migrate
Hi all, I have these apps, on my django site: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # erp apps: 'erp.apps.base', 'erp.apps.login', 'erp.apps.cadastro', 'erp.apps.vendas', 'erp.apps.compras', 'erp.apps.fiscal', 'erp.apps.financeiro', 'erp.apps.estoque', ] I try to run: $ python manage.py migrate and get these: Operations to perform: Apply all migrations: admin, auth, contenttypes, sessions Running migrations: No migrations to apply. I have several migration files on each app, but migrate doesn't recognize them... I`m using Django 1.10.1 How can I fix that? regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEcR1VoXT9eXHppithuE7_Swb9xQ4TMPEomy-fOyLx1qg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: There is any way to prevent cascade delete on FK field, without using signal?
I read the docs, but doesn't work for me... still delete the record... I looking something directly to model, not using view... there's any way to do that? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Oct 3, 2017 at 1:39 PM, Fabio C. Barrionuevo da Luz < bna...@gmail.com> wrote: > explicitly define what to do when there is a deletion. > > use the "on_delete" parameter of ForeignKey/OneToOneField > > on django <=1.11, on_delete is optional, and its default value is CASCADE. > > after django >- 2.0, it is mandatory to set "on_delete" > > > https://docs.djangoproject.com/en/1.11/ref/models/fields/ > #django.db.models.ForeignKey.on_delete > > https://medium.com/@ajrbyers/django-fk-on-delete-defaults- > to-cascade-1c1506aae7c7 > > > 2017-10-03 13:28 GMT-03:00 Fellipe Henrique : > >> There is any way to prevent cascade delete on FK field, without using >> signal? >> >> I need to block the Delete process, not to set NULL on field.. >> >> Regards! >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> -- >> 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/ms >> gid/django-users/CAF1jwZH4s%3DSnCaS3hqCiZPQd%3D4vvZPYU1EH7oE >> p1ixpNrg5ERw%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAF1jwZH4s%3DSnCaS3hqCiZPQd%3D4vvZPYU1EH7oEp1ixpNrg5ERw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Fábio C. Barrionuevo da Luz > Palmas - Tocantins - Brasil - América do Sul > > http://pythonclub.com.br/ > > Blog colaborativo sobre Python e tecnologias Relacionadas, mantido > totalmente no https://github.com/pythonclub/pythonclub.github.io . > > Todos são livres para publicar. É só fazer fork, escrever sua postagem e > mandar o pull-request. Leia mais sobre como publicar em README.md e > contributing.md. > Regra básica de postagem: > "Você" acha interessante? É útil para "você"? Pode ser utilizado com > Python ou é útil para quem usa Python? Está esperando o que? Publica logo, > que estou louco para ler... > > -- > 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/CAPVjvMbA6Y%3DP8jKQr_MNRNBSXNXo8hoyxtrC% > 3DdXF3hMziDPhDg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAPVjvMbA6Y%3DP8jKQr_MNRNBSXNXo8hoyxtrC%3DdXF3hMziDPhDg%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZHKXBZa5o%2B8dg3e%3DBhasT3aSsx%3DrGEH2acx2qgKav%3DpxQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There is any way to prevent cascade delete on FK field, without using signal?
There is any way to prevent cascade delete on FK field, without using signal? I need to block the Delete process, not to set NULL on field.. Regards! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZH4s%3DSnCaS3hqCiZPQd%3D4vvZPYU1EH7oEp1ixpNrg5ERw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Best option to check and/or convert encoding for csv files
Hello guys, So, I have several csv files, to open using pyexcel... but I start to have issues with CSV saved from Excel, with other encoding... There's any option to verify the encoding of file, or change the encoding? regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZFrM%2Bze3LQ6bXkhXOAA_LmSrbXYLFYzhF63KHNweAB_jw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to use try..except, but when DEBUG is True, show the error?
Thanks, but.. it's weird I tried that before, and show me the error, but, only text.. not that "yellow page" from django... I'll look again my code... Thanks again! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Sat, Aug 12, 2017 at 12:32 PM, Marcin Gałązka wrote: > > Hello, > > > > i have these code, for example: > > > > try: > >x = parse_date('') > > except TypeError: > > return False > > > > > > > > It's ok for me code like these.. but, when DEBUG == True, I like to > show the django default error page... > > > > How can I do that? > > > > Regards > > Why not simply re-raise the exception? > > from yourproject.settings import DEBUG > > try: > x = parse_date('') > except TypeError: > if DEBUG: > raise > return False > > -- > 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/VI1PR03MB10060FE0FF9D5AA3E8CFF7D0D98E0%40VI1PR03MB1006. > eurprd03.prod.outlook.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/CAF1jwZF1-ngef_bJjR943yM0KeNjo0LYvHjat_p3hu%2B8Qjnodw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to use try..except, but when DEBUG is True, show the error?
Hello, i have these code, for example: try: x = parse_date('') except TypeError: return False It's ok for me code like these.. but, when DEBUG == True, I like to show the django default error page... How can I do that? Regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF%2Bf2KAZjNWA%2BjVnhTKbSj-vQQ4WjQRUzsr5vCxrqg4Eg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: It's possible to cache entire model
Thanks Gideon, I installed here and for now, it's ok! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Jul 25, 2017 at 8:55 AM, Gideon Boateng wrote: > Hi Fellipe, >> > if you want to cache an entire model. You can look at this package(Django > Cachalot - http://django-cachalot.readthedocs.io/en/latest/ > ). > I use it in production and its been amazing. It caches the entire ORM and > does automatic invalidation. > its very easy to use. > you literally need two lines of code and you will be up and running. > It has support for Redis and Mem cache. > > Cheers, > > -- > 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/e6009f69-b7fb-46f7-9d22-c693d23522c1%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/e6009f69-b7fb-46f7-9d22-c693d23522c1%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZHF--UDJn3ESi%3D%3Dobq9LHCCJ%2BGBeY_O8YZAzajwoR6%2BLw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
It's possible to cache entire model
Hi guys, I need to cache entire model, not a query, not a view.. entire model.. so, any query using these model will use the cache.. Can I do that using django cache? regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZH1%2B7ErXX0c-ugAAA0UC4S8tT%2BDM72OME6UgO3JX4Xvqg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How can I change the TabularInline "title" on Django Admin?
On Tue, Jul 12, 2016 at 1:52 PM, Ramiro Morales wrote: > Where the 'Conjunto de dados' seen in the screenshot title comes from? Is > the code you posted actually in sync with it? Sorry about that, I take the screenshot before change these text to "DataSet"... [image: Inline image 1] My problem is, the second "Dataset" (on light gray line) and "Dataset_users object" T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF2WwricBicEKxPL7eWsp%2BQrTuD7YgCQueNfKAWzyTDrA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How can I change the TabularInline "title" on Django Admin?
On Tue, Jul 12, 2016 at 1:34 PM, Ramiro Morales wrote: > Can you post a simplified excerpt of the relevant (fields, Meta options, > __*__ methods) models, admin app ModelAdmin's and *Inline's involved which > result in the layout depicted in the screenshot you posted? > Sure, here is: class Dataset(models.Model): active = models.BooleanField(_('Ativo'), default=True) title = models.CharField(_('Nome'), max_length=250) users = models.ManyToManyField(MyCustomUser) class Meta: verbose_name = _('Dataset') verbose_name_plural = _('Datasets') def __str__(self): return self.title class MyCustomUser(AbstractBaseUser, PermissionsMixin): username = models.CharField( _('Nome do usuário'), max_length=200, blank=True, null=True) email = models.EmailField( _('Endereço de E-Mail'), blank=False, unique=True) first_name = models.CharField(_('Nome'), max_length=30, blank=True) last_name = models.CharField( _('Sobrenome'), max_length=30, blank=True, default='') is_staff = models.BooleanField(_('Administrador?'), default=False) is_active = models.BooleanField(_('Usuário Ativo?'), default=True) date_joined = models.DateTimeField( _('Data Cadastro'), default=timezone.now) objects = CustomUserManager() USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['first_name'] class Meta: verbose_name = _('Usuário') verbose_name_plural = _('Usuários') def __str__(self): if self.first_name or self.last_name: return self.get_full_name() return self.email Admin: class DatasetInline(admin.TabularInline): model = Dataset.users.through verbose_name = _('Dataset') verbose_name_plural = _('Datasets') class MyCustomUserAdmin(UserAdmin): model = User add_fieldsets = (None, { 'classes': ('wide',), 'fields': ( 'email', 'password1', 'password2', 'first_name', 'last_name', 'is_superuser'), }), fieldsets = ( (None, {'fields': ('email', 'password')}), (_('Personal info'), {'fields': ( 'first_name', 'last_name')}), (_('Permissions'), {'fields': ('is_active', 'is_superuser')}), (_('Important dates'), {'fields': ('last_login', 'date_joined')}), ) ordering = ('first_name', 'email') list_display = ('email', 'first_name', 'last_name') inlines = [DatasetInline] list_filter = ('is_active', 'is_superuser') admin.site.register(User, MyCustomUserAdmin) The results: [image: Inline image 1] Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHuJNH8pWQO1EF2VXZNUC64-ssneSfwNARe%3DCsi0x0iSQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How can I change the TabularInline "title" on Django Admin?
On Thu, Jul 7, 2016 at 5:24 PM, Michal Petrucha < michal.petru...@konk.org> wrote: > In that case, the “DATASET” would be the verbose_name of that field, > and “Dataset_users object” is the string representation of the > original original object that the row corresponds to. > Unfortunately no.. :( I have set all verbose_name and verbose_name_plural, on all models.. and all models have str representation.. but still show these dataset_users object... instead the verbose_name These "problem" occur only when I have M2M field.. in other FK fields doesn't appears.. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF3Bg1mUvoZMzx%3DATUMrsSUfk5B8kLZh6%3Di%2BZZLpth3qw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How can I change the TabularInline "title" on Django Admin?
On Thu, Jul 7, 2016 at 2:57 PM, Michal Petrucha < michal.petru...@konk.org> wrote: > Maybe you're referring to verbose_name_plural? > Unfortunately no.. :( Here is a example: (in pt-br sorry...) [image: Inline image 2] I want to change the "DATASET" and "Dataset_users object" verbose_name and verbose_name_plural change the text on the "blue" line... Cheers T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHOrRCT2nSG9fNv43vx1_t7peFK3XWUAapk2_jtC0AfSA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How can I change the TabularInline "title" on Django Admin?
Hello, When we need to use TabulerInline on Django Admin, the admin template create a "title" for the field... it's not the verbose_name... verbose_name is set like a Group.. "Blue" line before TabularInline... after this line, we have a table title... that's my problem... how can I change these "table title" on TabularInline? Cheers T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHe-w%3DQf%2B%3DqwofNnEd1%2B_U_6P%2Bj%2BDBqN%2BjQHyhmkayd%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How can I hide Groups and Permissions on User deatils in Django Admin?
How can I hide Groups and Permissions on User deatils in Django Admin? Just Hide, for user can't see/change... I don't want to disable or remove.. just Hide.. Any idea? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZFaRUesvkEFo0QiGkvkcb4J1y5gT9RF4h4avp9Cqgf95Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to create the template "groups part" users admin. In my app?
Hello, I have 2 model... Model A and B... Model A can has N records of B... That's simple to do in django... But I want to build the HTML part.. Using the same mechanism which django use on Groups... In one side show me all records of B, and I can select one or more to add in A model... How can I do that, using django admin? I prefer not use inline.. Cheers! -- Sent from my iPhone -- 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/CAF1jwZHydugbAJkAQ3BcstyjBFjAkwq52ra1JxcDMv6286JhRQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Error using Django 1.9 with Postgres
Hello, I`m start to using Django 1.9 with PostgreSQL, and when I try to add a record using Admin, show me these error: IntegrityError at /admin/cadastro/mercadoria/add/ insert or update on table "django_admin_log" violates foreign key constraint "django_admin_log_user_id_c564eba6_fk_accounts_webconflexuser_id" DETAIL: Key (user_id)=(1) is not present in table "accounts_webconflexuser". Here is my traceback [1] I`m using a custom user model. And yes! I have a admin user and logged with them... Any ideia what's going on? [1] - http://pastebin.com/2LAhmd40 T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZE%3Djn7zXLwkT8AyiSSOrMVjtGDUw9Cvq25DevtwUTQ9HQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: API REST - Url's Serialized models don't work with the hostname of my production server - Django Rest Framework
Sorry to reply your post, but.. how do you show all api link? there's any settings for these? I asking because, when I try on my api, show me 404 page... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Feb 23, 2016 at 12:42 PM, Bernardo Garcia wrote: > Avraham, so yes, efectively ... > > This is my gunicorn_config.py > > command = '/opt/uleague/bin/gunicorn' > pythonpath = '/opt/uleague/pickapp' > bind = '127.0.0.1:8000' > workers = 3 > > > I will should in the directive bind put the internal ip address of my > machine? > I have some doubts > > >- The internal ip address of my machine is 172.31.60.141 > > > root@ip-172-31-60-141:/etc/nginx/sites-enabled# ifconfig > eth0 Link encap:Ethernet HWaddr 12:73:40:a8:59:99 > inet addr:172.31.60.141 Bcast:172.31.63.255 Mask:255.255.240.0 > inet6 addr: fe80::1073:40ff:fea8:5999/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1 > RX packets:220239 errors:0 dropped:0 overruns:0 frame:0 > TX packets:76169 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:238957069 (238.9 MB) TX bytes:13656430 (13.6 MB) > > loLink encap:Local Loopback > inet addr:127.0.0.1 Mask:255.0.0.0 > inet6 addr: ::1/128 Scope:Host > UP LOOPBACK RUNNING MTU:65536 Metric:1 > RX packets:53064 errors:0 dropped:0 overruns:0 frame:0 > TX packets:53064 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:16846573 (16.8 MB) TX bytes:16846573 (16.8 MB) > > root@ip-172-31-60-141:/etc/nginx/sites-enabled# > > But in my dashboard console, the dns public of my ec2 instance is: > ec2-52-90-253-22.compute-1.amazonaws.com, in fact, you can copy this url > in a browser... > > I don't know that value of address put in my gunicorn_config.py in the > directive bind. > I put the internal ip address but does not work my server deployment > > And my nginx configuration is the following: > > /etc/nginx/sites-enabled/myproject , in which I unknown if in the > server_name and proxy_pass directives I should fix some values too.. > server { > *server_name yourdomainorip.com <http://yourdomainorip.com>;* > access_log off; > location / { > *proxy_pass http://127.0.0.1:8000 <http://127.0.0.1:8000>;* > proxy_set_header X-Forwarded-Host $server_name; > proxy_set_header X-Real-IP $remote_addr; > add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM > NAV"'; > } > } > > > > > > > > On Tuesday, February 23, 2016 at 9:37:50 AM UTC-5, Avraham Serour wrote: >> >> are you using a config file for gunicorn? in the example it tells to use: >> >> bind = '127.0.0.1:8001' >> >> are you binding to 127.0.0.1 ? >> >> On Tue, Feb 23, 2016 at 4:33 PM, Bernardo Garcia >> wrote: >> >>> Hi Mr. Avraham Serour thanks for the attention >>> >>> In my amazon ec2 production server I am running my Django Application >>> using nginx, and gunicorn accord to this tutorial >>> https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn >>> >>> python manage.py runserver is used just in my local development machine >>> >>> On Tuesday, February 23, 2016 at 9:25:36 AM UTC-5, Avraham Serour wrote: >>>> >>>> are you running django using manage.py runserver? >>>> >>>> >>>> On Tue, Feb 23, 2016 at 4:03 PM, Bernardo Garcia >>>> wrote: >>>> >>>>> Hi everyone Djangonauts >>>>> :) >>>>> >>>>> Currently I am exposing a Django application (for the momento is just >>>>> thier users schema) with Django Rest Framework and happen that each >>>>> serialized model, in the url attribute, I have is the localhost machine >>>>> address development and don't take the hostname of my production server >>>>> machine which is located in amazon like as EC2 instance >>>>> >>>>> >>>>> In
Re: Is Django appropriate for my project?
Hi, On Thu, Jan 28, 2016 at 2:23 PM, Marisela Mainegra Hing < mainegrah...@gmail.com> wrote: > an online, database-supported application with appropriate skip-logic and > delegation features to ensure the tool is user-friendly. > >It needs to be supported for mobile, lap-top and desk-top use. > Sure, Django can help you in your project.. but... most your requisites is about Front-End, not backend (where django works)... be supported for mobile, laptop, table etc.. is about frontend, ok? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZE6eOWg3wZuhOBob%3DxOEVC2cbwkSedUmv%3DiPF8%2BNzKGLQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: There's any framework for "bussiness app (ERP)" built in Django?
Thanks for all replies.. But, I'm looking for a framework, not a finished ERP like Odoo... Need to be web, so, tryton is out (as I know, they not have web framework)... Django is a good framework, but I`m looking for one framework, built with Django, but, give to me Backend and Frontend... using django it self, I need to build from scratch a "business app" T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Mon, Jan 4, 2016 at 6:58 PM, Gustavo Andres Angulo wrote: > Also you can try Tryton. > > > Best. > Gustavo. > > On Mon, Jan 4, 2016 at 3:30 PM, Hildeberto Mendonça > wrote: > >> You can use Odoo for ERP if you want to keep using Python. For everything >> else, use Django. >> >> On Mon, Jan 4, 2016 at 8:02 PM, Luis Zárate wrote: >> >>> I know https://github.com/django-erp/django-erp, but I guest it's not >>> for production yet (see develop branch). >>> >>> >>> >>> 2016-01-04 12:26 GMT-06:00 Fellipe Henrique : >>> >>>> Hello, >>>> >>>> I'm making some research but I don't find any framework for "bussiness >>>> app", like ERP, using django (or flask) >>>> >>>> Anybody know any framework with these concept? >>>> >>>> >>>> Thanks! >>>> >>>> P.S.: for example, about "bussiness app" framework [1] >>>> >>>> [1] https://frappe.io/ >>>> >>>> T.·.F.·.A.·. S+F >>>> *Fellipe Henrique P. Soares* >>>> >>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >>>> <https://fedoraproject.org/wiki/User:Fellipeh>* >>>> *Blog: *http:www.fellipeh.eti.br >>>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>>> *Twitter: @fh_bash* >>>> >>>> -- >>>> 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/CAF1jwZH5SukdHE%2BArBmAfO-5H56UKskJhp%2BQJkjuFqguyKccbQ%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/django-users/CAF1jwZH5SukdHE%2BArBmAfO-5H56UKskJhp%2BQJkjuFqguyKccbQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> "La utopía sirve para caminar" Fernando Birri >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to django-users+unsubscr...@googlegroups.com. >>> To post to this group, send email to django-users@googlegroups.com. >>> Visit this group at https://groups.google.com/group/django-users. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/CAG%2B5VyOO5K3EJK8DgTiW9q5Xw5UQxcsgZOwGPwGY334Kyky9BQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyOO5K3EJK8DgTiW9q5Xw5UQxcsgZOwGPwGY334Kyky9BQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Hildeberto Mendonça, Ph.D >> Blog: http://www.hildeberto.com >> Twitter: https://twitter.com/htmfilho >> >> -- >> 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 >
There's any framework for "bussiness app (ERP)" built in Django?
Hello, I'm making some research but I don't find any framework for "bussiness app", like ERP, using django (or flask) Anybody know any framework with these concept? Thanks! P.S.: for example, about "bussiness app" framework [1] [1] https://frappe.io/ T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZH5SukdHE%2BArBmAfO-5H56UKskJhp%2BQJkjuFqguyKccbQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Django doesn't remove the "old" file after change
I have one ImageField in my Model, but when I change the image, django doesn't remove the old file. How can I make these happen? when change the file, the old one need to be deleted. I use ImageKit, so I try to override *storage * method in ImageFile field, but django start to save in my disk, not in Amazon S3 (default when I use ImageKit). So, any idea how can I fix these issue? Regards. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZFPHNAwTkR0Gg87MavUS2Eq9j%3D%2BWjHhF5rweogRATipkg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Why my aggregate is not working?
Hi, I have these model: class ProductClicks(models.Model): product = models.ForeignKey(Product) dthr = models.DateTimeField(_('Date/Time Click'), auto_now_add=True) ip = models.CharField(_('IP'), max_length=20, blank=True, null=True) And this view: current_month = datetime.now().month list_prod = ProductClicks.objects.filter(dthr__month=current_month)\ .aggregate(total=Count('product')) But in my template doesn't show my aggregate list. My goal is: show a list of all product with the Count, like in SQL when we use Group By... What's my error? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGhgy-daV0v70OTTR46%3Diq4TVZhGfXO1DEiyGmivxKVtg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Why django (when using inlineformset) run 20 times the same SQL for each record (form)?
Here is my view, model and form: https://gist.github.com/fellipeh/f10824e61552efd71c8e Here is my HTML: {% csrf_token %} {{ formset.management_form }} {% crispy formset helper %} Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Oct 20, 2015 at 10:56 AM, Mark Steadman wrote: > Are you sure that's the code? I think that would generate an error as you > can't combine variables in the same {{ ... }} tag. > > Not being pedantic; it's just important to make sure we're looking at the > right HTML to help diagnose the problem. Can you paste the whole view? > > Thanks! > > On Tuesday, 20 October 2015 00:30:19 UTC+1, Fellipe Henrique wrote: >> >> It's a simple HTML with these code: >> >> >> {{ formset helper }} >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> On Mon, Oct 19, 2015 at 6:29 PM, Mark Steadman wrote: >> >>> Can you provide the HTML you're using to render the formset view? >>> >>> >>> On Thursday, 15 October 2015 21:43:29 UTC+1, Fellipe Henrique wrote: >>>> >>>> Hello, >>>> >>>> I try to use "inlineformset", but for each record (each form) django >>>> create and run 20 selects (same select), I take the one snapshot [1]. >>>> >>>> Can anyone explain to me, why django do that? How can I fix these? It's >>>> take a some amout of time!!! >>>> >>>> Here is my view: >>>> >>>> ofertasinlineformset = inlineformset_factory(Assinatura, Ofertas, >>>> form=OfertasEditForm, >>>> >>>> max_num=ass_ativa.total_produtos_oferta, >>>> >>>> extra=ass_ativa.total_produtos_oferta, >>>> exclude=(), >>>> can_delete=False) >>>> >>>> form: >>>> >>>> class OfertasEditForm(ModelForm): >>>> class Meta: >>>> model = Ofertas >>>> exclude = [] >>>> >>>> def __init__(self, *args, **kwargs): >>>> u = kwargs.pop('usuario', None) >>>> super(OfertasEditForm, self).__init__(*args, **kwargs) >>>> self.fields['produto'].queryset = >>>> Produto.objects.filter(usuario_id=u).filter(status='A') >>>> >>>> >>>> Debug [1]: >>>> >>>> [image: Inline image 1] >>>> >>>> >>>> T.·.F.·.A.·. S+F >>>> *Fellipe Henrique P. Soares* >>>> >>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >>>> <https://fedoraproject.org/wiki/User:Fellipeh>* >>>> *Blog: *http:www.fellipeh.eti.br >>>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>>> *Twitter: @fh_bash* >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to django-users...@googlegroups.com. >>> To post to this group, send email to django...@googlegroups.com. >>> Visit this group at http://groups.google.com/group/django-users. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/d4ff4f3d-6c8c-4bda-bd4a-971639febe71%40googlegroups.com >>> <h
Re: Why django (when using inlineformset) run 20 times the same SQL for each record (form)?
It's a simple HTML with these code: {{ formset helper }} T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Mon, Oct 19, 2015 at 6:29 PM, Mark Steadman wrote: > Can you provide the HTML you're using to render the formset view? > > > On Thursday, 15 October 2015 21:43:29 UTC+1, Fellipe Henrique wrote: >> >> Hello, >> >> I try to use "inlineformset", but for each record (each form) django >> create and run 20 selects (same select), I take the one snapshot [1]. >> >> Can anyone explain to me, why django do that? How can I fix these? It's >> take a some amout of time!!! >> >> Here is my view: >> >> ofertasinlineformset = inlineformset_factory(Assinatura, Ofertas, >> form=OfertasEditForm, >> >> max_num=ass_ativa.total_produtos_oferta, >> >> extra=ass_ativa.total_produtos_oferta, >> exclude=(), >> can_delete=False) >> >> form: >> >> class OfertasEditForm(ModelForm): >> class Meta: >> model = Ofertas >> exclude = [] >> >> def __init__(self, *args, **kwargs): >> u = kwargs.pop('usuario', None) >> super(OfertasEditForm, self).__init__(*args, **kwargs) >> self.fields['produto'].queryset = >> Produto.objects.filter(usuario_id=u).filter(status='A') >> >> >> Debug [1]: >> >> [image: Inline image 1] >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> -- > 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/d4ff4f3d-6c8c-4bda-bd4a-971639febe71%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/d4ff4f3d-6c8c-4bda-bd4a-971639febe71%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZFDNYuE9EGsfoudTeTtRjbzNZ4n%2BnoW_dudZvydoQRTZQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How can I get current user in my ModelForm, using inlineformset?
Hello, I have my ModelForm... and I need to filter my products with Current User.. if a change my modelform init, doesn't show me any error, but when I use in my inlineformset, show me on error.. Here is my code: View: ofertasinlineformset = inlineformset_factory(Assinatura, Ofertas, form=OfertasEditForm(usuario=request.user), max_num=ass_ativa.total_produtos_oferta, # min_num=ass_ativa.total_produtos_oferta, extra=ass_ativa.total_produtos_oferta, exclude=(), can_delete=False) Form: class OfertasEditForm(ModelForm): class Meta: model = Ofertas exclude = [] def __init__(self, *args, **kwargs): u = kwargs.pop('usuario', None) super(OfertasEditForm, self).__init__(*args, **kwargs) self.fields['produto'].queryset = Produto.objects.filter(usuario_id=u).filter(status='A') and the error: 'OfertasEditForm' object has no attribute '__name__' It's appears, when I use in my inlineformset only OfertasEditForm, work fine, because returns the class.. but when I use OfertasEditForm(usuario=reqquest.user) returns the HTML not the class. How can I do these? What's the better approach? Regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEkknLPm%2BiwG9zfXH-Ee_8X15Y8dt0S%2BCNNTF6owBaDfQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
If appears doesn't work in template, why?
Hello, I have one model, with a Char(1) Field... in my template I use these code: But, always enter in "else"... even the record was saved with "A"... I tried with 'A' and "A", same "problem"... Any ideas, what's going on? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZG_w2tc%2BwBEa1EzH09rnqac3vFhKamUHs45jMwAHvQ3JA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to solve this problem: Custom User with ForeinKey to another model. (model does not exist)
My problem is NOT the order... but I need to create "core app" first.. after that, install "account app".. because my model in "account app" has a FK to "core app" T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Oct 6, 2015 at 11:51 AM, Erol Merdanović wrote: > If the order is the problem, then you can define dependencies > > > https://docs.djangoproject.com/en/1.8/howto/writing-migrations/#controlling-the-order-of-migrations > > On Tuesday, 6 October 2015 16:34:04 UTC+2, Fellipe Henrique wrote: >> >> Just to update... these error occurs when I use PostgreSQL, using SQLite >> works perfect... >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> On Tue, Oct 6, 2015 at 10:08 AM, Fellipe Henrique >> wrote: >> >>> Hello, >>> >>> I have my custom user model in my "account" app, and I have in my "core" >>> app.. >>> >>> Inside my "core app" I have my City Model... >>> >>> But I need each user has to be set the user City... >>> >>> My problem: when I apply the migration, I give the error: "city model" >>> does not exist. even I put the "core app" abouve the "account app" in >>> settings.py. >>> >>> It's appears django try to make the account migration first, but It's >>> doesn't create yet my "city app"... >>> >>> What's the better approach to solve these problem? >>> >>> Regards. >>> >>> T.·.F.·.A.·. S+F >>> *Fellipe Henrique P. Soares* >>> >>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>> 's/(.)/chr(ord($1)-2*3)/ge' >>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>> *Twitter: @fh_bash* >>> >> >> -- > 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/871a9717-9c66-4417-8cbe-3d7f89141313%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/871a9717-9c66-4417-8cbe-3d7f89141313%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZHxHWPr5nX59m2N_hRzRc4rs%3DOs_%3DBk3sHtUNGWiKQtKQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to solve this problem: Custom User with ForeinKey to another model. (model does not exist)
Just to update... these error occurs when I use PostgreSQL, using SQLite works perfect... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, Oct 6, 2015 at 10:08 AM, Fellipe Henrique wrote: > Hello, > > I have my custom user model in my "account" app, and I have in my "core" > app.. > > Inside my "core app" I have my City Model... > > But I need each user has to be set the user City... > > My problem: when I apply the migration, I give the error: "city model" > does not exist. even I put the "core app" abouve the "account app" in > settings.py. > > It's appears django try to make the account migration first, but It's > doesn't create yet my "city app"... > > What's the better approach to solve these problem? > > Regards. > > T.·.F.·.A.·. S+F > *Fellipe Henrique P. Soares* > > e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ > 's/(.)/chr(ord($1)-2*3)/ge' > *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > -- 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/CAF1jwZGEkd-r2ZO5_vwpPF5Xj%3DgK%3DuxuBrs91U_MZ%2B30M4c4NQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to solve this problem: Custom User with ForeinKey to another model. (model does not exist)
Hello, I have my custom user model in my "account" app, and I have in my "core" app.. Inside my "core app" I have my City Model... But I need each user has to be set the user City... My problem: when I apply the migration, I give the error: "city model" does not exist. even I put the "core app" abouve the "account app" in settings.py. It's appears django try to make the account migration first, but It's doesn't create yet my "city app"... What's the better approach to solve these problem? Regards. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHvpB2Z%3DUw8AzRwknWtVLzaosjjB%3D-FD7AYvBf0JjZFyw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to get a application-formpost in django view? Get QueryDict variables.
Here is the request.body: b"'data[id]', ['83A0C50B5A0A43AD8F60C1066B16A163']&'data[status]', ['paid']&'event',['invoice.status_changed']" I think, maybe, something is wrong in Django, because these same POST is easy to get using PHP or Rails.. in PHP I get with these: $_POST['data']['id'] Maybe, something in django isn't implemented yet for these kind POST. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Fri, May 22, 2015 at 2:53 AM, Gergely Polonkai wrote: > I don't think so, maybe the post request is poorly formatted. Can you > somehow catch the raw http request for analyzing? > On 22 May 2015 00:14, "Vijay Khemlani" wrote: > >> Maybe the brackets confuse the querydict, try calling its items method >> (to convert it into a list of tuples) or its dict method (to turn it into a >> normal python dict) >> >> On Thu, May 21, 2015 at 3:34 PM, Fellipe Henrique >> wrote: >> >>> Any ideas? >>> >>> I finish all my possibilities in these problem.. :( and no solution... >>> >>> T.·.F.·.A.·. S+F >>> *Fellipe Henrique P. Soares* >>> >>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>> 's/(.)/chr(ord($1)-2*3)/ge' >>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>> *Twitter: @fh_bash* >>> >>> On Thu, May 21, 2015 at 10:23 AM, Fellipe Henrique >>> wrote: >>> >>>> Thanks, I try that! but show me None as value... >>>> >>>> I think, that's because the QueryDict is showed in this way: >>>> >>>> >>> 'data[status]': ['paid'], 'event': ['invoice.status_changed']": ['']}> >>>> >>>> I think the django takes >>>> >>>> 'data[id]': ['83A0C50B5A0A43AD8F60C1066B16A163'], 'data[status]': >>>> ['paid'], 'event': ['invoice.status_changed'] >>>> >>>> as the "key"... >>>> >>>> :( >>>> >>>> T.·.F.·.A.·. S+F >>>> *Fellipe Henrique P. Soares* >>>> >>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>>> *Twitter: @fh_bash* >>>> >>>> On Thu, May 21, 2015 at 10:15 AM, Gergely Polonkai >>> > wrote: >>>> >>>>> Assuming your QueryDict is called my_post_data, use >>>>> my_post_data.get('data[id]'). >>>>> On 21 May 2015 15:28, "Fellipe Henrique" wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> I need to get one application-form-post content from one server. This >>>>>> server isn't mine. >>>>>> >>>>>> They send to me this application-form-post, and in Django View I >>>>>> receive this: >>>>>> >>>>>> >>>>> 'data[status]': ['paid'], 'event': ['invoice']}> >>>>>> >>>>>> I need to get: data['id'], data['status'] and event variables.. >>>>>> >>>>>> How I do this in django? Because I can't work with QueryDict... I try >>>>>> to transform in python dict, in python list, but anyone works... >>>>>> >>>>>> Any idea for these problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> >>>>>> T.·.F.·.A.·. S+F >>>>>> *Fellipe Henrique P. Soares* >>>>>> >>>>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>>>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>
Re: How to get a application-formpost in django view? Get QueryDict variables.
Any ideas? I finish all my possibilities in these problem.. :( and no solution... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, May 21, 2015 at 10:23 AM, Fellipe Henrique wrote: > Thanks, I try that! but show me None as value... > > I think, that's because the QueryDict is showed in this way: > > 'data[status]': ['paid'], 'event': ['invoice.status_changed']": ['']}> > > I think the django takes > > 'data[id]': ['83A0C50B5A0A43AD8F60C1066B16A163'], 'data[status]': > ['paid'], 'event': ['invoice.status_changed'] > > as the "key"... > > :( > > T.·.F.·.A.·. S+F > *Fellipe Henrique P. Soares* > > e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ > 's/(.)/chr(ord($1)-2*3)/ge' > *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > > On Thu, May 21, 2015 at 10:15 AM, Gergely Polonkai > wrote: > >> Assuming your QueryDict is called my_post_data, use >> my_post_data.get('data[id]'). >> On 21 May 2015 15:28, "Fellipe Henrique" wrote: >> >>> Hello, >>> >>> I need to get one application-form-post content from one server. This >>> server isn't mine. >>> >>> They send to me this application-form-post, and in Django View I receive >>> this: >>> >>> >> 'data[status]': ['paid'], 'event': ['invoice']}> >>> >>> I need to get: data['id'], data['status'] and event variables.. >>> >>> How I do this in django? Because I can't work with QueryDict... I try to >>> transform in python dict, in python list, but anyone works... >>> >>> Any idea for these problem? >>> >>> Regards, >>> >>> >>> T.·.F.·.A.·. S+F >>> *Fellipe Henrique P. Soares* >>> >>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>> 's/(.)/chr(ord($1)-2*3)/ge' >>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>> *Twitter: @fh_bash* >>> >>> -- >>> 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/CAF1jwZFv5zwKHaDAFOz06n_%2B4EiNzzFoYx9t_MfTNnEFranAWg%40mail.gmail.com >>> <https://groups.google.com/d/msgid/django-users/CAF1jwZFv5zwKHaDAFOz06n_%2B4EiNzzFoYx9t_MfTNnEFranAWg%40mail.gmail.com?utm_medium=email&utm_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/CACczBULAgWb%3D6sn1JHxeg_nq%2BO%3DwR9bTBNR69QsUSKog1FB%3DKw%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CACczBULAgWb%3D6sn1JHxeg_nq%2BO%3DwR9bTBNR69QsUSKog1FB%3DKw%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZHE9K2n%3Dvu-yb2HuNSvkJcx3XYqo6KTzmRYKPESVtGOEw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: How to get a application-formpost in django view? Get QueryDict variables.
Thanks, I try that! but show me None as value... I think, that's because the QueryDict is showed in this way: I think the django takes 'data[id]': ['83A0C50B5A0A43AD8F60C1066B16A163'], 'data[status]': ['paid'], 'event': ['invoice.status_changed'] as the "key"... :( T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, May 21, 2015 at 10:15 AM, Gergely Polonkai wrote: > Assuming your QueryDict is called my_post_data, use > my_post_data.get('data[id]'). > On 21 May 2015 15:28, "Fellipe Henrique" wrote: > >> Hello, >> >> I need to get one application-form-post content from one server. This >> server isn't mine. >> >> They send to me this application-form-post, and in Django View I receive >> this: >> >> > 'data[status]': ['paid'], 'event': ['invoice']}> >> >> I need to get: data['id'], data['status'] and event variables.. >> >> How I do this in django? Because I can't work with QueryDict... I try to >> transform in python dict, in python list, but anyone works... >> >> Any idea for these problem? >> >> Regards, >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> -- >> 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/CAF1jwZFv5zwKHaDAFOz06n_%2B4EiNzzFoYx9t_MfTNnEFranAWg%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAF1jwZFv5zwKHaDAFOz06n_%2B4EiNzzFoYx9t_MfTNnEFranAWg%40mail.gmail.com?utm_medium=email&utm_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/CACczBULAgWb%3D6sn1JHxeg_nq%2BO%3DwR9bTBNR69QsUSKog1FB%3DKw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CACczBULAgWb%3D6sn1JHxeg_nq%2BO%3DwR9bTBNR69QsUSKog1FB%3DKw%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZFMBR5--WXuwd3-Hdi6KO1sLLBogt%2BE6N3xepvXz_ovsw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to get a application-formpost in django view? Get QueryDict variables.
Hello, I need to get one application-form-post content from one server. This server isn't mine. They send to me this application-form-post, and in Django View I receive this: I need to get: data['id'], data['status'] and event variables.. How I do this in django? Because I can't work with QueryDict... I try to transform in python dict, in python list, but anyone works... Any idea for these problem? Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZFv5zwKHaDAFOz06n_%2B4EiNzzFoYx9t_MfTNnEFranAWg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: django-allauth without username, login with facebook doesn't work
Hello Mario, thanks for help me... Yesterday I found the problem, here is: First i used python-social-auth after I move to django-allauth... for some reason, when I uninstalled the python-social-auth, the folder still in site-package, and when I call my template, django use the python-social-auth javascript!!! I manually remove the folder, and reinstall django-allauth and work fine now! Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, May 14, 2015 at 2:43 AM, Mario Gudelj wrote: > Sorry man. My mistake. > > So are you saying that you have a link with onclick or something? Do you > get the JS error? Is it logged inside your browser's console? It's a bit > hard to tell without more code or the URL... > > On 14 May 2015 at 03:12, Fellipe Henrique wrote: > >> Hi Mario, >> >> I`m not using python-social-auth... I choose to use all-auth[1] because >> it's given to me more the social login, like: password reset, email >> validation etc. >> >> My problem is: in template when I click on a button, nothing happen.. the >> link (javascript) is correct, but nothing happen... >> >> >> [1] - http://www.intenct.nl/projects/django-allauth/ >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> On Wed, May 13, 2015 at 12:26 AM, Mario Gudelj >> wrote: >> >>> What do you mean by nothing happens? Do you get taken to FB? >>> >>> Here's what I have in my setup which may help: >>> >>> The template link looks like this: >>> >>> Facebook >>> >>> Make sure you have the following line in your urls.py: >>> >>> url('', include('social.apps.django_app.urls', namespace='social')) >>> >>> settings.py: >>> >>> SOCIAL_AUTH_USER_FIELDS = ['email'] >>> SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True >>> SOCIAL_AUTH_FACEBOOK_KEY = 'your_key' >>> SOCIAL_AUTH_FACEBOOK_SECRET = 'your_secret' >>> SOCIAL_AUTH_FACEBOOK_SCOPE = ['email'] >>> SOCIAL_AUTH_ENABLED_BACKENDS=('facebook', 'google') >>> SOCIAL_AUTH_PROTECTED_FIELDS = ['email'] >>> SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['first_name', 'last_name', >>> 'email'] >>> >>> AUTHENTICATION_BACKENDS = ( >>> 'social.backends.facebook.FacebookOAuth2', >>> 'social.backends.google.GoogleOAuth2', >>> 'social.backends.twitter.TwitterOAuth', >>> 'django.contrib.auth.backends.ModelBackend', >>> ) >>> >>> Add 'social.apps.django_app.default', to INSTALLED_APPS >>> >>> Use https://github.com/omab/python-social-auth and follow installation >>> instructions from it. You'll need to setup your FB app as well. >>> >>> I think that's all you need. >>> >>> Good luck man. >>> >>> >>> >>> On 13 May 2015 at 04:13, Fellipe Henrique wrote: >>> >>>> Just to complement the previous mail, normal user (django user) like >>>> super-user create using syncdb, works fine! >>>> >>>> I'm using django 1.8. >>>> >>>> T.·.F.·.A.·. S+F >>>> *Fellipe Henrique P. Soares* >>>> >>>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>>> 's/(.)/chr(ord($1)-2*3)/ge' >>>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>>> *Twitter: @fh_bash* >>>> >>>> On Tue, May 12, 2015 at 3:09 PM, Fellipe Henrique >>>> wrote: >>>> >>>>> Hello, >>>>> >>>>> I'm trying to use Django-AllAuth social login... >>>>> >>>>> I have a custom user profile and custom usermanage [1] >>&
How to resend the activation email using django-allauth?
Hello, I need in my dashboard a link to resend activation mail, from django-allauth. Any idea? I don't want to use ACCOUNT_EMAIL_VERIFICATION = 'mandatory' because I want user login in my site, but send again the email. Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHX9UhnEHcftA87du-UyLMNteNKnoz%2BRh3KEsCF7ymFUQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: django-allauth without username, login with facebook doesn't work
Hi Mario, I`m not using python-social-auth... I choose to use all-auth[1] because it's given to me more the social login, like: password reset, email validation etc. My problem is: in template when I click on a button, nothing happen.. the link (javascript) is correct, but nothing happen... [1] - http://www.intenct.nl/projects/django-allauth/ T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Wed, May 13, 2015 at 12:26 AM, Mario Gudelj wrote: > What do you mean by nothing happens? Do you get taken to FB? > > Here's what I have in my setup which may help: > > The template link looks like this: > > Facebook > > Make sure you have the following line in your urls.py: > > url('', include('social.apps.django_app.urls', namespace='social')) > > settings.py: > > SOCIAL_AUTH_USER_FIELDS = ['email'] > SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True > SOCIAL_AUTH_FACEBOOK_KEY = 'your_key' > SOCIAL_AUTH_FACEBOOK_SECRET = 'your_secret' > SOCIAL_AUTH_FACEBOOK_SCOPE = ['email'] > SOCIAL_AUTH_ENABLED_BACKENDS=('facebook', 'google') > SOCIAL_AUTH_PROTECTED_FIELDS = ['email'] > SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['first_name', 'last_name', 'email'] > > AUTHENTICATION_BACKENDS = ( > 'social.backends.facebook.FacebookOAuth2', > 'social.backends.google.GoogleOAuth2', > 'social.backends.twitter.TwitterOAuth', > 'django.contrib.auth.backends.ModelBackend', > ) > > Add 'social.apps.django_app.default', to INSTALLED_APPS > > Use https://github.com/omab/python-social-auth and follow installation > instructions from it. You'll need to setup your FB app as well. > > I think that's all you need. > > Good luck man. > > > > On 13 May 2015 at 04:13, Fellipe Henrique wrote: > >> Just to complement the previous mail, normal user (django user) like >> super-user create using syncdb, works fine! >> >> I'm using django 1.8. >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> On Tue, May 12, 2015 at 3:09 PM, Fellipe Henrique >> wrote: >> >>> Hello, >>> >>> I'm trying to use Django-AllAuth social login... >>> >>> I have a custom user profile and custom usermanage [1] >>> >>> But, when I click on html template facebook link, anything happen! with >>> username, works fine. >>> >>> Here is my settings [2] >>> >>> My settings is wrong? any idea why this problem happens? >>> >>> Thanks, >>> regards >>> >>> >>> [1] - https://gist.github.com/fellipeh/fe2deae4854072b0cb3d >>> [2] - https://gist.github.com/fellipeh/033fcde17c9771dfb1b2 >>> >>> T.·.F.·.A.·. S+F >>> *Fellipe Henrique P. Soares* >>> >>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >>> 's/(.)/chr(ord($1)-2*3)/ge' >>> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >>> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >>> *Twitter: @fh_bash* >>> >> >> -- >> 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/CAF1jwZHCBfJsu8dCHk%3DeoPuTCPC9Jskxk16fbGR_W7DNyC8QRQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAF1jwZHCBfJsu8dCHk%3DeoPuTCPC9Jskxk16fbGR_W7DNyC8QRQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- >
Re: django-allauth without username, login with facebook doesn't work
Just to complement the previous mail, normal user (django user) like super-user create using syncdb, works fine! I'm using django 1.8. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Tue, May 12, 2015 at 3:09 PM, Fellipe Henrique wrote: > Hello, > > I'm trying to use Django-AllAuth social login... > > I have a custom user profile and custom usermanage [1] > > But, when I click on html template facebook link, anything happen! with > username, works fine. > > Here is my settings [2] > > My settings is wrong? any idea why this problem happens? > > Thanks, > regards > > > [1] - https://gist.github.com/fellipeh/fe2deae4854072b0cb3d > [2] - https://gist.github.com/fellipeh/033fcde17c9771dfb1b2 > > T.·.F.·.A.·. S+F > *Fellipe Henrique P. Soares* > > e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ > 's/(.)/chr(ord($1)-2*3)/ge' > *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > -- 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/CAF1jwZHCBfJsu8dCHk%3DeoPuTCPC9Jskxk16fbGR_W7DNyC8QRQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
django-allauth without username, login with facebook doesn't work
Hello, I'm trying to use Django-AllAuth social login... I have a custom user profile and custom usermanage [1] But, when I click on html template facebook link, anything happen! with username, works fine. Here is my settings [2] My settings is wrong? any idea why this problem happens? Thanks, regards [1] - https://gist.github.com/fellipeh/fe2deae4854072b0cb3d [2] - https://gist.github.com/fellipeh/033fcde17c9771dfb1b2 T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZHTrBwM0a0dEx7m0%3Dx0mKJZeKKv7BAcVsLKy5A8butWuQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Deploying django
Hey man!! In my setup, I use this: Gunicorn + nginx + supervisor Please, share your confs files.. without them we can't help a lot! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Sun, May 3, 2015 at 5:08 PM, João Marques wrote: > Hey there guys, I'm starting to lose my hope in deploying my django > project to a vps. Here is what I've done so far (notice that i'm a newbie > and this is the first time): I've created my virtualenv and installed pip, > django, mysqldb package and nginx (i think). I followed this tutorial: > https://www.digitalocean.com/community/tutorials/how-to-deploy-a-local-django-app-to-a-vps > > There were, although a few missing points on the tutorial like on the > gunicorn set-up, the command that's listed on the tutorial is outdated and, > even with the help of gunicorn's documentation, I couldn't figure it out. > > Now what happens when I run the server in "debug = False" is an error 500. > Without the "debug = False" I get this:'Empty static prefix not permitted'. > > Can you recommend me a good tutorial for me to follow? > > ps. I still need to use this http://37.59.114.190:8001/ with the port, > but I believe that is because of the gunicorn that i didn't set up. > Thank you so much for your time, > > João Marques > > -- > 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/79f73903-55d1-4c4c-a1d1-4a477bfd41ff%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/79f73903-55d1-4c4c-a1d1-4a477bfd41ff%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZGE2s3hyw2UXK9_6rDH3-i%3D206Sxihg7N7n9iyWzS5-og%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: What's the better way to get settings.DEBUG in a view?
Thanks... works now! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Thu, Apr 30, 2015 at 3:36 PM, Nelson Varela wrote: > from django.conf import settings > > -- > 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/6d6b46b7-12d6-4ce9-8cf9-caf69f98247e%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZHUtvoAyuqgZ3WE4sZPN%2BL%3DFeniu%3DpNcN5vznLg4xBWew%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
What's the better way to get settings.DEBUG in a view?
Hi, I have one view, and I want to get de DEBUG value.. if I try these: import settings if settings.DEBUG: or: from settings import DEBUG if DEBUG: show me these error: File "views.py", line 19, in import settings File "settings.py", line 178, in from .settings_local import * SystemError: Parent module '' not loaded, cannot perform relative import So, what's the better way to get these value? Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF8md7Cv43RvC1HENm7EEpCqPme8DLm2aCFdCdi2L_zjQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Ho to "create" a field in a queryset to show in my template?
Ok, But, if I want to create some "fields" in RunTime, I thinking to use Dict, but I don't know what to use to create "temporary" queryset... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZFK5Qv%3Dumu7AVi2AY0C%2BrDc_34O88FGwcgAUJcvVOsrSw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Ho to "create" a field in a queryset to show in my template?
Hello, I have these view: def planos_view(request, cat_id=0): if cat_id == '0': categorias = Categoria.objects.filter(publicado=True) else: categorias = Categoria.objects.filter(publicado=True).filter(id=cat_id) for c in categorias: c.total = Plano.objects.filter(categoria=c).count() return render_to_response('planos.html', locals(), context_instance=RequestContext(request)) I want to add the "total" field in my "categories" model.. What's the best approach for these, because these code above don't work... Thanks agains T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGvrVY2PG8YCgR3r4LS8URaR6-V2rP_EW3j9RJMpkVr3A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Why I don't access the {{ user }} variable in template?
I found the problem, I was create a custom template context processor, and for some reason I choose one name that override some function in one os 3rd apps I'm using... I change the name of my custom context processor, and works Fine! Thanks again T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Mon, Mar 23, 2015 at 12:07 PM, Daniel Roseman wrote: > On Monday, 23 March 2015 14:16:00 UTC, Fellipe Henrique wrote: >> >> Hello, >> >> I have this settings.py [1], and my CustomUser [2] >> >> When I try to use in my template: >> >> {{ user_first_name }} >> >> don't show anything... What I miss in these code? >> >> > You should show your view. Are you using a RequestContext? > -- > DR. > > -- > 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/1e057e9f-8ee7-4c08-90f7-dfabd6e72818%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/1e057e9f-8ee7-4c08-90f7-dfabd6e72818%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZFEQ7AN-Nm%2Bur3oYkeS1ue%3D3YtBYn6Hr4aQGwoCOcPYXg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Why I don't access the {{ user }} variable in template?
Yes, I have django.contrib.auth.context_processors.auth in my Tamplate processor: here is my template processor: TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.request', 'core.context_processor.default_proc', 'social.apps.django_app.context_processors.backends', 'social.apps.django_app.context_processors.login_redirect') sorry, in my template I use this: {{ user.first_name }} {{ user.last_name }} T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Mon, Mar 23, 2015 at 11:21 AM, aRkadeFR wrote: > Do you have 'django.contrib.auth.context_processors.auth' in > your context template processor? > > {{ user_first_name }} won't work anyway cause the variable > set by the context_processor auth is user. To access a key > or an attribute of a variable, the syntax is: > {{ user.first_name }} > > documentation on the django template language: > https://docs.djangoproject.com/en/1.7/ref/templates/api/ > > > On 03/23/2015 03:15 PM, Fellipe Henrique wrote: > > Hello, > > I have this settings.py [1], and my CustomUser [2] > > When I try to use in my template: > > {{ user_first_name }} > > don't show anything... What I miss in these code? > > Regards, > > > [1] - https://gist.github.com/fellipeh/adbfaf06361d68650f95 > > [2] - https://gist.github.com/fellipeh/a0cc18f26aa9868a061f > > T.·.F.·.A.·. S+F > *Fellipe Henrique P. Soares* > > e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ > 's/(.)/chr(ord($1)-2*3)/ge' > *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > -- > 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/CAF1jwZG2Qwk8n7TGT3ZcZv7FHtnm0MH7r34PkU92N0cBo1%3DgCw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAF1jwZG2Qwk8n7TGT3ZcZv7FHtnm0MH7r34PkU92N0cBo1%3DgCw%40mail.gmail.com?utm_medium=email&utm_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/5510214C.4020505%40arkade.info > <https://groups.google.com/d/msgid/django-users/5510214C.4020505%40arkade.info?utm_medium=email&utm_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/CAF1jwZFFkppQMXTxFMVhp_E8YANwwW0pAvsW7Yw%3Dp%3DXYAnTPWA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Why I don't access the {{ user }} variable in template?
Hello, I have this settings.py [1], and my CustomUser [2] When I try to use in my template: {{ user_first_name }} don't show anything... What I miss in these code? Regards, [1] - https://gist.github.com/fellipeh/adbfaf06361d68650f95 [2] - https://gist.github.com/fellipeh/a0cc18f26aa9868a061f T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZG2Qwk8n7TGT3ZcZv7FHtnm0MH7r34PkU92N0cBo1%3DgCw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?
Man!!! You don't believe what's the problem is!!?! The problem is my Firefox!! For some reason, firefox make a huge cache.. and it's using very old version of CSS and JS... I clean All my data, and work!!! Thanks Again! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Fri, Mar 20, 2015 at 2:20 PM, Tom Lockhart wrote: > On Mar 20, 2015, at 9:59 AM, Fellipe Henrique wrote: > > > On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani > wrote: > >> Soo when you open your webpage, look at its source code, click on the >> "/static/public/css/bootstrap.min.css" path it shows the file in Firefox? >> > > Yes.. when I open source code in firefox, click them.. show me the file.. > but, nothing to appears correctly my HTML... > > I really upset about these... I really don’t know what's happen here... > > > Your original problem statement included: > > … > - When I try to go: localhost:8000/static show these: > Page not found (404) > … > > In my debug setup, I have the same result, and this is normal. You > *should* be able to take a specific static resource and put it into the > browser as a URL. For example, I can put > http://localhost:8000/static/fz/img/loadingAnimation.gif into my browser > and that *does* find the gif. > > This is compatible with your observation that you can take the link in > your html and that *does* work when pasted into your browser. > > I’m guessing that there is a problem with your HTML, not with your static > setup. Can you distill the problem down to a simple HTML template and > resulting page and post both? > > When debugging html template troubles you may want to play around with {% > comment %}…{% endcomment %} blocks to get rid of code for testing. > > hth > > - Tom > > > > T.·.F.·.A.·. S+F > *Fellipe Henrique P. Soares* > > e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ > 's/(.)/chr(ord($1)-2*3)/ge' > *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > > -- > 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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > Please consider the environment before printing this message. > *This message may be privileged and/or confidential, and the sender does > not waive any related rights and obligations. Any distribution, use or > copying of this message or the information it contains by other than an > intended recipient is unauthorized. If you received this message in error, > please immediately advise me by return e-mail or phone. All information, > references, images, programs, source code, or other materials whatsoever > contained in, or supplied with, this document are TRADE SECRETS and > governed by the Uniform Trade Secrets Act. User assumes all direct and > consequential liabilities and costs that result from any unauthorized > disclosure or use of this information.* > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/28DCD048-9BFB-4AD5-BCD8-9AEB585813B4%40gmail.com > <https://groups.google.com/d/msgid/django-users/28DCD048-9BFB-4AD5-BCD8-9AEB585813B4%40gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received t
Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?
On Fri, Mar 20, 2015 at 11:43 AM, Vijay Khemlani wrote: > Soo when you open your webpage, look at its source code, click on the > "/static/public/css/bootstrap.min.css" path it shows the file in Firefox? > Yes.. when I open source code in firefox, click them.. show me the file.. but, nothing to appears correctly my HTML... I really upset about these... I really don't know what's happen here... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZG78iexn0uLign0Rj-d_dvi61%2BtrNHTnVxXMkUxOi_gSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?
On Fri, Mar 20, 2015 at 11:24 AM, Vijay Khemlani wrote: > http://localhost:8000/static/public/css/bootstrap.min.css In fact, if I type these in firefox, show me the file... :) but nothing in my HTML.. here is my html, {% load staticfiles %} Test!! I really don't know, how is the problem here... :( in my PyCharm Project, in HTML, show me: Unresolved Reference, to my static files... :( T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEq71rr5PA3BcLKS0Y4RRY5RH7tQW8sPjgjX94yuo477Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?
So, answer the questions: - I in Debug mode: DEBUG = True - Here is my settings.py: https://gist.github.com/fellipeh/4eb8143f6ac362dff9e0 - Yes, all my folder has the correct permission, I can edit any files there. - I my HTML I have: and in source code, in browser show these: - When I try to go: localhost:8000/static show these: Page not found (404) Request Method: GET Request URL: http://localhost:8000/static/ Directory indexes are not allowed here. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. Any thoughts? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Fri, Mar 20, 2015 at 9:36 AM, Ilya Kazakevich wrote: > This one "{% static "" %}" is MUCH better than {{STATIC_URL }}. > It is recommended way. > > You almost never need to use {{STATIC_URL }}. > > > On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote: >> >> Hi, >> >> In my template, when I made a reference to my Static folder.. what's the >> correct usage? >> >> {{STATIC_URL }} or {% static "" %} >> >> Django 1.7 and Python 3 >> >> Thanks! >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> > -- > 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/06ea6d9c-a224-49c9-93b5-4733ceab5111%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/06ea6d9c-a224-49c9-93b5-4733ceab5111%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZHfddQLPvxA%3D0thjDEP8Nb6OLD4yQPOR60feoDdR7Q67A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: {{STATIC_URL }} or {% static "...." %} What`s the correct to use?
Thanks, but I already try the docs, but my static files doesn't show! Show me 404 error.. even when I run manage.py collectstatic T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZF_RWXWCQTozSO%2BODqNuTyz-29VZ0pvjsw7Jsdosuw31Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
{{STATIC_URL }} or {% static "...." %} What`s the correct to use?
Hi, In my template, when I made a reference to my Static folder.. what's the correct usage? {{STATIC_URL }} or {% static "" %} Django 1.7 and Python 3 Thanks! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZGwzdxJK4r9ZDrbXbaov3m9pkFRusnnyM3fLHU41Y--RA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Django with ExtJs, any app ?
Hello, There's any app to make easier manipulate data using Django and ExtJ? T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEzk6TbTpNWtyiwYYJHf4Q8YVTs5VUvUgmmciT%2BZnze-A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
How to deplou 2 different django website in nginx?
Hi there! I`m trying to make my nginx server work with 2 domains, with 2 different django websites. So, I have a big, big problem here, because, when I type my domain2, appears my domain1... here is my 2 conf files I make to try to make 2 domains works. Can anyone tell me, what I'm doing wrong here? I have a big, big problem, because my domain2 (my second django website) will works with various sub-domains... I'm not getting create a domain, how can I create various subdomains? :) Best regards, [1] - http://pastebin.com/vu58wcu7 [2] - http://pastebin.com/bGwerd4A T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZEnwS0pR4myRcG396FWSNGT90EhL80dBM1R2m06RNhE1Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Any actual open project to create a company "social" network using Django?
Hi, There's any actual open project to create a company "social" network using Django? I search on google, and I don't find any project using django (or even other python framework) only PHP or Ruby... Thanks, Cheers! -- 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/04d8a954-9e94-48cf-ac9f-a08c7da1e22b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: static files in Django 1.7 ; Anything was change?
I in development mode, DEBUG = True. using the django server. I already run './manage.py collectstatic' they create all my static in my path.. but don't work... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* 2014-09-15 8:41 GMT-03:00 Vladimir Chukharev : > Yes, there are some changes, see release notes. In particular, you > probably need to run 'django-admin collectstatic'. > > -- > 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/ExbIrYMBKhs/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/ff527a78-0c27-4b99-89bc-34059132855a%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/ff527a78-0c27-4b99-89bc-34059132855a%40googlegroups.com?utm_medium=email&utm_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/CAF1jwZEsN8_fWq_SjhWZ-yTt-%2BXnQKZ1gTqgSJnoGw7EseXGgQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
static files in Django 1.7 ; Anything was change?
Hi everybody! I have my old project in Django 1.6, and works fine in development... when DEBUG=True.. but when I update to 1.7, stop to serving static files. Here is my files: url: https://gist.github.com/fellipeh/06746184ee0878f70bc2 template: https://gist.github.com/fellipeh/798b32661d4f9fe376ef What I missed? Thanks, regards, Fellipe H. -- 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/8690ea0f-35d9-49f2-b4e4-34bb80bdeb28%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: What is the best framework to develop one ERP in django?
Hi, >>This is a 'general' advice and not specific to Django. Yes, I know that, but I just ask, if anyone knows if any framework to work in these case exists... I don't use Bootstrap *and* Foundation.. I try both. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* 2014-05-02 11:12 GMT-03:00 Venkatraman S : > > On Fri, May 2, 2014 at 7:13 PM, Fellipe Henrique wrote: > >> >> I start to build my online version of my company ERP. >> >> But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to >> me bigger.. and we doesn't make a good screen for the user. >> > > Why do you need both Bootstrap and Foundation? It looks to me that you are > talking about UI design which is independent of Django. What you need is a > designer and a html/css guy who can convert that design into pages. > > >> I try to use Ext JS, but, I have some difficult to integrate with Django.. >> >> Anyone has another framework for these case? >> > > There is nothing called an 'ERP Framework' - you need to specify your > requirements and use the language/technology of your choice and convert > those specs into the product that you wish for. This is a 'general' advice > and not specific to Django. > > -V > > -- > 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/CAN7tdFQ-xZde%2BM80L5V55KHE-6wiPNtSzaHdic5P4Ydc27qkqg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAN7tdFQ-xZde%2BM80L5V55KHE-6wiPNtSzaHdic5P4Ydc27qkqg%40mail.gmail.com?utm_medium=email&utm_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/CAF1jwZGUEbiswQhtAvYHqFyT%2BGYaR0zY6cxR383zSg6z9JsiSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
What is the best framework to develop one ERP in django?
Hi everyone! I start to build my online version of my company ERP. But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to me bigger.. and we doesn't make a good screen for the user. I try to use Ext JS, but, I have some difficult to integrate with Django.. Anyone has another framework for these case? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZH7_ino6XVgstHr_PDqcPS7X8N%3Dinuitkgb%2BnE7A7Ft%3DA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There's any package to integrate jquery validation in my model forms?
There's any package to integrate jquery validation in my model forms? Cheers! T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpress.com/ <http://fhbash.wordpress.com/>* *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* -- 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/CAF1jwZH0K_8Spdo9LrNjdA7GsMQR%2BjNfTNrBrBod8YvgMynucg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
There is any POS software made in Django?
Hi, I'm started my django app, it's a POS software to control receivable, invoice of the costumer. There`s any software like that made using Django? Cheers -- 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/4f5c5511-86ed-465f-a83b-8e14cd80005f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: I really about to give up Django
form.instance is "Pedido" model, not "ItensPedido". My "ItensPedido" has "idproduto" not my "Pedido". and all idproduto has idmercadoria, it a required field, never, never go null`s this field. Cheers, Em sexta-feira, 23 de agosto de 2013 12h15min15s UTC-3, Mark escreveu: > > Are you sure the idmercadoria is not None on that idproduto record? > > {{ form.instance.idproduto.**idmercadoria }} Does this display anything? > How about {{ form.instance.idproduto }}? > > If these don't display, verify the records in your database. In Django > templates, if something is None or does not exist, it will not raise an > exception, it just ignores it and remains blank. Also verify the referencia > field is not empty. If the field is 'NOT NULL' then it will be an empty > string if it is blank. > > > > On Thu, Aug 22, 2013 at 12:58 PM, Fellipe Henrique > > > wrote: > >> No, nothing displayed.. >> >> Em quinta-feira, 22 de agosto de 2013 13h38min04s UTC-3, Mark escreveu: >>> >>> Try dropping the .value from referencia. Like {{ form.instance.idproduto. >>> **idmercadoria.referencia }}. Does this work? >>> >>> >>> On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique wrote: >>> >>>> I tried again.. and work if I have just 1 FK, if I have more then one, >>>> doesn't work, like this: >>>> >>>> I have this models: >>>> Itens -> produto -> mercadoria >>>> >>>> itens: >>>> idproduto = FK (produto) >>>> produto: >>>> idmercadoria = FK(mercadoria) >>>> mercadoria: >>>> referencia = Char >>>> >>>> I try to get "referencia" field, as you told: >>>> >>>> {{ form.instance.idproduto.**idmercadoria.referencia.value }} >>>> >>>> doesn't work.. what I miss? >>>> >>>> Here is my complete models, forms and view: http://pastebin.com/** >>>> w2TmyLzt <http://pastebin.com/w2TmyLzt> >>>> >>>> Cheers, >>>> >>>> >>>> Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe >>>> Henrique escreveu: >>>> >>>>> Ok, I read that, but the problem persist.. I try to use as you told, >>>>> but nothing show... and no errors appears.. >>>>> >>>>> Sorry about my first line.. I just stop here, simple problem, in more >>>>> then 1 day, and I don't find any solution, anything on internet to... >>>>> >>>>> Cheers >>>>> Fellipe >>>>> >>>>> >>>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Django users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to django-users...@**googlegroups.com. >>>> To post to this group, send email to django...@googlegroups.com. >>>> >>>> Visit this group at >>>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users> >>>> . >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/django-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: I really about to give up Django
No, nothing displayed.. Em quinta-feira, 22 de agosto de 2013 13h38min04s UTC-3, Mark escreveu: > > Try dropping the .value from referencia. Like {{ > form.instance.idproduto.idmercadoria.referencia }}. Does this work? > > > On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique > > > wrote: > >> I tried again.. and work if I have just 1 FK, if I have more then one, >> doesn't work, like this: >> >> I have this models: >> Itens -> produto -> mercadoria >> >> itens: >> idproduto = FK (produto) >> produto: >> idmercadoria = FK(mercadoria) >> mercadoria: >> referencia = Char >> >> I try to get "referencia" field, as you told: >> >> {{ form.instance.idproduto.idmercadoria.referencia.value }} >> >> doesn't work.. what I miss? >> >> Here is my complete models, forms and view: http://pastebin.com/w2TmyLzt >> >> Cheers, >> >> >> Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe Henrique >> escreveu: >> >>> Ok, I read that, but the problem persist.. I try to use as you told, but >>> nothing show... and no errors appears.. >>> >>> Sorry about my first line.. I just stop here, simple problem, in more >>> then 1 day, and I don't find any solution, anything on internet to... >>> >>> Cheers >>> Fellipe >>> >>> >>>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/django-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: I really about to give up Django
Hi Andre, I just post my current models, the first model it`s just example. My real model is this: http://pastebin.com/w2TmyLzt as a posted in my last email. As I told, if I get the "first" FK value works.. in my real problem, link above, I try to get "Mercadoria" values, from my "ItensPedido" but, between "ItensPedido" I have "Produto" model. if I do what Tom suggested, works if I get something from "Produto" model, but, when I try to get from "Mercadoria" I don't get anything, like this: {% for itens in formsetItens.forms %} {{ itens.intance.idproduto.codigobarra }} <<- Works fine! {{ itens.intance.idproduto.idmercadoria.referencia }} <<--- Don't work! Unfortunately this database, is a legacy database, used by your ERP Delphi software, and table was made this way.. :( And, unfortunately, if I rename all my models and fields to english probably I will make one mistake, because of this I put in my native language, sorry about that. Cheers Em quinta-feira, 22 de agosto de 2013 15h31min56s UTC-3, Andre Terra (airstrike) escreveu: > > For the record, it's considered a good coding practice to keep everything > in English, including classes, functions and variables. This way it's > easier for people to help you. > > Secondly, your Filhos model should really just be Filho. > > Finally, don't use obscure names like Brinq. Instead, prefer the verbose > 'Brinquedo'. > > So I suggest renaming things like this: > > Pai -> Parent > Brinq -> Toy > Filhos -> Child > > and so forth. > > > Cheers, > AT > > > On Thu, Aug 22, 2013 at 1:38 PM, Mark Furbee > > wrote: > >> Try dropping the .value from referencia. Like {{ >> form.instance.idproduto.idmercadoria.referencia }}. Does this work? >> >> >> On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique >> >> > wrote: >> >>> I tried again.. and work if I have just 1 FK, if I have more then one, >>> doesn't work, like this: >>> >>> I have this models: >>> Itens -> produto -> mercadoria >>> >>> itens: >>> idproduto = FK (produto) >>> produto: >>> idmercadoria = FK(mercadoria) >>> mercadoria: >>> referencia = Char >>> >>> I try to get "referencia" field, as you told: >>> >>> {{ form.instance.idproduto.idmercadoria.referencia.value }} >>> >>> doesn't work.. what I miss? >>> >>> Here is my complete models, forms and view: http://pastebin.com/w2TmyLzt >>> >>> Cheers, >>> >>> >>> Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe >>> Henrique escreveu: >>> >>>> Ok, I read that, but the problem persist.. I try to use as you told, >>>> but nothing show... and no errors appears.. >>>> >>>> Sorry about my first line.. I just stop here, simple problem, in more >>>> then 1 day, and I don't find any solution, anything on internet to... >>>> >>>> Cheers >>>> Fellipe >>>> >>>> >>>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to django-users...@googlegroups.com . >>> To post to this group, send email to django...@googlegroups.com >>> . >>> Visit this group at http://groups.google.com/group/django-users. >>> 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...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/django-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: I really about to give up Django
I tried again.. and work if I have just 1 FK, if I have more then one, doesn't work, like this: I have this models: Itens -> produto -> mercadoria itens: idproduto = FK (produto) produto: idmercadoria = FK(mercadoria) mercadoria: referencia = Char I try to get "referencia" field, as you told: {{ form.instance.idproduto.idmercadoria.referencia.value }} doesn't work.. what I miss? Here is my complete models, forms and view: http://pastebin.com/w2TmyLzt Cheers, Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe Henrique escreveu: > > Ok, I read that, but the problem persist.. I try to use as you told, but > nothing show... and no errors appears.. > > Sorry about my first line.. I just stop here, simple problem, in more then > 1 day, and I don't find any solution, anything on internet to... > > Cheers > Fellipe > > >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: I really about to give up Django
Ok, I read that, but the problem persist.. I try to use as you told, but nothing show... and no errors appears.. Sorry about my first line.. I just stop here, simple problem, in more then 1 day, and I don't find any solution, anything on internet to... Cheers Fellipe Em quinta-feira, 22 de agosto de 2013 12h19min31s UTC-3, Tom Evans escreveu: > > On Thu, Aug 22, 2013 at 3:28 PM, Fellipe Henrique > > > wrote: > > Hi guys, > > > > I really about to give up from Django, > > So should I bother giving you the advice you asked for, since you are > just going to give up on Django? > > > because? I try to do something simple > > and I looking, looking around the internet and don't find anything about > > this... try this simple example: http://pastebin.com/epazpBcZ > > > > I just want to get "descricao" field, from "Brinq" model, using a > > inlineformSet. > > > > I can't do this.. I try: {{ form.brinq__descricao }} , {{ > > form.brinq_id__descricao }}, {{ form.brinq.descricao }} and {{ > > form.brinq_id__descricao }} > > > > I think it`s simple thing to do.. but I don't found anything to do this > in > > internet.. > > > > Can any one help me in this simple question? > > > > Thanks. > > > > First of all, a model form that is bound to an instance of a model has > an attribute called 'instance' that represents the instance it is > bound to. This is mentioned all over the ModelForms documentation, eg > here: > > > https://docs.djangoproject.com/en/1.5/topics/forms/modelforms/#overriding-the-clean-method > > > and here: > > > https://docs.djangoproject.com/en/1.5/topics/forms/modelforms/#the-save-method > > > Therefore, if you want to output things related to that instance, you > can use it in your template: > > {{ form.instance.brinq.descricao }} > > > Cheers > > Tom > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: I really about to give up Django
Doesn't work, I tried this way, but same problem.. that's a simple thing to do with database, but I see anyone use this in django.. or I doing something really worng here, or django doesn't work for this type of query. Em quinta-feira, 22 de agosto de 2013 11h33min37s UTC-3, Raffaele Salmaso escreveu: > > {{ form.brinq.descricao }} ? > > On Thu, Aug 22, 2013 at 4:28 PM, Fellipe Henrique > > > wrote: > > Hi guys, > > > > I really about to give up from Django, because? I try to do something > simple > > and I looking, looking around the internet and don't find anything about > > this... try this simple example: http://pastebin.com/epazpBcZ > > > > I just want to get "descricao" field, from "Brinq" model, using a > > inlineformSet. > > > > I can't do this.. I try: {{ form.brinq__descricao }} , {{ > > form.brinq_id__descricao }}, {{ form.brinq.descricao }} and {{ > > form.brinq_id__descricao }} > > > > I think it`s simple thing to do.. but I don't found anything to do this > in > > internet.. > > > > Can any one help me in this simple question? > > > > 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...@googlegroups.com . > > To post to this group, send email to > > django...@googlegroups.com. > > > Visit this group at http://groups.google.com/group/django-users. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > -- > | Raffaele Salmaso > | http://salmaso.org > | https://bitbucket.org/rsalmaso > | http://gnammo.com > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
I really about to give up Django
Hi guys, I really about to give up from Django, because? I try to do something simple and I looking, looking around the internet and don't find anything about this... try this simple example: http://pastebin.com/epazpBcZ I just want to get "descricao" field, from "Brinq" model, using a inlineformSet. I can't do this.. I try: {{ form.brinq__descricao }} , {{ form.brinq_id__descricao }}, {{ form.brinq.descricao }} and {{ form.brinq_id__descricao }} I think it`s simple thing to do.. but I don't found anything to do this in internet.. Can any one help me in this simple question? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
How can I change BaseInLineFormSet queryset ?
Hi, I tried to change queryset in BaseInLineformset but I got this error: *metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases* * * Here my code: def BaseItensInlineFormSet(BaseInlineFormSet): def __init__(self, *args, **kwargs): super(BaseItensInlineFormSet, self).__init__(*args, **kwargs) self.queryset = ItensPedido.objects.select_related() def BaseItensInlineFormSet(BaseInlineFormSet): def __init__(self, *args, **kwargs): super(BaseItensInlineFormSet, self).__init__(*args, **kwargs) self.queryset = ItensPedido.objects.select_related() Here is my traceback: http://pastebin.com/GVfzzLYW I get this code from Django docs: https://docs.djangoproject.com/en/1.5/topics/forms/modelforms/#changing-the-queryset Why I got this error? How I fix them? 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can I get value from a FK model?
To add in my last comment, I need the Query bring me all related fields in all models.. all fields in one SQL, to get this field value in my template. Regards, Em quarta-feira, 21 de agosto de 2013 17h52min50s UTC-3, Fellipe Henrique escreveu: > > Ok, I have make a mistake, the correct is idpedido is only FK. and > 'iditenspedido' is a PK, the correct model is this: > > class ItensPedido(models.Model): > iditenspedido = models.IntegerField('Código', primary_key=True, > default=-1) > idpedido = models.ForeignKey('Pedido', db_column='idpedido', > default=-1) > idproduto = models.ForeignKey('Produto', db_column='idproduto') > preco = models.DecimalField(u'Vlr. Total', max_digits=18, > decimal_places=4, > null=False, default=0) > quantidade = models.DecimalField(u'Vlr. Total', max_digits=18, > decimal_places=4, null=False, > default=0) > precototal = models.DecimalField(u'Vlr. Total', max_digits=18, > decimal_places=4, null=False, > default=0) > > > I can't let's django create PK, because, this is a legacy database used by > your Delphi ERP software, and the table was made on this way ( it's crazy I > know, but I can't change anything in database now ). > > Thanks again. > > Em quarta-feira, 21 de agosto de 2013 17h41min45s UTC-3, Daniel Roseman > escreveu: >> >> On Wednesday, 21 August 2013 20:53:36 UTC+1, Fellipe Henrique wrote: >> >>> Hi, >>> >>> I got this models: http://pastebin.com/w2TmyLzt >>> >>> First: I used db_columns because I used a legacy database from company >>> ERP. >>> >>> I try to get, in my template the "descricao" field, in my "mercadoria" >>> model. but I have in my "itenspedido" only "idproduto" not "idmercadoria". >>> >>> My question is: how can I get "descricao" field from "mercadoria" model >>> in my formset? >>> >>> I tried {{ itens.idproduto.idmercadoria.descricao }} , {{ >>> itens.idproduto.idmercadoria.descricao.value }} and not work. >>> >>> P.S.: I use modelForm as default form, like this: >>> >>> class PedidoItensForm(ModelForm): >>> class Meta: >>> model = ItensPedido >>> >>> Thanks, >>> >>> Regards, >>> >> >> You have set `idpedido` as the primary key in the ItensPedido model. >> Primary keys are not modifiable so do not show up in forms. It makes no >> sense to that that as the PK in the joining table anyway: PK implies >> uniqueness, which means you can only have one ItensPedido per Pedido, which >> defeats the whole purpose of the many-to-many relationship. >> >> Remove the `primary_key=True` attribute and let Django create its own PK >> column. >> -- >> DR. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can I get value from a FK model?
Ok, I have make a mistake, the correct is idpedido is only FK. and 'iditenspedido' is a PK, the correct model is this: class ItensPedido(models.Model): iditenspedido = models.IntegerField('Código', primary_key=True, default=-1) idpedido = models.ForeignKey('Pedido', db_column='idpedido', default=-1) idproduto = models.ForeignKey('Produto', db_column='idproduto') preco = models.DecimalField(u'Vlr. Total', max_digits=18, decimal_places=4, null=False, default=0) quantidade = models.DecimalField(u'Vlr. Total', max_digits=18, decimal_places=4, null=False, default=0) precototal = models.DecimalField(u'Vlr. Total', max_digits=18, decimal_places=4, null=False, default=0) I can't let's django create PK, because, this is a legacy database used by your Delphi ERP software, and the table was made on this way ( it's crazy I know, but I can't change anything in database now ). Thanks again. Em quarta-feira, 21 de agosto de 2013 17h41min45s UTC-3, Daniel Roseman escreveu: > > On Wednesday, 21 August 2013 20:53:36 UTC+1, Fellipe Henrique wrote: > >> Hi, >> >> I got this models: http://pastebin.com/w2TmyLzt >> >> First: I used db_columns because I used a legacy database from company >> ERP. >> >> I try to get, in my template the "descricao" field, in my "mercadoria" >> model. but I have in my "itenspedido" only "idproduto" not "idmercadoria". >> >> My question is: how can I get "descricao" field from "mercadoria" model >> in my formset? >> >> I tried {{ itens.idproduto.idmercadoria.descricao }} , {{ >> itens.idproduto.idmercadoria.descricao.value }} and not work. >> >> P.S.: I use modelForm as default form, like this: >> >> class PedidoItensForm(ModelForm): >> class Meta: >> model = ItensPedido >> >> Thanks, >> >> Regards, >> > > You have set `idpedido` as the primary key in the ItensPedido model. > Primary keys are not modifiable so do not show up in forms. It makes no > sense to that that as the PK in the joining table anyway: PK implies > uniqueness, which means you can only have one ItensPedido per Pedido, which > defeats the whole purpose of the many-to-many relationship. > > Remove the `primary_key=True` attribute and let Django create its own PK > column. > -- > DR. > -- 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 can I get value from a FK model?
Hi, I got this models: http://pastebin.com/w2TmyLzt First: I used db_columns because I used a legacy database from company ERP. I try to get, in my template the "descricao" field, in my "mercadoria" model. but I have in my "itenspedido" only "idproduto" not "idmercadoria". My question is: how can I get "descricao" field from "mercadoria" model in my formset? I tried {{ itens.idproduto.idmercadoria.descricao }} , {{ itens.idproduto.idmercadoria.descricao.value }} and not work. P.S.: I use modelForm as default form, like this: class PedidoItensForm(ModelForm): class Meta: model = ItensPedido Thanks, 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to force modelForm.is_valid() to use a specific database?
The problem is: when usng modelForm, it try to validate the unique key in the database, and this validation use a default database.. if I remove primary_key=True in my model, work fine, but I need to set the pk in my model, because when I try to get using: obj.get(xx) show me error... I try every think.. and I start to think is not possible multi-db in "runtime" in django.. :( T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *Blog: http://fhbash.wordpress.com/* *GitHub: https://github.com/fellipeh* *Twitter: @fh_bash* 2013/7/23 Brian Millham > I've done that with this code: > > if form.is_valid(): >> f = form.save(commit = False) >> f.save(using='yourdatabase') > > > Works fine for me. > > > On Tuesday, July 23, 2013 1:21:29 PM UTC-4, Fellipe Henrique wrote: >> >> I have many database setted in my setting.py in my formModel, when I >> try to validate the form, show me error: >> >> http://stackoverflow.com/**questions/17797419/modelforms-** >> and-multiple-datasbase-error-**in-form-is-valid<http://stackoverflow.com/questions/17797419/modelforms-and-multiple-datasbase-error-in-form-is-valid> >> >> The problem is.. is_valid is going to "default" database... how can I >> force to got to another database? >> >> Thanks. >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
How to force modelForm.is_valid() to use a specific database?
I have many database setted in my setting.py in my formModel, when I try to validate the form, show me error: http://stackoverflow.com/questions/17797419/modelforms-and-multiple-datasbase-error-in-form-is-valid The problem is.. is_valid is going to "default" database... how can I force to got to another database? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Foreing Key field going null in INSERT sql when use inlineformset
I can't use AutoField, because I need to use my StoreProcedure. I use this StoreProcedure in my Delphi application. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) 2013/1/25 Anderson > Hi Felipe > try autoField is auto increment. > > > On Fri, Jan 25, 2013 at 4:53 AM, Fellipe Henrique wrote: > >> I have this models: >> >> >> class Pedido(models.Model): >> idvenda_pedido = models.IntegerField(verbose_name=u"Código", >> primary_key=True, null=False) >> num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True, >> null=True) >> >> class ItensPedido(models.Model): >> idvenda_pedido_itens = models.IntegerField(u'Código', >> primary_key=True, null=False, default=-1) >> idvenda_pedido = models.ForeignKey('Pedido', >> db_column='idvenda_pedido', null=False, blank=False) >> qnt = models.IntegerField(verbose_name=u'Quantidade', null=False, >> blank=False, default=1) >> >> >> When I save ItensPedido, the idvenda_pedido is null. How Can I pass the >> idvenda_pedido field? I try to pass the integer but django tell me it`s >> need a "pedido" not integer value. >> >> >> Thanks. >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae >> morales ad >> Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, >> Lucius Annaeus Seneca) >> >> *"Any intelligent fool can make things bigger, more complex, and more >> violent. It takes a touch of genius -- and a lot of courage -- to move in >> the opposite direction."* >> Albert Einstein (March 14th 1879 – April 18th 1955) >> >> -- >> 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. >> Visit this group at http://groups.google.com/group/django-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Anderson Dias Borges > Senior Analyst Developer > > Tu cumprirás o desejo do meu coração se eu Te buscar... > I can't see but I'll take my chances > To hear You call my name > > -- > 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 post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@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.
Foreing Key field going null in INSERT sql when use inlineformset
I have this models: class Pedido(models.Model): idvenda_pedido = models.IntegerField(verbose_name=u"Código", primary_key=True, null=False) num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True, null=True) class ItensPedido(models.Model): idvenda_pedido_itens = models.IntegerField(u'Código', primary_key=True, null=False, default=-1) idvenda_pedido = models.ForeignKey('Pedido', db_column='idvenda_pedido', null=False, blank=False) qnt = models.IntegerField(verbose_name=u'Quantidade', null=False, blank=False, default=1) When I save ItensPedido, the idvenda_pedido is null. How Can I pass the idvenda_pedido field? I try to pass the integer but django tell me it`s need a "pedido" not integer value. Thanks. T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) -- 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. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How can I execute a store procedure in django, using multi-database?
How can I execute a store procedure in django, using multi-database? Thanks T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) -- 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: Can I set a "global" variable after user login, to use in my view?
I don`t understand that.. in my form, I don't have the request, or I have? I know I have request in my view, but I need to pass UserProfile to my form, but inlineformset_factory doesn't accept to pass vUserProfile as parameter, even I modified __init__ to get this parameter. Here is my form code: http://pastebin.com/AeYUvX8S my view code: http://pastebin.com/rBzg0jM8 and the traceback: http://pastebin.com/0Z9NTF4G I need to pass UserProfile to my form, to modified the queryset "idproduto" field. How can I do these? PS: sorry my poor english... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) 2013/1/22 Tomas Neme > > vUserProfile=request.user.profile > or > vUserProfile=request.user.get_profile() > to be more flexible > > > > On Tue, Jan 22, 2013 at 5:01 PM, Fellipe Henrique wrote: > >> The problem is, I need to pass this request.user to one form, using a >> inlineformset_factory..in these code: >> >> class PedidoItensForm(ModelForm): >> class Meta: >> model = ItensPedido >> >> def __init__(self, *args, **kwargs): >> profile = kwargs.pop('vUserProfile', None) >> super(PedidoItensForm, self).__init__(*args, **kwargs) >> self.fields["idproduto"].queryset = >> Produto.objects.filter(idempresa=profile.idempresa) >> >> I need to pass UserProfile to my form, to get works my filter. >> >> If I use inlineformset_factory, how can I pass the vUserProfile ? >> >> >> Thanks >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae >> morales ad >> Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, >> Lucius Annaeus Seneca) >> >> *"Any intelligent fool can make things bigger, more complex, and more >> violent. It takes a touch of genius -- and a lot of courage -- to move in >> the opposite direction."* >> Albert Einstein (March 14th 1879 – April 18th 1955) >> >> >> 2013/1/22 Tomas Neme >> >>> >>> >>> what mengu says is good for templates, but not so for views. >>> >>> But lo! your request should have a .user property that points to the >>> currently logged user, so try >>> >>> request.user >>> >>> in your view >>> >>> >>> On Tue, Jan 22, 2013 at 4:49 PM, Mengu wrote: >>> >>>> hi fellipe, >>>> >>>> if you enable auth context processors and pass in RequestContext to >>>> render_to_response you can always access the user in your templates >>>> which also means you can access the associated profile as user.profile >>>> (assuming your model is named profile) >>>> >>>> please read more at >>>> https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates >>>> >>>> >>>> >>>> On Jan 22, 8:34 pm, Fellipe Henrique wrote: >>>> > Hello, >>>> > >>>> > It's possible, when the user make a login, I set one "global" >>>> variable, and >>>> > get this value in my view? >>>> > >>>> > My question is because I have a inlineformset_factory, and I need to >>>> pass a >>>> > user profile do my view.. but it`s doesn't work. >>>> > >>>> > Regards, >>>> > >>>> > T.·.F.·.A.·. S+F >>>> > *Fellipe Henrique P. Soares* >>>> > >>>> > *"Quemadmodum gladius neminem occidit, occidentis telum est."* >>>> (Epistulae >>>> > morales ad Lucilium< >>>> http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, >>>> > Lucius Annaeus Seneca) >>>> > >>>> > *"Any intelligent fool can make things bigger, more complex, and more >>>> > violent. It takes a touch of genius -- and a lot of courage -- to >>>> move in >>>> > the opposite direction."* >>>> > Albe
Re: Can I set a "global" variable after user login, to use in my view?
The problem is, I need to pass this request.user to one form, using a inlineformset_factory..in these code: class PedidoItensForm(ModelForm): class Meta: model = ItensPedido def __init__(self, *args, **kwargs): profile = kwargs.pop('vUserProfile', None) super(PedidoItensForm, self).__init__(*args, **kwargs) self.fields["idproduto"].queryset = Produto.objects.filter(idempresa=profile.idempresa) I need to pass UserProfile to my form, to get works my filter. If I use inlineformset_factory, how can I pass the vUserProfile ? Thanks T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) 2013/1/22 Tomas Neme > > > what mengu says is good for templates, but not so for views. > > But lo! your request should have a .user property that points to the > currently logged user, so try > > request.user > > in your view > > > On Tue, Jan 22, 2013 at 4:49 PM, Mengu wrote: > >> hi fellipe, >> >> if you enable auth context processors and pass in RequestContext to >> render_to_response you can always access the user in your templates >> which also means you can access the associated profile as user.profile >> (assuming your model is named profile) >> >> please read more at >> https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates >> >> >> >> On Jan 22, 8:34 pm, Fellipe Henrique wrote: >> > Hello, >> > >> > It's possible, when the user make a login, I set one "global" variable, >> and >> > get this value in my view? >> > >> > My question is because I have a inlineformset_factory, and I need to >> pass a >> > user profile do my view.. but it`s doesn't work. >> > >> > Regards, >> > >> > T.·.F.·.A.·. S+F >> > *Fellipe Henrique P. Soares* >> > >> > *"Quemadmodum gladius neminem occidit, occidentis telum est."* >> (Epistulae >> > morales ad Lucilium< >> http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, >> > Lucius Annaeus Seneca) >> > >> > *"Any intelligent fool can make things bigger, more complex, and more >> > violent. It takes a touch of genius -- and a lot of courage -- to move >> in >> > the opposite direction."* >> > Albert Einstein (March 14th 1879 – April 18th 1955) >> >> -- >> 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. >> >> > > > -- > "The whole of Japan is pure invention. There is no such country, there are > no such people" --Oscar Wilde > > |_|0|_| > |_|_|0| > |0|0|0| > > (\__/) > (='.'=)This is Bunny. Copy and paste bunny > (")_(") to help him gain world domination. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Can I set a "global" variable after user login, to use in my view?
Hello, It's possible, when the user make a login, I set one "global" variable, and get this value in my view? My question is because I have a inlineformset_factory, and I need to pass a user profile do my view.. but it`s doesn't work. Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) -- 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.
quantize result has too many digits for current context
Hello, I have this model: class ItensPedido(models.Model): idvenda_pedido_itens = models.IntegerField(u'Código', primary_key=True, null=False) idvenda_pedido = models.ForeignKey('Pedido', db_column='idvenda_pedido', null=False, blank=False) idproduto = models.ForeignKey('Produto', db_column='idproduto', verbose_name=u'Produto', null=False, blank=False) qnt = models.IntegerField(verbose_name=u'Quantidade', null=False, blank=False, default=1) preco_unit = models.DecimalField(u'Preço Unit.', max_digits=12, decimal_places=4, null=False, default=0) valor_total = models.DecimalField(u'Vlr. Total', max_digits=12, decimal_places=4, null=False, default=0) class Meta: managed = False db_table = 'venda_pedido_itens' and in my template I try to use: {{ form.idpedido }} but when I`m use this, django show me this error: quantize result has too many digits for current context I have lookup the internet and I see some error like this, but always about Decimals fields.. but in my case this error appears in Foreign Key field. My question is: Why this error appears? How can I fix this? Thanks for all, Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae morales ad Lucilium<http://en.wikipedia.org/wiki/Epistulae_morales_ad_Lucilium>, Lucius Annaeus Seneca) *"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."* Albert Einstein (March 14th 1879 – April 18th 1955) -- 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.
How to set a specific database to use in one ModelForm in Django?
I'm realy need to set a database to model form use to validate and save all data.. how can I pass this type of parameter? like .using(dbname) in view? Without use db route, because I need all auth database and select to get in a specific database all other is set in my UserProfile database name, and I I try to use router but doesn't work. I have this view: def editaCliente(request, pessoa_id=None): if request.user.is_authenticated(): profile = request.user.get_profile() if pessoa_id: cliente = Cliente.objects.using(profile.dbname).get(idpessoa=pessoa_id) else: cliente = None if request.method == 'POST': formPessoa = ClienteForm(request.POST, instance=cliente, vUserProfile=profile) if formPessoa.is_valid(): cliente = formPessoa.save(commit=False) cliente.idrepresentante = profile.id_comerx3c # passando o id do representante cliente.internet = 'S' cliente = formPessoa.save() if cliente: return redirect('listaCliente') else: formPessoa = ClienteForm(instance=cliente, vUserProfile=profile) return render_to_response( 'cliente_novo.html', locals(), context_instance=RequestContext(request), ) but when call formPessoa.is_valid() show me these error: ('Error while preparing SQL statement:\n- SQLCODE: -204\n- Dynamic SQL Error\n- SQL error code = -204\n- Table unknown\n- PESSOA\n- At line 1, column 41', u'-204 -- SELECT FIRST 1 (1) AS "A" FROM "PESSOA" WHERE "PESSOA"."IDPESSOA" = -1') Thats because the form doesn't get the correct database, it`s take a default database, what I'm use only for auth profiles. Here is my modelform code: class ClienteForm(ModelForm): class Meta: model = Cliente def __init__(self, *args, **kwargs): vUserProfile = kwargs.pop('vUserProfile', None) super(ClienteForm, self).__init__(*args, **kwargs) self.fields["idcidade"].queryset = Cidade.objects.using(vUserProfile.dbname).all() self.fields["idpessoa"].widget.attrs['class'] = "input-mini" Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ESrhZn8sqIwJ. 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.
How to use database router, only when using admin and user auth ?
Hello, I have a "dbname" field in my user Profile... and I have one database to store all default django data, like users, sessions etc.. when I try to get some ovject in a view, I will get to other database setted in "dbname" profile... I make this code: from django.contrib.auth.models import User from models import UserProfile import threading # Object to hold request data request_cfg = threading.local() class RouterMiddleware(object): """ Set a flag if we are accessing Django admin to prevent database rerouting for the auth model. Remove the flag once the request has been processed. """ def process_view(self, request, view_func, args, kwargs): if request.path.startswith('/admin'): request_cfg.admin = True def process_response(self, request, response): if hasattr(request_cfg, 'admin'): del(request_cfg.admin) return response class UserSessionRouter(object): """ Redirect database IO for the auth and sessions models to OldWebsite.com. """ def db_for_read(self, model, **hints): if not hasattr(request_cfg, 'admin'): if model._meta.app_label == 'auth': return 'default' elif model._meta.app_label == 'accounts': return 'default' elif model._meta.app_label == 'sessions': return 'default' else: return UserProfile.dbname return None def db_for_write(self, model, **hints): if not hasattr(request_cfg, 'admin'): if model._meta.app_label == 'auth': return 'default' elif model._meta.app_label == 'accounts': return 'default' elif model._meta.app_label == 'sessions': return 'default' else: return UserProfile.dbname return None But when I try to execute, show me these error: ImproperlyConfigured at / settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. I think the django doesn`t get the correct database to use... and I have set all database in DATABASE in settings.py In other words... all django default data use a "default" database, for all other data using a database setted in "dbname" in UserProfile. How can I use this? Best Regards, F.H. -- 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/-/S09tPoSdWAQJ. 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.