Re: Inventory management system

2019-11-21 Thread amit sharma
Hi there , if you want I can work for you.And make inventory management as
per your needs.work will be as per guidelines provided by you plus that
would be very cost  efficient.

On Fri, Nov 22, 2019 at 4:36 AM Ibrahim Abdelaty 
wrote:

> Hello guys,
>
> Iam in urgent need for help with building an inventory management system
> with a specific requirement if you are interested please contact 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3792837a-a8c3-4990-8aae-7f9ea88b95c6%40googlegroups.com
> 
> .
>

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


Re: Inventory management system

2019-11-21 Thread Mad Ewell


On Friday, November 22, 2019 at 10:07:29 AM UTC+11, Ibrahim Abdelaty wrote:
>
> Hello guys, 
>
> Iam in urgent need for help with building an inventory management system 
> with a specific requirement if you are interested please contact me.
>

I'm interested. Might need one myself.What is the specific requirement?

Made

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/94cafd06-c90e-43f2-9e54-0b4514248fd2%40googlegroups.com.


Integration of Django-cms site with django blog

2019-11-21 Thread হজমুলা খান
Hi

Recently I have made a website with django-cms and another blog site with 
django. Now I want to integrate Django blog site with one of the pages of 
Django-cms’s site.

Should I use aaphook or djangocms-blog? I am a new learner of Django. I am 
little bit confused on which way I should go...

Does any one have any good materials to understand those??

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1b6bc29-1e7f-413c-8d34-b37cec21a393%40googlegroups.com.


Re: How to display on Django page based on user's condition?

2019-11-21 Thread James Dunn
In your view you can do:

user = request.user

Then you can get Employee with:

employee = Employee.objects.get(user=user)
Then just get the attributes from the models that you need:
eg:

employee.division


On Thu, 21 Nov 2019 at 19:57, Pema Galey  wrote:

> Hi All,
> I am Employee model directly link with User model and Employee holds User
> ID and division from Division model.
> Every employee holds single Division.
>
> class Employee(models.Model):
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> division = models.ForeignKey(
> Division,
>
>
> )
>
> Now, I want to do following things:
> 1) Get current username /ID
> 2) Get Employee division ID/name
> 3) Display the other data based on Employee's division. [That particular
> Employee should be accessible to their own Division data only]
>
> Someone help me to handle this one please.
>
> Thank you in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a536c1fb-6852-48f9-8476-463c696926a2%40googlegroups.com
> 
> .
>

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


Inventory management system

2019-11-21 Thread Ibrahim Abdelaty
Hello guys, 

Iam in urgent need for help with building an inventory management system 
with a specific requirement if you are interested please contact 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3792837a-a8c3-4990-8aae-7f9ea88b95c6%40googlegroups.com.


How to display on Django page based on user's condition?

2019-11-21 Thread Pema Galey
Hi All,
I am Employee model directly link with User model and Employee holds User 
ID and division from Division model.
Every employee holds single Division.

class Employee(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
division = models.ForeignKey(
Division,
   
  
)

Now, I want to do following things:
1) Get current username /ID
2) Get Employee division ID/name
3) Display the other data based on Employee's division. [That particular 
Employee should be accessible to their own Division data only]

Someone help me to handle this one please.

Thank you in advance.

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


Re: Directly Accessing Dictionary Values

2019-11-21 Thread Jim Illback
Check out this URL and the embedded Django link in the answers: 
https://stackoverflow.com/questions/1700661/how-to-access-array-elements-in-a-django-template.


On Nov 20, 2019, at 10:25 AM, Andrew Stringfield 
mailto:loneso...@gmail.com>> wrote:

I have not!  I did see something about that on a website.  Would it go 
something like: dictionary_name.fieldname.0 ?  I will try it out later today.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f1615df3-04bc-4a28-9914-535c51f13268%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ACBD58F-2A6D-4E23-AD31-2636D22C9C0A%40hotmail.com.


Reverse loopup for admin_order_field?

2019-11-21 Thread Mark Phillips
I have two models
class Document(Model):
document_id = models.AutoField(primary_key=True)
... other fields

class DocumentMetaData(Model):
documentMetaData_id = models.AutoField(primary_key=True)
document_id = models.ForeignKey(Document, on_delete=models.CASCADE,
verbose_name="document file name")
metadata = JSONField(blank=True)

The metadata in the DocumentMetaData model has a key 'Decade' in the
JSONField.

In the DocumentMetaDataAdmin I have this for a sortable Decade field:
def get_decade(self, obj):
return obj._decade
get_decade.admin_order_field = '_decade'

I would like to have a get_decade function in the DocumentAdmin that
displays a Decade column in the DocumentAdmin page, and have that field
sortable. So far, I can get the Decade column in the DocumentAdmin by doing
this:
def get_decade(self, obj):
result =
DocumentMetaData.objects.get(document_id=obj.document_id).metadata['Decade']
return result
get_decade.admin_order_field = 'get_decade'

But the sorting part does not work - I get a field error as there is no
decade field in the Document model. Is there some way to do a reverse
lookup on the document_id field to the DocumentMetaData model (since
admin_order_field needs a related model) so I can sort on the decade field
in the DocumentAdmin?

Thanks!

Mark

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


How to convert three DB's w/in django syntax

2019-11-21 Thread nmaxbe...@gmail.com
New to django not Python(learned with Jupyter Notebooks)...can't wrap my 
"brain" on how to import three csv files into django as DB's and then 
combine them into one point of reference.  I personally want to create one 
Excel file (outside of django) and import but this is a class project and 
want to show I am learning.  I've followed the docs.djangoproject but 
continuously find myself in the weeds. I think(?) I understand MVC but get 
lost with whether I should write python code in my models.py ,  or 
views.py  My project is allowing a user to type in their zip code to 
determine their congressional district (and other "fun" facts will also be 
displayed based on my html).

I am looking for guidance... in.which comes first(defining models- did 
that; setting up URL's(I think I did that). I am confused on my data 
"execution.  I am using Windows 10, VSC, django 2.2.x, and squlite3.

The project is called "gerry" and the app is Kentucky.  It would be great 
if I could "figure out" why I am stuck or more importantly what are my next 
steps?

The github access is https://github.com/NinaMaxberry/Cornerstone-Project.  
I am not sure if you will see access...admin,passwords are new to me.  Let 
me know.


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


Re: Boto3, aws, workdocs

2019-11-21 Thread Integr@te System
hi eager man,
follow your need.
https://boto3.amazonaws.com/v1/documentation/api/latest/index.html

On Thu, Nov 21, 2019, 19:32 Yann Mbella  wrote:

> Hey guys need help in usage of this service boto3 with workdocs if someone
> has a link of any tutorial please help urgent
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/41e64a69-f2dd-448d-8688-9bbfc1af%40googlegroups.com
> 
> .
>

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


Boto3, aws, workdocs

2019-11-21 Thread Yann Mbella
Hey guys need help in usage of this service boto3 with workdocs if someone 
has a link of any tutorial please help urgent

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


[no subject]

2019-11-21 Thread Paras Jain
i am not rendring to detail page
views.py:
def detail(request):
#print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':request.user})

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)   # get will fetch details
from database and it will match value with post

if user.password == password:

if user.type == 'Manager':
return redirect('company-add')

if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return HttpResponseRedirect(reverse('company-detail'),user)
# return redirect('company-detail',user)
# return detail(request,user)
else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')


urls.py:
from django.urls import path
from django.conf.urls import  url
#from .views import HomePageView
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),

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


Re: Admin form in intermediate page

2019-11-21 Thread Thiago Luiz Parolin
Thank you!!!
It helped me a lot!! :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8D14347D-B6BC-4D0A-8A15-9765B644C34D%40unesp.br.


Re: reg: django Model for MCQs type project

2019-11-21 Thread 'Amitesh Sahay' via Django users
Hi Yoo, 

Thank you for your detailed reply. 
while I was waiting for some response. I did some research and I came up with 
some model as below. Please go through it and suggest the changes.
from django.db import models
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver


class Quiz(models.Model):
name = models.CharField(max_length=1000)
questions_count = models.IntegerField(default=0)
description = models.CharField(max_length=70)
created = models.DateTimeField(auto_now_add=True,null=True,blank=True)
slug = models.SlugField()
roll_out = models.BooleanField(default=False)

class Meta:
ordering = ['created', ]
verbose_name_plural = 'Quizzes'

def __str__(self):
return self.name


class Question(models.Model):
quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE)
label = models.CharField(max_length=1000)
order = models.IntegerField(default=0)

def __str__(self):
return self.label


class Answer(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
text = models.CharField(max_length=1000)
is_correct = models.BooleanField(default=False)

def __str__(self):
return self.text


class QuizTakers(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE)
correct_answers = models.IntegerField(default=0)
completed = models.BooleanField(default=False)
timestamp = models.DateTimeField(auto_now_add=True)

def __str__(self):
return self.user.username


class Response(models.Model):
quiztaker = models.ForeignKey(QuizTakers, on_delete=models.CASCADE)
question = models.ForeignKey(Question, on_delete=models.CASCADE)
answer = 
models.ForeignKey(Answer,on_delete=models.CASCADE,null=True,blank=True)

def __str__(self):
return self.question.label


@receiver(post_save, sender=Quiz)
def set_default_quiz(sender, instance, created, **kwargs):
quiz = Quiz.objects.filter(id=instance.id)

quiz.update(questions_count=instance.question_set.filter(quiz=instance.pk).count())


@receiver(post_save, sender=Question)
def set_default(sender, instance, created, **kwargs):
quiz = Quiz.objects.filter(id=instance.quiz.id)

quiz.update(questions_count=instance.quiz.question_set.filter(quiz=instance.quiz.pk).count())


@receiver(pre_save, sender=Quiz)
def slugify_title(sender, instance, *args, **kwargs):
instance.slug = slugify(instance.name)




Regards,
Amitesh 
 

On Thursday, 21 November, 2019, 11:54:57 AM IST, Yoo 
 wrote:  
 
 Have a Test model which as a unique identifier (BigAutoField). Get a Questions 
model with a foreign key to a test and a charfield for the question itself (you 
can add BrinIndex for optimization). You can add a booleanfield if the question 
is optional and whatever else you need (like the correct answer letter). Get an 
Answers model with a foreign key to a specific question. This is the most 
efficient.

You say you don’t need authentication, but it looks like students need some 
kind of it... BUT there is an alternative. If the student doesn’t have to fill 
out their name, then, using paths, you can show the student a URL that is 
connected to a record on another model. 

It could look like this: example.com/test/3?completed=846

With the path of completed=846, a view can query this new model, we’ll call 
Completed, that has the following attributes (columns): id (BigAutoField) and 
Your_Answers (ArrayField/JSONField Both PostgreSQL only). The view does a query 
on the test (test 3) to show and now also has data from the Completed table at 
the row with id=846.

Just to open your mind up to another world WHICH IS NOT EFFICIENT AND NOT 
PRETTY TO IMPLEMENT SO PLEASE DO NOT DO IT... You could also try it with 
PostgreSQL’s JSON attribute. Just make a test model which includes a unique 
identifier and a json field. The JSON field would just have keys be the 
question number (1-10) and then a... nvm here’s an example of a piece of json.

{
  1: {“question”: “What is your name?”,
      “answers”: [“blah1”, “blah2”, “blah3”] }
  2: {“question”: “What is your ethnicity?”,
      “answers”: [“blah1”, “blah2”, “blah3”] }
}

You could also try it NoSQL style with MongoDB. Each document is a test with a 
unique identifier
Good luck!
On Wednesday, November 20, 2019 at 12:21:38 AM UTC-5, Amitesh Sahay wrote:
> Hello Members,
> 
> 
> I have below requirements for a project where I need to develop the model 
> based on "multiple Choice Questions". Below are the criteria:-
> 
> 
> 
> Admin can create/edit/delete(soft delete only) a "Test" in the form of 
> MCQs.Admin can then create/edit/delete a "Question"
>  to each test. Each question contains the actual question, the correct 
> answer and 3 incorrect answers. An 

Re:

2019-11-21 Thread Paras Jain
my render is not working on calling the detail function : its not helping
me to reach the /detail url
  views.py:
def detail(request,user):
#print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':user})

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)   # get will fetch details
from database and it will match value with post

if user.password == password:

if user.type == 'Manager':
return redirect('company-add')

if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return detail(request,user)
else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')

urls.py:
from django.urls import path
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),


On Thu, Nov 21, 2019 at 2:06 PM Kasper Laudrup 
wrote:

> Hi Paras,
>
> On 21/11/2019 06.03, Paras Jain wrote:
> > i need the code i am not able to understand by reading documenetation
> >
>
> Then I suggest you focus on writing your requirements down and pay
> someone to write the code for you.
>
> If you're not even willing to learn, then software development is
> clearly not for you.
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fa5ab206-1087-0344-a163-f3f4441527ea%40stacktrace.dk
> .
>

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


Re:

2019-11-21 Thread Kasper Laudrup

Hi Paras,

On 21/11/2019 06.03, Paras Jain wrote:

i need the code i am not able to understand by reading documenetation



Then I suggest you focus on writing your requirements down and pay 
someone to write the code for you.


If you're not even willing to learn, then software development is 
clearly not for you.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fa5ab206-1087-0344-a163-f3f4441527ea%40stacktrace.dk.