Wednesday, December 31, 2014

Re: Create an OAuth2 Client Application problem

I did a stupid mistake. I use oauth2 before using django auth and create user.

On Wednesday, December 31, 2014 10:33:34 AM UTC+3:30, Hossein Rashnoo wrote:
Hi
I follow this tutorial and here i got error. when i try to access http://localhost:8000/o/applications/ its redirect to  http://localhost:8000/accounts/login/?next=/o/applications/ and django 404 error appear that tells:
The current URL, accounts/login/, didn't match any of these.
Please help me.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/5d86d539-d9a5-4a81-bfaa-53842b5543d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to generate the docs with the new style?

ah, thank you :)
i hope they will include it sonner ^_^

Le mardi 30 décembre 2014 14:51:51 UTC+1, Tim Graham a écrit :
Unfortunately, the offline docs use an entirely separate layout/theme so the new styles would need to be copied manually over here: https://github.com/django/django/tree/master/docs/_theme/djangodocs

I think it's a non-trivial amount of work and tricky because we are using things like web fonts on the main site. It's not a high priority in my mind.

On Monday, December 29, 2014 7:33:57 PM UTC-5, Aliane Abdelouahab wrote:
hi, i asked the question in SO but still nothing, can the devs share the new style to the github repo?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/08944270-369f-4ac4-a28f-718b8d2db5e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

FormSets with arbitary number of forms

I've been reading the documentation on FormSets and must admit that I am
a bit confused.

I have a model called Album that contains many Songs. But when a user
creates a new album I have no idea how many songs the Album will contain.

So I want to create a FormSet that has an Album form and many Song forms
but I need the user to be able to decide how many Song forms there are
in advance. Is this possible?

I might be misunderstanding the documentation but I couldn't see anything.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/54A447A2.4010804%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Write Multiple Text Files into a Single CSV File



On Tuesday, December 30, 2014 9:54:10 PM UTC-8, Martin Mirero wrote:
Hi folks,

I'm just cutting my teeth on Python/Django and need some assistance on something I've been grappling with for a few days:
  • I have a bunch of text files on disk that all have the same basic format: first line is the title and the rest is the body
  • I want to create one CSV file with the first column being populated from the first line of each text file (title) and the second column being populated from the rest of the text file contents (body)
  • Once I have the CSV file, I'm good to import that into my django model

Depending on your use case, there may be an easier (or more efficient way) to skin this cat. Both mysql and postgres have syntax that will let you load an entire csv into a db table as a one-liner. To do that from within Django, you need to be able to run an external shell command, and the best way to do that is (often) with Fabric. And since this is a function you'll likely want to do on a regular basis, it makes sense to wrap it all up in a Django management command.

Here's an excerpt of some code I use to do something similar:

http://pastebin.com/crpnNVrx

This is located in someapp/management/commands/import_courses.py . With this in place I can run

./manage.py import_courses

at any time. On each run, it:

- Drops a temporary table 
- Re-creates that temporary table according to a predefined postgres schema (contained in importer_courses.sql)
- Imports the CSV into that temporary table

In my case, I needed to be able to perform queries across the CSV data *before* importing some of it into my real models, but this turned out to be a wonderfully efficient way of handling CSV data in general. You don't have to drop and recreate the temp table each time - I chose to do it that way for my use case but season to taste.

To use this technique you'll need to `pip install fabric`, set a directory location where your CSVs are located (as IMPORTER_DATA_DIR in your settings), and read up a bit on Fabric and Django management commands. Then you'll need to modify it to handle multiple CSVs rather than just one.

./s


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/178e2096-a9b7-4f92-8d7a-f375371a527e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

create unmanaged model to oracle view/synonym

Hello, is possible with Django 1.7 create a unmanaged Django model for Oracle database View?

I succeeded in doing this using sqlalchemy, However, would like to use Django and Django ORM.

--
Fábio C. Barrionuevo da Luz
Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - FACTO
Palmas - Tocantins - Brasil - América do Sul


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+unsubscribe@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/CAPVjvMbnDZtRCU_2%2BW1D_V00jPJ0Ur6WsjM9Jzuj6bMfhp7gFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Write Multiple Text Files into a Single CSV File

I'm not too sure about the format of the content, but maybe this to create the file?

import csv

files = ['f1.txt', 'f2.txt', 'f3.txt']

with open('output.csv', 'wb') as f:
    writer = csv.writer(f)
    for input_file_name in files:
        with open(input_file_name, 'r') as input_file:
            lines = input_file.readlines()
            title = lines[0].strip()
            content = ' '.join(line.strip() for line in lines[1:])
            writer.writerow([title, content])


On Wed, Dec 31, 2014 at 2:54 AM, Martin Mirero <mmirero@gmail.com> wrote:
Hi folks,

I'm just cutting my teeth on Python/Django and need some assistance on something I've been grappling with for a few days:
  • I have a bunch of text files on disk that all have the same basic format: first line is the title and the rest is the body
  • I want to create one CSV file with the first column being populated from the first line of each text file (title) and the second column being populated from the rest of the text file contents (body)
  • Once I have the CSV file, I'm good to import that into my django model
Any help would be much appreciated.

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+unsubscribe@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/07a9375c-4b05-42cc-a46e-0337ce96d6e7%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+unsubscribe@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/CALn3ei17oJMCcDTdyJf-6y1wsJJO4Or2%3DgVMWYFMns45FRNtzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Create an OAuth2 Client Application problem

The current URL, accounts/login/, didn't match any of these. says that you dont have this url "accounts/login/" mapped in your urls.py file

2014-12-31 9:14 GMT+00:00 James Schneider <jrschneider83@gmail.com>:

Hello,

Without seeing your code, it is difficult to tell you exactly what is wrong, but your view is requiring the user to already be logged in, and since it isn't, Django is redirecting you to the default LOGIN_URL setting, which is not defined in your urls.py.

https://docs.djangoproject.com/en/1.7/ref/settings/#login-url

We'll need more information, such as relevant code snippets and a list of modules used to provide a better answer.

-James

On Dec 30, 2014 11:03 PM, "Hossein Rashnoo" <mhr1224@gmail.com> wrote:
Hi
I follow this tutorial and here i got error. when i try to access http://localhost:8000/o/applications/ its redirect to  http://localhost:8000/accounts/login/?next=/o/applications/ and django 404 error appear that tells:
The current URL, accounts/login/, didn't match any of these.
Please help me.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/d1d60238-c0f0-4704-b41d-5d8224ca5da5%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+unsubscribe@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/CA%2Be%2BciXq8zrB0cYRjed9cPrkOqU07zRDAPo8m4koAVKBPbj6fw%40mail.gmail.com.

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



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/CA%2BxOsGATqui0hcH2%2BCgx4%2BQTaw2Cozd4C8uP2y9aRL4SxTA_Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

accessing input tag values(which are created dynamically) from html in backend(python) using post method

Hi guys i am new to html and javascript. my application is to create a table from a list of list went from backend, after creating them dynamically(as length of the list is not known) i need to access some particular values of the table in python backend, when i tried to do this i am able to fetch the value in backend, but the value is not the desired value. The value which it returns is the last element of that table.

given below is my code

 {% for result in list1 %}
 <tr id="tr_id">
    <!-- <form id="listOfSearch{{result.0}}" name="listOfSearch" method="post" action="/fetch_candid/"> -->
    <form id="listOfSearch{{result.0}}" name="listOfSearch" method="post" action = "/fetch_candid/">
   
     <td>
    <a href="#" onclick="document.forms['listOfSearch{{result.0}}'].submit();">{{result.0}}
    <input name="uniqID" value="{{result.0}}" id="IdField" type="hidden" >
    </a></td>

    <input  name="save" value="0" type="hidden">
   
    <input  name="listresult" value="{{list1}}" type="hidden">
     <input type="hidden" id="statusofresume123" name="statusofresume123" value="{{sres}}">
      <input type="hidden" id="Client1" name="Client1" value="{{client}}">
      <input type="hidden" id="ReqId1" name="ReqId1" value="{{reqid}}">
      <input type="hidden" id="only_skills" name="only_skills" value="{{only_skills}}">
      <input type="hidden" id="mbno" name="mbno" value="{{mbno}}">
     <input type="hidden" id="ReqId" name="ReqId" value="{{reqid4}}">
      <input type="hidden" id="Client" name="Client" value="{{client2}}">
       <input type="hidden" id="Name" name="Name" value="{{Name}}">
       <input type="hidden" id="datepicker" name="datepicker" value="{{Date1}}">
       <input type="hidden" id="datepicker1" name="datepicker1" value="{{Date2}}">
       <!-- <form id="listOfSearch{{result.0}}" name="listOfSearch" method="post" action="/fetch_candid/"> -->
    <td style="padding:5px; width:50px;">
   
   
    <select style="padding:5px; width:102%;"  onchange="savestate({{result.0}});" class="select11" id="status8" name="status8" title="Choose Status">
     <option id="status8"  name="status8" >{{result.1}}</option>
     
     
     {% if result.1 == "HR_Interview" %}
     
      <option id="status8"  name="status8">COL</option>
     
     
      {% elif result.1 == "Internal_Interview" %}
     
      <option id="status8"  name="status8">HR_Interview</option>
      <option id="status8"  name="status8">COL</option>
     
     
      {% elif result.1 == "COL" %}
     
      <option id="status8"  name="status8">CS</option>
     
     
      {% elif result.1 == "CI" %}
     
      <option id="status8"  name="status8">CIS</option>
     
     
      {% elif result.1 == "CIS" %}
     
      <option id="status8"  name="status8">Joining</option>
     
     
     
     {% elif result.1 == "CS" %}
     
      <option id="status8"  name="status8">CI</option>
     
     
      {% elif result.1 == "Line_up" %}
     
      <option id="status8"  name="status8">Internal_Interview</option>
       <option id="status8"  name="status8">HR_Interview</option>
       <option id="status8"  name="status8">COL</option>
     
     {% endif %}
     
      </select>
       <input class="css_save1" type="submit" name="save" value="Save" onclick = "function9(this);">
       <input type="hidden" id="name" name="name" value={{name}}>

<input name="uniqID1" value="{{result.0}}" id="IdField" type="hidden" >
<input type="hidden" id="name" name="name" value={{name}}>
</td>

 <!-- </form>  -->
 

    <td class="reqid1">{{result.2}}</td>
    <td>
    {{result.3}}
    <input name="Client18" id="Client18" type="hidden" value="{{result.3}}">
    </td>
    <td>
    {{result.4}}
    <input name="name18" id="name18" type="hidden" value="{{result.4}}">
    </td>
    <td>{{result.5}}</td>
    <td>{{result.6}}</td>
    <td>{{result.7}}</td>
    <td>{{result.8}}</td>
    <td>{{result.9}}</td>
    <td>{{result.10}}</td>
    <td>{{result.11}}</td>
    <td>{{result.12}}</td>
    <td>{{result.13}}</td>
    <td>{{result.14}}</td>
    <td>{{result.15}}</td>
    <td>{{result.16}}</td>
    <td>{{result.17}}</td>
   
<input type="hidden" id="name" name="name" value={{name}}>
      </form>
       
<script>
    function function9(x)
    {
    var id = $(x).closest("tr").find('td:eq(1)').find("#status8 option:selected").text();
    var Client18 = $(x).closest("tr").find('td:eq(3)').text();
    var name18 = $(x).closest("tr").find('td:eq(4)').text();
    console.log("fetched value>>>",id,Client18,name18);         
         if (id == "COL")        
                {
                var r=confirm("Do you want to generate COL NOW ?");
                    if (r == true)
                    {
                    alert("before");
                    document.getElementById("listOfSearch{{result.0}}").action ="/hrpage/";
                    document.getElementById("listOfSearch{{result.0}}").method = 'POST';
                    document.getElementById("listOfSearch{{result.0}}").submit();
                    alert("after");
                    }
                    else
                    {
                    document.getElementById("listOfSearch{{result.0}}").submit();
                    }
                }
        else
                {
                document.getElementById("listOfSearch{{result.0}}").submit();
                }
        <!-- return response; -->
    }
</script> 
 my application is when i press on the save button i need to get that particular row's client name and candidate name
kindly help me with this

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

Re: Create an OAuth2 Client Application problem

Hello,

Without seeing your code, it is difficult to tell you exactly what is wrong, but your view is requiring the user to already be logged in, and since it isn't, Django is redirecting you to the default LOGIN_URL setting, which is not defined in your urls.py.

https://docs.djangoproject.com/en/1.7/ref/settings/#login-url

We'll need more information, such as relevant code snippets and a list of modules used to provide a better answer.

-James

On Dec 30, 2014 11:03 PM, "Hossein Rashnoo" <mhr1224@gmail.com> wrote:
Hi
I follow this tutorial and here i got error. when i try to access http://localhost:8000/o/applications/ its redirect to  http://localhost:8000/accounts/login/?next=/o/applications/ and django 404 error appear that tells:
The current URL, accounts/login/, didn't match any of these.
Please help me.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/d1d60238-c0f0-4704-b41d-5d8224ca5da5%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+unsubscribe@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/CA%2Be%2BciXq8zrB0cYRjed9cPrkOqU07zRDAPo8m4koAVKBPbj6fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Tuesday, December 30, 2014

Create an OAuth2 Client Application problem

Hi
I follow this tutorial and here i got error. when i try to access http://localhost:8000/o/applications/ its redirect to  http://localhost:8000/accounts/login/?next=/o/applications/ and django 404 error appear that tells:
The current URL, accounts/login/, didn't match any of these.
Please help me.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/d1d60238-c0f0-4704-b41d-5d8224ca5da5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Write Multiple Text Files into a Single CSV File

Hi folks,

I'm just cutting my teeth on Python/Django and need some assistance on something I've been grappling with for a few days:
  • I have a bunch of text files on disk that all have the same basic format: first line is the title and the rest is the body
  • I want to create one CSV file with the first column being populated from the first line of each text file (title) and the second column being populated from the rest of the text file contents (body)
  • Once I have the CSV file, I'm good to import that into my django model
Any help would be much appreciated.

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+unsubscribe@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/07a9375c-4b05-42cc-a46e-0337ce96d6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't save input to database

the code sample links are broken :(

On Tue, Dec 30, 2014 at 4:59 PM, Thomas Lockhart <tlockhart1976@gmail.com> wrote:
On 12/30/14 11:42 AM, Ronis wrote:
Hi guys, I can't save the input from a custom form to database. I don't know what I am missing.
I'm not sure either. But the html form you posted looks a *lot* like any template you might find in a django deployment. If it were me I'd look harder at just tying that in to the "usual places" and be done with it. That will give you form validation etc nearly for free and save the next person who is looking at your code from having to figure out what you did. Patterns and idioms save a lot of thinking best used elsewhere...

hth

- Tom



Because it's using a downloaded template from the web, I'm not using the django forms. Instead, I'm trying to simply save the input from the html form to the database. Im using the standard database when you create a django project. When I checked the admin the inputs are not saved. 

Here is my code: 






I'm a newbie programmer btw, this may be simple solution but I've spent some time and couldn't figure it 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+unsubscribe@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/ca13d351-0075-4000-902d-3f8755cb775e%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+unsubscribe@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/54A3043E.10401%40gmail.com.

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/CALn3ei1RG_QOb4%3DDuCz1rhejp3d5c3OWBWLg_bA0hJzJhx_OmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: delete OnetoOneField link

thank you. you give me more confidence

вторник, 30 декабря 2014 г., 17:19:53 UTC+3 пользователь Vijay Khemlani написал:
If you want to change a user's cashbox then yes, you would need to use your solution, but it's easier to get c1 by just saying

c1 = user.cashbox

instead of Cashbox.objects.get....

A more definite solution would be to add the OneToOne relation to the User model instead of the Cashbox object, but I'm not sure how that works in your project.

On Tue, Dec 30, 2014 at 6:56 AM, madjardi <malinich...@gmail.com> wrote:
class Cashbox(models.Model):
    cashier
= models.OneToOneField('User', null=True, blank=True, related_name='cashbox', on_delete=models.SET_NULL)

in other code:
User.object.get(pk=1)
user
.cashbox = None

AttributeError: 'NoneType' object has no attribute 'cashier_id'

one version solving is:
c1 = Cashbox.objects.get(pk=user.cashbox.id)
c1
.cashier = None
c1
.save()


c2
= Cashbox.object.get(pk=10)
c2
.cashier = user
c2
.save()


i need get other Cashbox to set link None. Why i need do so. is there a better solution.

--
You received this message because you are subscribed 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/9bac63fa-64e3-4353-82ae-6b31fa8f281f%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+unsubscribe@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/4f327604-9cf0-4ba2-95f4-e2f116f75867%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't save input to database

On 12/30/14 11:42 AM, Ronis wrote:
Hi guys, I can't save the input from a custom form to database. I don't know what I am missing.
I'm not sure either. But the html form you posted looks a *lot* like any template you might find in a django deployment. If it were me I'd look harder at just tying that in to the "usual places" and be done with it. That will give you form validation etc nearly for free and save the next person who is looking at your code from having to figure out what you did. Patterns and idioms save a lot of thinking best used elsewhere...

hth

- Tom


Because it's using a downloaded template from the web, I'm not using the django forms. Instead, I'm trying to simply save the input from the html form to the database. Im using the standard database when you create a django project. When I checked the admin the inputs are not saved. 

Here is my code: 






I'm a newbie programmer btw, this may be simple solution but I've spent some time and couldn't figure it 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+unsubscribe@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/ca13d351-0075-4000-902d-3f8755cb775e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Can't save input to database

Hi guys, I can't save the input from a custom form to database. I don't know what I am missing. 

Because it's using a downloaded template from the web, I'm not using the django forms. Instead, I'm trying to simply save the input from the html form to the database. Im using the standard database when you create a django project. When I checked the admin the inputs are not saved. 

Here is my code: 


Views.py -> https://dpaste.de/SCBi

Models.py -> https://dpaste.de/3NX3

Admin.py -> https://dpaste.de/OWLS

htmlform -> https://dpaste.de/11DP

I'm a newbie programmer btw, this may be simple solution but I've spent some time and couldn't figure it 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+unsubscribe@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/ca13d351-0075-4000-902d-3f8755cb775e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django App for synchronizing File upload

Hi,

There are a bunch of modules list here that should do what you want.
https://www.djangopackages.com/grids/g/ajax-file-uploading/

Collin

On Monday, December 29, 2014 10:45:54 AM UTC-5, Abdulhakim Haliru wrote:
Hello Guys,


Here is my requirements.. I need to upload heavy files to a django app. the users should be able to sync the file upload in the background. 

This technique can be seen in file sharing services like 4shared and dropbox. I know java is the way to go but I am wondering if something like that is obtainable with django or any other python module?

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+unsubscribe@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/2985b5ed-217d-4bd8-b521-f181c543ab53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Error when change a CharField to IntegerField

before was empty, but I deleted the column and remade, thanks

Em terça-feira, 30 de dezembro de 2014 11h52min14s UTC-2, Neto escreveu:
I changed a CharField to IntegerField and when I did ./manage.py migrate, appeared the message on terminal:

django.db.utils.ProgrammingError: column "rotulo" cannot be cast automatically to type integer HINT:  Specify a USING expression to perform the conversion.

What is it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/9d3a5dae-2dc9-4654-a6c2-94e3eeb8bbe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bristol (UK) startup seeks awesome Python/Django engineer

## Summary

Small startup in Bristol currently looking for an awesome software engineer to work on our existing code base.

Ideally you'd be located in Bristol/Bath and be able to work from our office, or be able to visit our offices on a weekly basis, but remote/home working is also negotiable. You would have prior experience of working for a small startup and/or handling all technical aspects of building a tech product. 

Our product is similar to Launch27, allowing customers to book a product, which is then allocated to groups within our workforce, and the lifecycle of a job is handled via our backend systems. This is not your typical boring Django integration job, there are some mundane parts but overall you should find this work quite pleasant.

Reply with why you think this role is interesting, and talk about any relevant experience you have with the technologies mentioned. Provide github links, code examples (gist/github/pastebin etc only pls, don't attach files), and anything else that makes you stand out from the rest. Interview would consist of a 1 hour phone call, and a decision made same/following day. Earliest start date would be 5th Jan.

## Tech specs

Stack: Python, Django, CircleCI, Github, DigitalOcean, Docker, MongoDB, Percona MySQL, Sentry, New Relic, LogEntries, Twilio, Slack, Vagrant, Trello, Stripe, TDD, Redis, RQ, CloudFlare, Python libs: django-debug-toolbar, freezegun, python-requests, freezegun, django-devserver, mongoengine, rq, django-rq

Primarily this is a Python role extended an existing API backend. We have complete separation between backend and frontend to ensure modularity and other developers working on the frontend. In future, we will have mobile integrations so it's absolutely imperative that the API is decoupled.

You may need to do other devops/research stuff, such as debugging prod instances, fixing memory leaks, diagnosing outages, settings up servers, fixing DNS, repairing build systems and all the other stuff that goes around a project.

All existing code follows TDD principles, has extensive commenting and is overall fairly clean, but with room for improvement on some of the core modules. Comes with CI build testing using Circle and ready to go Vagrant scripts. Our unit tests use time travel via freezegun, this allows us to test date/time sensitive functionality by means of monkeypatching. For example, ensuring that a subscription is terminated if a payment cannot be taken after 7 days. Every single piece of logic can be unit tested using a single command, and a full test suite takes around 60 seconds (not incl dependancies).

Ideal candidate would understand the importance of TDD, have good all-round knowledge of Python, and know their way around Django. You should understand the following without too much problem;

* How objects/classes works in Python (metaclasses, MROs etc would be a bonus)
* Python syntax (operators, list comprehensions, lambdas etc)
* Python stdlibs (itertools, os, sys, urllib etc)
* Stripe API for handling payments, invoices etc
* Job queues using rq/redis
* Document store using MongoEngine
* Demonstrate good understanding of what it means to be a software engineer
* Good knowledge of our stack

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/09dd12a3-86cc-4ca8-a392-b0bede493f26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Error when change a CharField to IntegerField

Hi, did the column had previus non-integer data in it?

2014-12-30 8:52 GMT-05:00 Neto <paulosouzamaciel@gmail.com>:
I changed a CharField to IntegerField and when I did ./manage.py migrate, appeared the message on terminal:

django.db.utils.ProgrammingError: column "rotulo" cannot be cast automatically to type integer HINT:  Specify a USING expression to perform the conversion.

What is it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/67d68cf4-4feb-4656-b8e0-2651f9e25830%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jorge Andres Vergara Ebratt
#SoftwareDeveloper (Or at least trying to be)
@javebratt

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/CAAeX05HV5j6X1%2Bw7XvEJb1Sb4Sux3dNUZJrBUzfnP-_8-ap2ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: delete OnetoOneField link

If you want to change a user's cashbox then yes, you would need to use your solution, but it's easier to get c1 by just saying

c1 = user.cashbox

instead of Cashbox.objects.get....

A more definite solution would be to add the OneToOne relation to the User model instead of the Cashbox object, but I'm not sure how that works in your project.

On Tue, Dec 30, 2014 at 6:56 AM, madjardi <malinich.malinka@gmail.com> wrote:
class Cashbox(models.Model):
    cashier
= models.OneToOneField('User', null=True, blank=True, related_name='cashbox', on_delete=models.SET_NULL)

in other code:
User.object.get(pk=1)
user
.cashbox = None

AttributeError: 'NoneType' object has no attribute 'cashier_id'

one version solving is:
c1 = Cashbox.objects.get(pk=user.cashbox.id)
c1
.cashier = None
c1
.save()


c2
= Cashbox.object.get(pk=10)
c2
.cashier = user
c2
.save()


i need get other Cashbox to set link None. Why i need do so. is there a better solution.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/9bac63fa-64e3-4353-82ae-6b31fa8f281f%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+unsubscribe@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/CALn3ei3UMe1O64gjup_ZvTjuH%3D_JZfEfO%3D5%3DTOTmPVo7QHDHoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Error when change a CharField to IntegerField

I changed a CharField to IntegerField and when I did ./manage.py migrate, appeared the message on terminal:

django.db.utils.ProgrammingError: column "rotulo" cannot be cast automatically to type integer HINT:  Specify a USING expression to perform the conversion.

What is it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/67d68cf4-4feb-4656-b8e0-2651f9e25830%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to generate the docs with the new style?

Unfortunately, the offline docs use an entirely separate layout/theme so the new styles would need to be copied manually over here: https://github.com/django/django/tree/master/docs/_theme/djangodocs

I think it's a non-trivial amount of work and tricky because we are using things like web fonts on the main site. It's not a high priority in my mind.

On Monday, December 29, 2014 7:33:57 PM UTC-5, Aliane Abdelouahab wrote:
hi, i asked the question in SO but still nothing, can the devs share the new style to the github repo?

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

Re: Django vs ExtJS

Hi Joris,
some of the best arguments for python + django,
you could find here - :

https://www.paypal-engineering.com/2014/12/10/10-myths-of-enterprise-python/
...
One language in particular has both a long history at eBay and PayPal and a growing mindshare among developers: Python.
...


Thanks
Frank

Am Dienstag, 30. Dezember 2014 11:44:20 UTC+1 schrieb Joris Benschop:
Thank you both for these answers. Personally Im already convinced of Django, but the trick is to convince others. The strong benefit of java is that it is really easy to hire senior java developers on a consultancy basis. For django it is not so simple, especially when the requirement is to have these devs on-site (.nl / .be area).



Op 30 dec. 2014 om 11:36 heeft Ariel Calzada <ariel....@gmail.com> het volgende geschreven:

DJANGO + Tastypie is your TEAM for REST Services, forget Java :)

2014-12-30 5:34 GMT-05:00 Guilherme Leal <leal...@gmail.com>:
Given your scenario, we can say that with django, you wouldn't have to worry about creating REST services. You would create only one service, and let django manage the backend switch (with db routers). If you build your service well, you would have an abstract REST view/url generator (tastypie for instance), and with a little bit of effort (REALLY little), you could serialize the resource structure (metadata) on the request, and let ExtJS read that structure to build your frontend. Of course, this aproach requires a little bit of cache (to save some time on the read structure/build html for ExtJS). With that, you would have to write basically only the models (and of course, any exceptional case that might occur). And if you use django 1.7+, you can LITTERALLY forget about db admin, since django handles the migrations as well.

I've done basically the same thing with Django REST Framework and AngularJS for the frontend. Works like a charm, and with the business logic on the signals, reduces the dev time by 90%. And worls like a charm.

Em Tue Dec 30 2014 at 06:47:19, Joris Benschop <joris.b...@gmail.com> escreveu:

Thank you, this is already very helpful.
Currently company policy is to create REST services in java for each backend and use ExtJS to query and visualize the results. With DJango I'm trying to combine these into one, whilst staying compatible by using tastypie as a REST service (so ExtJS can connect to that).

joris



On 29-12-14 16:51, Guilherme Leal wrote:
Sincerely, I can't see the ExtJS's Models as true models on an MVC (or MVT for instance) context, since the only real uses I've seen of them is to bind form controls to any "model like" (basically anything) structure. Therefore, the best comparsion for the ExtJS would be AngularJS (this is my point of view, I might be wrong on this one).

But if you REALLY want to compare them, I would say that the biggest point that django excels ExtJS, is that ExtJS doesn't have any meaningfull way to introspect your DB to build the models dynamically, and with django you can. As an exemple, with django, you can build an app that read your DB metadata and build everithing from there (basicaly models; the views and templates you can build in a way that they can read everything on a given standard).

If you provide more specific info about the project, maybe we can come with some more concrete comparsions.

Em Mon Dec 29 2014 at 12:56:05, Joris Benschop <joris.b...@gmail.com> escreveu:

Hi List,

I;m a data maangement specialist in a rather large multinational. I'm trying to push Django as a fast development framework for front-end applications of our databases. Currently the company is focusing on Sencha ExtJS and java solutions. Can you help me with pointers why Django is better? The free-as-in-beer argument is not very convincing by itself. 

Thanks
Joris
--
You received this message because you are subscribed 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/53e17853-9922-4f77-bf9a-4cea7d35ade3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/gbI1X93KjQg/unsubscribe.
To unsubscribe from this group and all its topics, 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/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54A2667B.9030105%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@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/CAOs3Lp5rA49SikYDxDydNvhkwvQdyXZXDfeBvOA%3D%2BiNyNgHeng%40mail.gmail.com.

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



--

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/gbI1X93KjQg/unsubscribe.
To unsubscribe from this group and all its topics, 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/CACVFg4vmBmGW1M0bxJkArfEzWmodO8f6i5UHJfk184Vf%3DZH1KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@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/2bd7c60b-69c8-4859-822b-6137b418b02e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.