Re: __str__ and __unicode__ not working!!

2015-05-04 Thread James Schneider
Python 2 or Python 3? What code ate you using to print the object? A simple print statement? -James On May 4, 2015 3:20 PM, "Yann Ashuach" wrote: > In tutorial number one in django documentations, i have tried and tried > again, and neither the __str__ or the __unicode__

Re: DRF - Which Authentication to use?

2015-05-04 Thread Filipe Ximenes
This is an interesting question. This question enlights some possibilities: http://stackoverflow.com/questions/21978658/invalidating-json-web-tokens But none of then gives is a definitive solution. Does anyone have other ideas about the subject? On May 1, 2015 10:13 AM, "Nabeel Valapra"

Re: How to Process Multi Step Forms in Django?

2015-05-04 Thread Ken Nguyen
Nevermind what I said on my last post, something is internally wrong with my second form. It can't even render when I hard coded the first_name, last_name and the checkboxes. Still getting Management Form Data is Missing. {% load staticfiles %} User Information

Re: How to Process Multi Step Forms in Django?

2015-05-04 Thread Ken Nguyen
Hi Bernardo, Using your hidden method works. I can see the "hidden" value from Form2 but how do I use those hidden information in form2 so it can redisplay correctly? First time around, it will use the variable from form1. The second time around it should use the hidden information without

__str__ and __unicode__ not working!!

2015-05-04 Thread Yann Ashuach
In tutorial number one in django documentations, i have tried and tried again, and neither the __str__ or the __unicode__ is working! This has been a problem for quite a while now... The file i have attached is the code i have written. I have looked on many different sites, and haven't found

Re: How to Process Multi Step Forms in Django?

2015-05-04 Thread Bernardo Brik
Hi Ken, You are getting this error because you are missing this line in your template: {{ formset.management_form }} Take a look into the documentation: https://docs.djangoproject.com/en/1.8/topics/forms/formsets/#using-a-formset-in-views-and-templates You need to carry the information to your

Re: How to Process Multi Step Forms in Django?

2015-05-04 Thread Ken Nguyen
Thank you for the input. I've already tried what you've suggested but still the same result, "Management Form Data is Missing." It's not going to know the "first_name" and "last_name" the second time around since I have the variable {{ info.first_name }} and {{ info.last_name }} My*

How to show forms of formset as table

2015-05-04 Thread Himika Biswas
Hi, I have a model in models.py - using which I have created a form in forms.py. I am using formset in views.py But all the fields of these forms of formset are shown vertically one after another like: form1-field1 form1-field2 form1-field3 form2-field1 form2-field2 form2-field3 form3-field1

Using unaccent in order_by?

2015-05-04 Thread Neto
In Django 1.8 can use order_by(Lower('name')), has the order by unaccent too? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Tim Chase
On 2015-05-03 14:35, Matthys wrote: > I posted the question also on stackoverflow: > > http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model > > The question is for situations where a model instance relates to a > specific month, but not to a specific day.

Re: Leveraging the ORM for very complex queries

2015-05-04 Thread Michael Manfre
The internals of the ORM are deemed a private API and have undergone significant changes in the past without being constrained by the two release deprecation cycle. As some one who was forced to write query construction code based upon Django internals, my recommendation is to only do that if

Re: GUI with web-browser using Django, Python 3

2015-05-04 Thread Gergely Polonkai
Hello, you should walk through the Django tutorial[1] to get as idea on how to use it. However, if this is the sole problem, I think Django is overkill, a pure WSGI page would suffice. Best, Gergely [1] https://docs.djangoproject.com/en/1.8/intro/tutorial01/ On 4 May 2015 17:28, "Aura"

Re: django 1.8 customize site title

2015-05-04 Thread André Luiz
You can do it in in urls.py for example[1] [1]: https://gist.github.com/dvl/0bed149bee4556b32d7a 2015-05-02 5:55 GMT-03:00 drakkan : > Hi, > > I would like to customize django 1.8 site title without override the > template using AdminSite, > > I customized AdminSite as

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Matthys Kroon
Hi Erik, Thanks for your reply. I'm aware of the problems with timedelta(months=2), since the length of a month is not fixed, a length of time specified in months is ambiguous. Though months do have an internally consistent algebra as you point out and people often refer to time-periods in month

GUI with web-browser using Django, Python 3

2015-05-04 Thread Aura
I want to make a py-file by GUI. The GUI I want is based on web-browser (chrome, safari). So I use Django. The step-by-step idea is: 1. I open the web-browser (as GUI, not to access internet). On the web-browser, there are two blanks and a "Generate" button, like a = ??

Re: Fields outside Aggregation functions

2015-05-04 Thread Alex-droid AD
I didn't quite understand have I sent the answer to Somecallitblues... So write it once more Forgot about Stores... Let's look at Publisher and Book (those of Django documentation described) Here is table beneath for example: *Publisher* Publisher-a Publisher-b *Book* id 2 book_1 1$

Re: Fields outside Aggregation functions

2015-05-04 Thread Carsten Fuchs
Hi Alex, Am 04.05.2015 um 12:48 schrieb Alex-droid AD: So the question... How can I get records storemin/max price */_book ???_/* I recently had the same question, please see this thread: https://groups.google.com/forum/#!topic/django-users/adRe2_BWMz0 If you ever find a more direct

Re: Fields outside Aggregation functions

2015-05-04 Thread Mario Gudelj
Can you perhaps order by price and get first and last items? On 4 May 2015 8:48 pm, "Alex-droid AD" wrote: > > > There is example in Django documentation about using Aggregate and > Annotate clauses > > The same rules apply to the aggregate() clause. If you wanted to

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Erik Cederstrand
> Den 04/05/2015 kl. 14.21 skrev Erik Cederstrand : > > class Month(models.Model): >year = models.IntegerField() >month = models.PositiveSmallIntegerField() > >def add_months(self, n): >assert n >= 0 >dy, dm = divmod(self.month + n, 12) >

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Erik Cederstrand
> Den 04/05/2015 kl. 13.26 skrev Matthys Kroon : > > I'm specifically looking at only situations where the year and month alone > are significant. > > The downside I see with using a DateField and forcing the day to the first of > the month, with custom widget etc. is that

Re: How to represent a calendar month as a field in django models

2015-05-04 Thread Matthys Kroon
Hi, I'm specifically looking at only situations where the year and month alone are significant. The downside I see with using a DateField and forcing the day to the first of the month, with custom widget etc. is that somebody looking at the database may not realize that something unusual is

Re: Leveraging the ORM for very complex queries

2015-05-04 Thread Suriya Subramanian
Hi Russ, Thank you for your answer. I am aware of raw. However, that's now what I am looking for. Let me give a few examples of queries that I would like to write: 1) Window functions over an ORM query: SELECT "date", SUM("weight__sum") OVER (ORDER BY "date") FROM (

Re: Deploying django

2015-05-04 Thread Mike Dewhirst
On 4/05/2015 6:43 PM, João Marques wrote: Oh I get it. I have a few questions: 1. Wheres should I configure my nginx? /etc/nginx (probably) This is part of my nginx config ... location /static/ { root/home/mike/envs/myproject/static; access_log off;

Fields outside Aggregation functions

2015-05-04 Thread Alex-droid AD
There is example in Django documentation about using Aggregate and Annotate clauses The same rules apply to the aggregate() clause. If you wanted to know the lowest and highest price of any book that is available for sale in a store, you could use the aggregate:

Re: Deploying django

2015-05-04 Thread João Marques
Oh I get it. I have a few questions: 1. Wheres should I configure my nginx? 2. Is there a any problem with my project folder structure? Because I do have my templates outside the static folder... ├── costum ├── manage.py ├── psi │ ├── __init__.py │ ├── __init__.pyc │ ├── middlewares.py │

Re: Deploying django

2015-05-04 Thread João Marques
Thanks for the answer, what are this configuration files that you speak of? I really don't know much about this whole deployment thing. From what i remenber i configured apache configuration and something called available-sites... On Sunday, 3 May 2015 22:24:07 UTC+1, Fellipe Henrique wrote:

Re: How to find a view in a complex web application

2015-05-04 Thread guettli
Hi Derek, yes, your previous answer already contained information what the database schema could be. This schema is not related to my application at all. At least I think so. This would be generic and reusable. I think there is a better solution than starting plumbing this for myself. Maybe