Django for desktop app development

2018-09-07 Thread Muhammad Dilshad Khaliq
I am final year student of software engineering.My final year project is about fee management system where student submit fee online and administrator use this system for managing fee and scholarship of student and notifying them about their any issue.So can i make web based application or

django install

2018-09-07 Thread gonzalo rodrigo pereyra
saludos. soy nuevo en el increible mundo de la programacion, primero comence leyendo mucho y me gusto python., asi que lo instale ( la version 3.6.5.) y me gusta mucho dibujar asi que me incline para hacer diseño de paginas con django. si no es mucha molestia me podrian ayudar a instalar el

Different results of running pure SQL query from Django and from PGAdmin

2018-09-07 Thread Pierre-Louis K.
Hello django-users, I have been encountering a strange behaviour when trying to run SQL directly with a cursor. I am using Django 1.11 with porstgres 9.5.The query normally returns 7 rows with 2 columns. Symptoms: - When reading the queryset of a query I get wrong results -> I still have 7

Re: How can I modify the html of the fileupload?

2018-09-07 Thread Jorge Cadena
I forgot to leave, as I render the input {% elif field.field.widget.input_type in "file" %} {{ field.errors }} {{ field.label }}

How can I modify the html of the fileupload?

2018-09-07 Thread Jorge Cadena
I want to modify or format the html generators by the input type="file". I want to give it its own style, with the same structure as the html of the input type="file", of the admin but: I'm rendering the form, manually, to add materializecss styles

Re: what is the difference?

2018-09-07 Thread Andréas Kühne
Hi, First of all - the examples you are giving can't be correct. z = Model.objects.get(name=x) will only return 1 object - and will raise an exception if you get more than one result. So in this case z should be an instance of the model Model. z = and cannot be [, ] When querying the second

what is the difference?

2018-09-07 Thread MikeKJ
[, ] and [[, ]] 1st came from z = Model.objects.get(name=x) This returns the object name 2nd came from z = Model.objects.filter(name=x) The 2nd method when you look for the id for x in z: print(x.id) fails with 'QuerySet' object has no attribute 'id' also tried zz =

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Andréas Kühne
Yes but it is completely OK to have a directory called models to store your models in. That's the way we do it for our project. However you can't have both a directory AND a models.py file. If you choose to go with the models module (a directory called models), you need to have the __init__.py

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
Ok ... Shame ... i found, One day I created a "models" directory to store my models ... So because of this, it didn't make any migrations ... Sorry for the inconvenience, but now I know I have to take care about my folder naming convention ... Kind regards Benjamin. -- You received this

Re: Django Nested Query with Aggregate.Sum()

2018-09-07 Thread Simon Charette
The annotate(seats_remaining=...) will add a `seats_remaining` attribute to Event instances returned from the queryset so you should be able to use {{i.seats_remaining }} Cheers, Le vendredi 7 septembre 2018 04:38:05 UTC-4, mab.mo...@gmail.com a écrit : > > Thank you Simon. > > I will take a

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Andréas Kühne
Ok - I think you need first of all to decide if you want to use the models module or a models.py file. You are now using both - which won't work. The import that you have written in the __init__.py file shouldn't work either because you are using a relative import to get an absolute file. First

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
I agree it should, but it doesn't, better, it does not find my model: [image: project_structure.png] [image: issue__init__.png] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Andréas Kühne
So the models directory should look like this: __init__.py model1.py In the __init__.py file you should have the following: from .model1 import Model1 Then it should "just work". Regards Andréas Den fre 7 sep. 2018 kl 16:35 skrev Benjamin SOULAS < benjamin.soula...@gmail.com>: > Ok, so I

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
Ok, so I think I really have a much deeper problem, __init__.py file are there, nothing still happen Le vendredi 7 septembre 2018 16:31:01 UTC+2, Andréas Kühne a écrit : > > If you follow the way Mike suggests - migrations will work (this is the > way we do it in our plattform). The important

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Andréas Kühne
If you follow the way Mike suggests - migrations will work (this is the way we do it in our plattform). The important thing is that you MUST have a models.py file OR a models module (a directory with the name models and a __init__.py file with the imports from the individual files). Regards,

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
Hi Mike (again !), Okay, but it seems I have a much deeper problem, nothing happens during make migration command, I am thinking on deleting my db and restart from scratch ... Thanks ! Le vendredi 7 septembre 2018 16:25:21 UTC+2, Mike Dewhirst a écrit : > > Easy > > Create a models

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Mike Dewhirst
Easy Create a models directory. In there make __init__.py file and in there ... from .whatever import Whatever ... 100 classes Then in ./models create 100 files with one model class in each file Anywhere in the project you can say ... from app.models import Whatever Connected by Motorola

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
Ok, but importing external scripts (but still in the project) should work? Even adding my model code inside models.py, no migration happens. Le vendredi 7 septembre 2018 16:18:47 UTC+2, Gerald Brown a écrit : > > There should be a models.py file under each of your applications. > > On Friday, 07

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Gerald Brown
There should be a models.py file under each of your applications. On Friday, 07 September, 2018 10:06 PM, Benjamin SOULAS wrote: Hi everyone, Quick question I do not find the answer: does models have to located into *models.py* script? It believe not, If I got a project composed of 100

models.py => Mandatory to create tables?

2018-09-07 Thread Benjamin SOULAS
Hi everyone, Quick question I do not find the answer: does models have to located into *models.py* script? It believe not, If I got a project composed of 100 tables, it's weird to me that all models should be located here ... I tried, in this file, to import a model located somewhere else, but

Re: How to save multiple model form in one template?

2018-09-07 Thread Anthony Petrillo
Here is an example. I've cut out some of the code, but I this will give you the general idea. Note, I move the data from the Day form in to the Classes table. But you could just save both sets of data to their respective tables if desired. in views.py class

Re: How to save multiple model form in one template?

2018-09-07 Thread Akshay Gaur
I think it would be easier to write out a custom form (without using your model classes, just the fields that you will need for all the models) and then in the save method for that form's view, you create model objects using the fields in the POST request. On Friday, September 7, 2018 at

I have to make a master detail form

2018-09-07 Thread Md.iftequar iqbal
I am a newbie to Django. I was trying in to make an employee management system. So I need an advice on how to create a master-detail type layout -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: How to save multiple model form in one template?

2018-09-07 Thread Sunil Kothiyal
Do you have something to save multiform using by one view?/ On Fri, Sep 7, 2018 at 5:33 PM Elphas Rop wrote: > you make the 3 forms then make a view for saving each form then url for > each them then in each form action add a url to the view responsible for > saving it > > On Fri, Sep 7, 2018,

Re: How to save multiple model form in one template?

2018-09-07 Thread Elphas Rop
you make the 3 forms then make a view for saving each form then url for each them then in each form action add a url to the view responsible for saving it On Fri, Sep 7, 2018, 14:27 Elphas Rop wrote: > >> >>> tax_rate = forms.FloatField(required=True, label="tax rate") >>> >>> >>>

Re: How to save multiple model form in one template?

2018-09-07 Thread Sunil Kothiyal
following are my models they are not related to each other. class StUserTaxDetails(models.Model): user = models.ForeignKey(UserModel, on_delete=models.DO_NOTHING, null=False, default=None) tax_name = models.CharField(max_length=50) tax_rate = models.FloatField() def __str__(self): return

Re: How to save multiple model form in one template?

2018-09-07 Thread Mohammad Aqib
Show your models.py. On Fri, Sep 7, 2018 at 4:13 PM Django Lover wrote: > > I have one page, which I have to show three model form and three > different submit button for each. > > My question is how I can save these three form individually? > > FOLLOWING IS CODE:- > > **form.py** > > > class

Re: Creating a single page app

2018-09-07 Thread Jani Tiainen
Hi. Django is really frontend agnostic and there isn't definite answer what is the best framework. So pick one that you're happy with. pe 7. syysk. 2018 klo 8.20 Md.iftequar iqbal kirjoitti: > Which is the best best frontend js for django > > > On Fri, 7 Sep 2018, 10:34 am Andréas Kühne, >

How to save multiple model form in one template?

2018-09-07 Thread Django Lover
I have one page, which I have to show three model form and three different submit button for each. My question is how I can save these three form individually? FOLLOWING IS CODE:- **form.py** class UserTaxesMultiForm(MultiModelForm): form_classes = { 'user_tax_form': MyForm,

Re: How to support to connect GreenPlum with the 'django.db.backends.postgresql_psycopg2' ?

2018-09-07 Thread Vincent Pemberton
Hi Ruping, I realise you posted this over two years ago but my company is trying to integrate Django with Greenplum for a small project. I more or less believe it isn't possible without changing Django's own code (which we strictly do not want to do) so I'm wondering if you ever got it to

Query is breking for no clear reason

2018-09-07 Thread Marcelo Juan Saciloto
HELLO, good morning! I am not very familiarised with python, but I have been reading some documentations, so have been struggling with one problem, I hope someone is able to help me. So I have created a queryset to insert the locale clause in all queries in 3 different models of my

Re: Django Nested Query with Aggregate.Sum()

2018-09-07 Thread mab . mobile . 01
Thank you Simon. I will take a look at annotations. How would I represent seats remaining in the template for loop? Here is what I have so far. # {% for i in events %} {{ i.event_date|date:"l M j, Y" }} {{ i.event_time|date:"g:i A" }}

Re: Subgroups Implementation (from LDAP)

2018-09-07 Thread Benjamin SOULAS
Well indeed, flattening the ldap groups hierarchy could be a solution, but I don't know if my boss will be OK with that, we are still thinking about implementation and explore the techno we need to implement our features. But I think I will keep it in mind seriously, because it could resolve

Re: Subgroups Implementation (from LDAP)

2018-09-07 Thread Mike Dewhirst
On 7/09/2018 4:38 PM, Benjamin SOULAS wrote: Actually, I don't use ldap groups permission really, I'm jumping to conclusions here with inadequate evidence. But I'll go ahead anyway. It makes sense to me that your app being different than the ldap system will have no use for ldap permissions.

Re: Contributing to Django

2018-09-07 Thread Michal Petrucha
On Fri, Sep 07, 2018 at 11:36:27AM +0530, Sanjeev Singh wrote: > Thank you for replying me back Sir, It will be great help for me if you can > provide me some links where I should go for that, how I can jump into this. > Thank you. Hi Sanjeev, Really cool that you want to get involved! I'd

Re: Subgroups Implementation (from LDAP)

2018-09-07 Thread Benjamin SOULAS
Actually, I don't use ldap groups permission really, I have just configured my settings in which AUTH_LDAP_GROUP_SEARCH looks for a posixGroup Type (it is what I use for now, but in the future, it would be logical there will have GroupOfName and other types). My aim is to use django-auth-ldap

Re: Contributing to Django

2018-09-07 Thread Sanjeev Singh
Thank you for replying me back Sir, It will be great help for me if you can provide me some links where I should go for that, how I can jump into this. Thank you. On Fri, Sep 7, 2018 at 11:12 AM Andréas Kühne wrote: > That's good if you think you have that experience. Contributing back is >